Repository navigation
Intel sysman backend: fdinfo and hwmon fallbacks for xe telemetry gaps - #69
Merged
benapetr merged 2 commits intoSep 10, 2026
Merged
Conversation
Review of 3ed30c1 (fdinfo/hwmon fallbacks for xe telemetry gaps) surfaced several correctness bugs in the DRM fdinfo engine-activity fallback used when sysman can't enumerate engine groups (non-root on xe): - Render node, fd cache, and rescan counter were single per-backend fields shared across every GPU, so on multi-GPU systems the second device would scan the first device's render node and never match its own pdev, permanently reporting 0% utilization. State is now keyed per PCI BDF (FdInfoGpuState). - Duplicate fds referencing the same DRM client (fork()/dup(), common for compositors) were summed without dedup, double-counting busy time. drm-client-id is now parsed and deduped per scan, matching the sibling GpuDrmBackend's seenClients approach. - Only the render node was matched; card/control-node clients (direct KMS/GEM access) were invisible. Both nodes are now matched. - drm-engine-capacity-* was parsed and discarded, so multi-instance engine classes (e.g. xe vcs=2, ccs=4) were never normalized by instance count, over/under-reporting utilization. - New clients discovered mid-run had their whole lifetime counter folded into the aggregate delta, producing a spurious 100% spike. Accounting moved to a per-client baseline (busy/cycles per clientKey/engineKey) so a client only contributes from its second observed sample onward. Follow-up fixes to the above (caught by a second review pass): - Capacity key parsing had an off-by-one (drm-engine-capacity- is 20 chars, code read from offset 21), so capacity was stored under the wrong key and normalization silently never applied. All four fdinfo prefix offsets now derive from the QLatin1String literal's own length instead of a hardcoded number. - A per-client counter that dipped (glitch, not a real reset) had its baseline overwritten with the lower reading; a later partial recovery would then be miscounted as fresh activity. The baseline now retains the previous high-water mark until the counter catches back up. - xe's shared GT reference-clock baseline was only updated for engine keys that already had a client delta, so the first sample where a new engine class got its first delta compared against a zeroed baseline instead of the previous sample's reading, producing one extra bogus near-zero sample. Class metadata is now captured for every key seen this scan, including ones without a client baseline yet. Verified: single-file and full qmake build both compile clean (0 errors, 0 warnings) against Qt 6.9.0; not yet exercised against real xe/i915 hardware.
Owner
|
yeah we can all use AI :D I used my AI to fix bugs your AI made. Now can you test it on your Intel card? I don't have any for that. |
Contributor
Author
|
can confirm everything works for me. also note that intel drivers show Shared memory stats as 0 / 0, for some reason they dont have such feature at all meaning on linux any allocation beyond vram capacity throws OOM, while on windows it spills into ram. |
Owner
|
yeah, we should probably make it possible to hide that graph so it's not taking space |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On the xe driver the Level Zero sysman backend only delivers VRAM, power and core clock for regular users:
zesDeviceEnumEngineGroupsrequires root (compute-runtime gates it behindgeteuid() == 0, returningZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS), so GPU utilization stays 0Changes (Intel Sysman backend only):
drm-cycles-*/drm-total-cycles-*on xe (utilization = delta busy / delta GPU clock), legacydrm-engine-*nanoseconds on i915.drm-engine-capacity-*lines are static metadata and are skipped.tempN_inputunder the PCI device.zes_freq_properties_tmin/max.Sysman remains the source for VRAM, core clock and power, which already work without root. Root behavior is unchanged (sysman engines take precedence).
Footnote: this PR was vibecoded (AI-assisted). Verified on an Intel Arc A770, xe driver, kernel 7.2.2 — utilization, per-engine graphs and temperature confirmed working as a non-root user.