flightlessmango / MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more. Discord: https://discordapp.com/invite/Gj5YmBb
MIT License
6.54k stars 291 forks source link

add intel gpu usage support via fdinfo and fix fdinfo code a little #1464

Closed 17314642 closed 3 weeks ago

17314642 commented 1 month ago

I didn't really dive into details, but for some reason DETECT_OS_UNIX is never defined when I'm compiling on either NixOS or when using flatpak-builder to test mangohud for steam, so I deleted that for now.

Next comes "drm-engine-gpu" bit. "gpu" is only for msm gpus, for other gpu drivers we should use different names. That's why I added a "get_drm_engine_type" function to retrieve load type name based on gpu driver. For now I added only amdgpu, i915 and msm because they were already referenced in the project.

Last thing is the method of calculating load. Biggest change here is waiting for at least METRICS_UPDATE_PERIOD_MS (500ms) before trying to update usage percentage. On my pc old method was not working correctly, it either was always showing 100% or always showing 0% with spikes to 100%.

Can't wait for any feedback. Hopefully this commit will finally fix intel gpu usage and I can finally play without having my phone below my monitor with ssh and intel_gpu_top on the phone's screen.

flightlessmango commented 3 weeks ago

This looks great! can you just squash the "merge branch" commit?

17314642 commented 3 weeks ago

Done.