HansKristian-Work / vkd3d-proton

Fork of VKD3D. Development branches for Proton's Direct3D 12 implementation.
GNU Lesser General Public License v2.1
1.86k stars 194 forks source link

ExecuteCommandLists() execution time spikes on Steam Deck #1228

Open sherief opened 2 years ago

sherief commented 2 years ago

I'm running a scene with a constant workload, and every frame a single copy command list is submitted on a high priority copy queue with some data needed for rendering. Every 1000 frames or so, the time for this one ECL call spikes to somewhere between 30 and 40 ms, and this throws off the frame times and makes 60 FPS unachieveable. The scene is not CPU bound, and can run at 60 FPS with the GPU at 950 to 1000 MHz. Forcing higher GPU clocks doesn't help. The frame times end up having spikes like this: image

What information would help in root causing this, and what avenues are best to dig deeper on my end?

misyltoad commented 2 years ago

Gpuvis might be useful potentially, you can take a gpuvis capture from the SteamOS Devkit Client

Can you share the app at all?

sherief commented 2 years ago

I can definitely collect a gpuvis trace - I can also share a small repro on any private channel you prefer.

misyltoad commented 2 years ago

You can email me it joshua@froggi.es

Does your app make heavy use of sparse?

sherief commented 2 years ago

By sparse do you mean tiled resources? If so then no, no use of tiled resources at all. GPU page table manipulation hasn't been a clear win for my use cases..

doitsujin commented 2 years ago

Might be worth printf-debugging our implementation to see what exactly is taking so long there.

In general, the ExecuteCommandLists call itself should be more or less free since we perform the actual submission on a dedicated thread, but the other thing that we (have to) do is submit some command buffers to clear newly allocated memory. So, if you're allocating large amounts of memory around the time those slow frames happen, consider using D3D12_HEAP_FLAG_CREATE_NOT_ZEROED and make sure your application initializes resources as necessary.