wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
8.56k stars 587 forks source link

D3D11 profiling problems in 0.10 #670

Open niello opened 7 months ago

niello commented 7 months ago
  1. is_active var is referenced but there is only active. Compilation error. https://github.com/wolfpld/tracy/blob/116e82de9ebbf3937b066a3be23b8d8de16b2a0a/public/tracy/TracyD3D11.hpp#L360
  2. In a regular run an application never reaches here, tcpu and tgpu remain 0 and GPU track is not drawn. But manually walking this part under debugger seems to give GPU enough time to finish the query and then data appear. https://github.com/wolfpld/tracy/blob/116e82de9ebbf3937b066a3be23b8d8de16b2a0a/public/tracy/TracyD3D11.hpp#L114-L115
  3. Pressing "Auto" button in this situation crashes the client image
  4. On init D3D11 spawns a warning: D3D11 WARNING: ID3D11DeviceContext::End: End is being invoked on a Query, where the previous results have not been obtained with GetData. This is valid; but unusual. The previous results are being abandoned, and new Query results will be generated. [ EXECUTION WARNING 410: QUERY_END_ABANDONING_PREVIOUS_RESULTS]

Release 0.10 Windows, D3D11 On-demand connection mode

wolfpld commented 7 months ago

@slomp Can you take a look?

slomp commented 7 months ago

Sure, I'll try to investigate it this week!

simonvanbernem commented 3 months ago

I also ran into some of these issues, with 0.10.0. Is there an update to this? is_active was already fixed in https://github.com/wolfpld/tracy/issues/753, but I'm also seeing the d3d11 warnings being generated. I can't repro crashing the client by clicking "Auto" though, this works for me. And the GPU track is also visible. So I guess there have been a bunch of fixes already?

slomp commented 3 months ago

but I'm also seeing the d3d11 warnings being generated.

Which warnings? Only this one?

warning: D3D11 WARNING: ID3D11DeviceContext::End: End is being invoked on a Query, where the previous results have not been obtained with GetData. This is valid; but unusual. The previous results are being abandoned, and new Query results will be generated. [ EXECUTION WARNING 410: QUERY_END_ABANDONING_PREVIOUS_RESULTS]
simonvanbernem commented 3 months ago

but I'm also seeing the d3d11 warnings being generated.

Which warnings? Only this one?

warning: D3D11 WARNING: ID3D11DeviceContext::End: End is being invoked on a Query, where the previous results have not been obtained with GetData. This is valid; but unusual. The previous results are being abandoned, and new Query results will be generated. [ EXECUTION WARNING 410: QUERY_END_ABANDONING_PREVIOUS_RESULTS]

yes

simonvanbernem commented 3 months ago

Although I also get a crash in TracyD3D11.hpp when connected to the server and vsync turned off in a scene where my game runs at >1000fps:

Assertion failed: false && "TracyD3D11: " "timestamp expected to be ready, but it was not!", file C:\Workspaces\spaced\source\tracy\public/tracy/TracyD3D11.hpp, line 224

Should I open a new issue for that, or is there some information I could give that would be helpful?

slomp commented 3 months ago

when connected to the server and vsync turned off in a scene where my game runs at >1000fps:

Are you calling TracyD3D11Collect periodically when vsync off?

simonvanbernem commented 3 months ago

when connected to the server and vsync turned off in a scene where my game runs at >1000fps:

Are you calling TracyD3D11Collect periodically when vsync off?

Yes, immediatedly after IDXGISwapChain_Present. I have three calls to ID3D11DeviceContext_End in my own code that I use(d) to measure the GPU frame times before I used tracy. Might that interfere?

slomp commented 3 months ago

Would you by any chance have a small, dependency-free minimal reproducible code that you could share? (I dug some old D3D11 code I had and tried to reproduce the issue, but was unsuccessful).

simonvanbernem commented 3 months ago

Would you by any chance have a small, dependency-free minimal reproducible code that you could share? (I dug some old D3D11 code I had and tried to reproduce the issue, but was unsuccessful).

No, sorry. Only a big application that doesn't even repro it 100% of the time.

slomp commented 1 month ago

PR open to address the is_active compilation error with TRACY_ON_DEMAND: https://github.com/wolfpld/tracy/pull/806