GameTechDev / PresentMon

Capture and analyze the high-level performance characteristics of graphics applications on Windows.
https://game.intel.com/story/intel-presentmon/
MIT License
1.56k stars 147 forks source link

Suspicious GPU numbers in apex legends #246

Open VoeSo opened 1 month ago

VoeSo commented 1 month ago

Hi,

I'm getting suspicous numbers reported in apex legends compared to other games

Issue 1:

Here is apex legends capped to 60 fps: pmissue4 GPUWait is very high, while GPULatency is low. GPULatency would indicate that gpu work on a frame is starting way before the cpu even starts simulation stage (since it's stalled by the framelimiter).

Here is a different game also capped to 60 fps without this issue: pmissue5

Issue 2:

There is significant DisplayLatency overhead in apex not accounted for by GPUBusy/GPUWait/GPULatency: pmissue6

For comparision a different game that works as expected: pmissue7 Here DisplayLatency is the same as GPULatency+GPUBusy+GPUWait as you would expect

EDIT: It's not an issue of apex legends vs other games....it's that I disabled fullscreen optimizations for apex, not for the other game. Independent flip gives good numbers, while legacy flip gives the issues above(tested and confirmed in multiple games now)

JeffersonMontgomery-Intel commented 1 month ago

Hard to say for sure without more debug, but this is likely expected. With legacy flip presentation mode, there can be a small amount of gpu work that needs to happen near display time, so for workloads that aren't gpu bound you can end up with a gpu work timeline that looks something like this:

[XX XXXXXXX]

Total GPU duration (end-start) will be ~frametime, but a lot of it can be GPUWait.

VoeSo commented 1 month ago

Total GPU duration (end-start) will be ~frametime, but a lot of it can be GPUWait.

FWIW I checked with the old msGpuActive metric and that works fine - no 16ms gpu duration. Also the reflex latency bars in rtss show normal gpu duration.....

JeffersonMontgomery-Intel commented 1 month ago

msGPUActive is not the same as GPU duration (end-start) it is just the part where GPU is doing something.

We will try to reproduce this and check if there is something wrong here. Also, if you can provide a short ETL we can check that (https://github.com/GameTechDev/PresentMon/blob/main/CONTRIBUTING.md#if-there-is-something-wrong-with-the-data-presentmon-is-reporting).

VoeSo commented 1 month ago

I tried to make the etl but get syntax error 4000 when running log.cmd syntax4000

To reproduce the issues, run any dx11 title in hardware legacy flip. I forgot to mention that the gpu render start point(CPUStartTime+GPULatency) is exactly the point where gpu render finished in the previous frame(prevCPUStartTime+prevGPULatency+prevGPUBusy+prevGPUWait).

jenatali commented 1 month ago

That syntax error in log.cmd is a known localization problem in the steps for gathering available memory for determining buffer sizes.

VoeSo commented 1 month ago

That syntax error in log.cmd is a known localization problem in the steps for gathering available memory for determining buffer sizes.

If you can proivide me with steps to solve the error.....otherwise as I said, the issue is easy to reproduce on any system.

JeffersonMontgomery-Intel commented 1 month ago

Sorry, I wasn't aware of that issue -- I'll update the instructions.

It looks like there are some edits to the log.cmd that you could make. (e.g., https://www.yosoygames.com.ar/wp/2016/09/solving-gpuview-4000-was-unexpected-at-this-time-error/).

Another option is you can use the start_etl_collection.cmd and stop_etl_collection.cmd scripts here: https://github.com/GameTechDev/PresentMon/tree/main/Tools

VoeSo commented 1 month ago

Another option is you can use the start_etl_collection.cmd and stop_etl_collection.cmd scripts here: https://github.com/GameTechDev/PresentMon/tree/main/Tools

Is there an email I can send the etl file to, or any option other than posting it here publicly?

VoeSo commented 1 month ago

"Issue #246 trace" -sent!

JeffersonMontgomery-Intel commented 1 month ago

Thanks for providing the ETL. I've reproduced your findings and see what the problem is, and am working on a fix.