MangoHud icon indicating copy to clipboard operation
MangoHud copied to clipboard

MangoHud Intel GPU metrics

Open flightlessmango opened this issue 1 year ago • 12 comments

This issue is for tracking the progress and issues with Intel GPU metrics. dGPU and iGPU.

Current state

  • intel_gpu_top has to be installed and it has to be setcap'd e.g sudo setcap cap_perfmon=+ep /usr/bin/intel_gpu_top
  • We are set up to get GPU load at least from intel_gpu_top
  • MangoHud is only able to run intel_gpu_top unhindered outside of proton/runtime
  • In order for us to run intel_gpu_top you need to have flatpak installed and set sniper runtime to beta

flightlessmango avatar Jul 25 '23 11:07 flightlessmango

this: sudo setcap cap_perfmon=+ep /usr/bin/intel_gpu_top, it did not work for me, I saw that others do work, because it can be?

Cris-lml007 avatar Dec 02 '23 23:12 Cris-lml007

What mangohud version are you using?

flightlessmango avatar Dec 03 '23 08:12 flightlessmango

version 0.7.0

Cris-lml007 avatar Dec 04 '23 02:12 Cris-lml007

It does not work for me either with sudo setcap cap_perfmon=+ep /usr/bin/intel_gpu_top.

getcap /usr/bin/intel_gpu_top shows it is applied correctly. /usr/bin/intel_gpu_top cap_perfmon=ep

Failed to initialize PMU! (Permission denied)

When running as a normal user CAP_PERFMON is required to access performance
monitoring. See "man 7 capabilities", "man 8 setcap", or contact your
distribution vendor for assistance.

More information can be found at 'Perf events and tool security' document:
https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html
[2024-01-22 15:52:48.046] [MANGOHUD] [info] [intel.cpp:74] Missing permissions for 'intel_gpu_top'
[2024-01-22 15:52:48.046] [MANGOHUD] [info] [intel.cpp:76] Disabling gpu_stats

MangoHud 0.7.0-2+ Arch Linux GNOME 45.3 on Wayland Linux 6.7.0-arch3-1

nokia8801 avatar Jan 22 '24 12:01 nokia8801

MangoHud is only able to run intel_gpu_top unhindered outside of proton/runtime In order for us to run intel_gpu_top you need to have flatpak installed and set sniper runtime to beta

These two points seem to be fixed, I have everything working in Proton 8.0-5, v0.7.0-2+ with no hitches. GPU load and frequency function without issues.

Only major remaining thing that would be nice is GPU power draw.

tazz4843 avatar Feb 08 '24 17:02 tazz4843

I was just wondering, is there a specific reason why intel gpu metrics are collected with intel_gpu_top? It looks like it should be possible to obtain the same stats through the drm & hwmon kernel interfaces, like what's done in resources: https://github.com/nokyan/resources/blob/v1.4.0/src/utils/gpu/intel.rs#L38.

That way you wouldn't need to rely on intel_gpu_top being installed and having it setcap'd.

kira-bruneau avatar May 04 '24 23:05 kira-bruneau

is there a specific reason why intel gpu metrics are collected with intel_gpu_top

Most of these metrics required root for access and as a shared library we're not able to access root things without a middle man program

flightlessmango avatar May 05 '24 12:05 flightlessmango

Hi hi, after upgrading to 0.7.2 from 0.7.1 (flatpak) my GPU % use is always 0. I have an iGPU that is HD610. Im with ubuntu 22.04.4 and I use MangoHud with retroarch, lutris and also steam, not sure if I can help, Im new to linux. Love your work <3

jcsstelar avatar Aug 12 '24 00:08 jcsstelar