Fix gpu stats for msm driver#2073
Conversation
|
Anything I can do to get this reviewed? |
|
ping @17314642 |
|
Regarding As for the other two commits, I'll need to write a friend with whom I tested my previous changes, because I never had any Qualcomm SoCs, and see if anything's broken on his side What's your device and what was broken for you, only process vram, temperature and gpu load? |
I can also try to point you to the relevant code-changes, because most of this is just fixing stuff that #1704 broke.
The device is an Ayaneo Pocket S2 (SM8650) running postmarketOS. Basically all gpu stats were just showing 0 before. Without So these are just all the stats I managed to fix up easily. I am not sure, if e.g. full VRAM load is something that is supposed to work / could work with the info the driver exposes. But with these commits the three mentioned stats (process vram, temp, load) output sensible looking values again. |
|
Total vram usage not working is fine in this case |
|
Since mangohud-next is now part of master, my concern is that the two implementations will gradually diverge. Ideally both would eventually use the same metrics pipeline, but that's beyond the scope of this PR Given that, I think this PR should at least implement the corresponding functionality in mangohud-next as well, so we don't introduce another feature gap that has to be reconciled later |
|
The only thing mangohud-next is missing is process vram, hwmon fixes are not necessary because I changed the logic of how fdinfo fds are opened. Previously it was opening every file inside |
|
@Drakulix i opened a pr in your fork for adding pvram support to mangohud-next and also readme support table for qualcomm |
|
I also recalled how my code works, since it's been a while, I can confirm that those 3 commits should be totally fine |
|
Thanks @17314642! I pulled the two commits into the branch. |
|
@Drakulix I decided to make legacy mangohud use metrics code from mangohud-next, so that there is no deviation in functionality in the future. Can you please check it out and tell whether everything is working for you? https://github.com/17314642/MangoHud The mangohud-next implementation of qualcomm metrics is located in |
Sadly not, all three stats report 0 again. I can try to debug this later today. |
|
Can you send logs with |
|
|
Are you using gamescope? If yes, I forgot about it, can you try without it? |
|
Oh, and you're using something else than my branch, these logs are from old GPU_fdinfo implementation |
Yeah sorry, my packaging mistake. It is still not working though. This is now with just vkcube on a normal desktop with Under gamescope it does now list the GPU with 1% usage, 0-degrees temperature and some pvram used, which might be right for steam, but doesn't look like it switches to the game process. |
|
It doesn't switch to game process, because I forgot to add gamescope support, I'll add it. Does it work without gamescope though? |
No, it still list as 0. See the log. (And temperature never works.) |
|
Okay, let's fix GPU load and proc_vram first Can you send the output of |
Adreno-GPUs have split render and display nodes. As a result we sometimes deal with the
msm_dpumodule (for the display engine) or themsmmodule (for the render engine).#1704 and other PRs refactored the gpu detection logic in a way, where we don't set the module to
msmanymore. This broke the logic in gpu_fdinfo in several place for this specific driver. This PR is trying to fix everything I was able to easily identify.msm_dpuinstead ofmsmnow. (It seems like this logic might have previously applied to themsm_drmdriver as well, but I don't have a device to test that.) This fixes the displayed gpu temperature.fdinfoand the storedmodulewhich referrs to the display-engine driver in our case. I am not sure, if there is a better/cleaner way to do this, but like this we are at least not re-introducing a separatemsm_driverinstance member. This fixes the gpu load and pvram being actually displayed.