Skip to content

feat(gpu_fdinfo): support Intel integrated GPU metrics#2080

Open
JohnnySun wants to merge 4 commits into
flightlessmango:masterfrom
JohnnySun:intel-rapl-gpu-power
Open

feat(gpu_fdinfo): support Intel integrated GPU metrics#2080
JohnnySun wants to merge 4 commits into
flightlessmango:masterfrom
JohnnySun:intel-rapl-gpu-power

Conversation

@JohnnySun

@JohnnySun JohnnySun commented Jun 24, 2026

Copy link
Copy Markdown

Summary

  • add an Intel integrated GPU power path that reads the RAPL uncore energy counter from /sys/class/powercap when no Intel DRM hwmon power or energy sensor is present
  • keep existing Intel discrete i915/xe hwmon power and energy behavior preferred over the RAPL fallback
  • detect Intel integrated fdinfo memory fallback keys (drm-resident-system0 on i915, drm-resident-gtt on xe) when local or VRAM fdinfo memory is absent
  • feed that current-process shared memory value into the vram overlay row so SteamOS mangoapp presets show useful memory usage without claiming total system VRAM support
  • treat missing fdinfo-backed hwmon readings as unavailable so the HUD does not render fake 0 values for temperature, power, fan, voltage, or memory clock
  • declare the OpenGL symbols needed by standalone mangoapp
  • update the Intel notes to document the integrated-GPU limitations

Why

Some Intel handheld systems using the xe driver expose fdinfo load, GT frequency, throttling, and process-scoped shared memory, but do not expose a DRM hwmon power or temperature sensor. On the tested SteamOS 3.8.11 MSI Claw 8 AI+ system, GPU energy is exposed through the powercap uncore domain and GPU memory is exposed in /proc/<pid>/fdinfo as nonzero drm-resident-gtt values.

This keeps the existing Intel discrete path intact: if i915 or xe exposes local or VRAM fdinfo memory and hwmon power/energy sensors, those remain the selected sources. The fallback is only used for integrated Intel devices where the usual local or VRAM fdinfo memory key is missing.

This PR does not synthesize GPU temperature. If the kernel does not expose a DRM hwmon temperature input, the HUD now leaves the unavailable temperature hidden instead of rendering 0 C.

Verification

  • git diff --check upstream/master..HEAD
  • built the standalone mangoapp target from this branch in a SteamOS x86_64 build environment; produced BuildID 056418c4c27aece7b226e5c24807ec33ca8810e4
  • smoke-tested that rebuilt mangoapp on a SteamOS 3.8.11 MSI Claw 8 AI+ by temporarily overriding the stock gamescope-mangoapp.service; verified the running process BuildID matched 056418c4c27aece7b226e5c24807ec33ca8810e4
  • checked the live target sensor sources used by this PR:
MangoHud GPU power sensor readable: /sys/class/powercap/intel-rapl:0:1/energy_uj delta=134399uj
MangoHud GPU memory fdinfo: comm=Aokana.exe pid=63848 client=640 gtt=860260 KiB system0= vram0=
MangoHud GPU memory fdinfo: comm=mangoapp pid=79182 client=643 gtt=47572 KiB system0= vram0=
MangoHud GPU temperature sensor unavailable: no DRM hwmon temp input is exposed

@JohnnySun JohnnySun force-pushed the intel-rapl-gpu-power branch from c1070aa to dcb3704 Compare June 24, 2026 03:15
@JohnnySun JohnnySun changed the title gpu_fdinfo: read Intel iGPU power from RAPL feat(gpu_fdinfo): read Intel iGPU power from RAPL Jun 24, 2026
@JohnnySun JohnnySun force-pushed the intel-rapl-gpu-power branch from dcb3704 to 4271997 Compare June 24, 2026 03:27
@JohnnySun JohnnySun marked this pull request as draft June 24, 2026 03:33
Use i915 system0 and xe gtt fdinfo memory when Intel integrated GPUs do not expose local or VRAM memory keys, so SteamOS mangoapp presets can display current-process shared GPU memory in the vram row.

Treat missing fdinfo hwmon metrics as unavailable instead of rendering zero-valued temperature, power, fan, voltage, or memory clock readings.
@JohnnySun JohnnySun changed the title feat(gpu_fdinfo): read Intel iGPU power from RAPL feat(gpu_fdinfo): support Intel integrated GPU metrics Jun 24, 2026
@JohnnySun JohnnySun marked this pull request as ready for review June 24, 2026 16:24
When MANGOAPP_FRAME_FEED=1, export a rolling 2s frame summary (avg fps,
p95 frame ms, spike count/worst) as atomic JSON at ~2Hz to
$XDG_RUNTIME_DIR/steamos-intel-handheld/frame-feed.json (path override:
MANGOAPP_FRAME_FEED_FILE) for the steamos-intel-handheld game power
governor. Hooked on the gamescope msg frame path outside the overlay
display guard, so the feed flows with the overlay hidden. Zero overhead
when the env var is unset; I/O errors disable the feed for the session.
Validated live on the MSI Claw 8 AI+ (2Hz cadence, sane values, daemon
consumed it as a high-confidence frame source).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AJSepardSVWMwEuwBi9WTZ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant