Skip to content

[Feature]: Intel Xe/Arc GPU support via hwmon energy counters when PMU unavailable #2012

@venku122

Description

@venku122

Description

Beszel's Intel GPU support relies on intel_gpu_top, which requires the kernel PMU event source (/sys/bus/event_source/devices/i915/ or xe/). Many platforms (e.g., TrueNAS SCALE, Proxmox, custom kernels) don't have Intel GPU PMU compiled in at all — not a perf_event_paranoid or CAP_PERFMON issue.

However, the kernel's xe driver still exposes power data via hwmon sysfs energy1_input — an accumulated energy counter in microjoules — which works without any PMU support. The amd_sysfs collector already demonstrates this pattern for AMD GPUs.

Propose adding an intel_sysfs collector that:

  1. Detects Intel Xe GPUs by checking /sys/class/drm/card*/device/hwmon/hwmon*/name for "xe", or matching PCI vendor 0x8086
  2. Reads energy1_input at each polling interval
  3. Calculates instantaneous watts via delta_energy / delta_time (tracking last sample + timestamp)
  4. Reports PowerGPU (and optionally PowerPkg from the other energy counter)
  5. Auto-falls back when intel_gpu_top fails, so existing PMU users are unaffected

Sysfs paths available on Xe GPUs:

/sys/class/drm/card*/device/hwmon/hwmon*/
├── energy1_input        # accumulated microjoules (incrementing)
├── name                 # "xe"
├── power1_label         # "pkg-pwr-src"
├── power1_max           # power limit in microwatts
├── power1_rated_max     # rated max in microwatts

Tested on: Intel Arc B570 (Battlemage) on TrueNAS SCALE 24.10 — intel_gpu_top fails due to missing kernel PMU, but energy1_input increments and all hwmon paths are readable.

Motivation / Use Case

TrueNAS SCALE and Proxmox users with Intel Arc GPUs (A-series, B570/B580) can't get any GPU power stats from Beszel despite the GPU being fully functional for transcoding/compute. Adding a sysfs fallback collector would unlock GPU power monitoring for this significant user base without requiring kernel changes. The hwmon data is already there and requires zero privileges to read.

Related Issues

Relates to #1150 (Intel iGPU support — permissions focused) and #1834 (Intel Quick Sync usage not shown). This proposal is distinct in that it addresses systems where Intel GPU PMU is entirely absent from the kernel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions