MangoHud icon indicating copy to clipboard operation
MangoHud copied to clipboard

GPU utilization always at 100% on Vega 3

Open bsolos opened this issue 2 years ago • 2 comments

GPU utilization always shows 100% even when idling. I'm sure it isn't MangoHud's fault, because /sys/class/drm/card0/device/gpu_busy_percent is 100 all the time too. I've seen this issue already mentioned here 10 months ago, with no reply.

What's interesting is that radeontop seems to display the GPU utilization correctly. After taking a look at the source code, I've concluded that it calculates the percentage by repeatedly sampling amdgpu_read_mm_registers (take a look at amdgpu.c:25), &-ing it with 1U<<31 (ticks.c:53) and then dividing the number of times it wasn't 0 by the number of samples (ui.c:141). Can such a mechanism be implemented in MangoHud as a workaround for some problematic Vega GPUs?

bsolos avatar Feb 10 '23 13:02 bsolos

I've coded a terrible proof of concept here and it seems to produce accurate results

bsolos avatar Feb 10 '23 21:02 bsolos

I've recorded a video (sorry for the terrible quality)

https://user-images.githubusercontent.com/55354883/218252682-661e1527-38ad-430c-9bff-20523137ab24.mp4

bsolos avatar Feb 11 '23 10:02 bsolos