Skip to content

obs-gpu-status: per-process GPU utilization from DRM fdinfo - #1224

Merged
zackees merged 2 commits into
masterfrom
feat/1023-drm-fdinfo
Oct 17, 2026
Merged

zackees merged 2 commits into
masterfrom
feat/1023-drm-fdinfo

Conversation

@zackees

@zackees zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

Fixes #1023. Stacked on #1222 (uses its Utilization); retarget to master once #1222 merges.

obs_gpu_status::fdinfo:

  • parse_fdinfo(text): drm-driver, drm-pdev, drm-client-id, engines from drm-engine-<e>: N ns + drm-engine-capacity-<e> (i915, amdgpu) and xe's drm-cycles-<e> / drm-total-cycles-<e>. Non-DRM or id-less fdinfo is None.

  • read_fdinfo(dir): every DRM client in /proc/self/fdinfo (or a fixture dir).

  • fdinfo_utilization(before, after, pdev, elapsed_ns): fds deduped by client id, filtered by drm-pdev, per-engine busy delta summed over clients against elapsed × capacity (or total cycles), busiest engine reported, capped at 100.

  • RED (32c84ef): 11 Tier 1 tests on i915/xe/amdgpu fixture texts (per docs.kernel.org/gpu/drm-usage-stats.html), incl. two fds sharing a client id; 10 failed against stubs.

  • GREEN (d95cfe5): soldr cargo test -p obs-gpu-status 80 passed; ./lint ok.

Not done: the polling-cost measurement on real i915/xe/amdgpu hardware (this host is NVIDIA proprietary only, no engine keys). New code, no C original: Tiers 2/3 n/a.

parse_fdinfo reads drm-driver, drm-pdev, drm-client-id and the engine
counters (drm-engine-<e> ns with drm-engine-capacity-<e>, xe's drm-cycles
and drm-total-cycles). fdinfo_utilization dedupes fds by client id, keeps
the render adapter's drm-pdev and reports the busiest engine.

Fixes #1023
@zackees
zackees force-pushed the feat/1023-drm-fdinfo branch from d95cfe5 to bff8a86 Compare October 17, 2026 11:25
@zackees
zackees changed the base branch from feat/1024-amdgpu-busy-percent to master October 17, 2026 11:25
@zackees
zackees enabled auto-merge October 17, 2026 11:25
@zackees
zackees added this pull request to the merge queue Oct 17, 2026
Merged via the queue into master with commit 44bf3ce Oct 17, 2026
29 checks passed
@zackees
zackees deleted the feat/1023-drm-fdinfo branch October 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

obs-gpu-status: Linux per-process GPU utilization from DRM fdinfo

1 participant