Skip to content

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

Closed

Description

@zackees

Scan /proc/self/fdinfo/* for drm-driver. Key format checked in #1004 against docs.kernel.org/gpu/drm-usage-stats.html:

  • Dedupe fds by drm-client-id.
  • Use drm-pdev to tie them to the render adapter.
  • Sample the drm-engine-<name> ns counters twice and divide by elapsed time.

This covers Intel i915/xe and AMD where the kernel exposes engine times. Which amdgpu kernel version does is unverified.

Acceptance

  • RED → GREEN: Tier 1 parsers on fixture fdinfo texts from i915, xe and amdgpu, including two fds sharing one client id.

Decisions (defaults from #1004; edit if the maintainer disagrees)

Activity

  1. zackees commented on Oct 16, 2026

    @zackees
    MemberAuthor

    Carried over from #1004: measure and record this source's polling cost per sample on real hardware, as #1004 did for NVML (0.68 ms per device vs 87 ms for an nvidia-smi spawn).

  2. zackees commented on Oct 17, 2026

    @zackees
    MemberAuthor

    Claiming (Tier 1 parsers). Plan: obs_gpu_status::fdinfo: parse_fdinfo(text) -> Option<FdinfoClient> (driver, drm-pdev, drm-client-id, engines), read_fdinfo(dir) over /proc/self/fdinfo, and fdinfo_utilization(before, after, pdev, elapsed_ns) -> Utilization deduping by client id and filtering by drm-pdev. Engines: drm-engine-<e>: N ns (i915, amdgpu) divided by elapsed × drm-engine-capacity-<e>, and xe's drm-cycles-<e> / drm-total-cycles-<e>; the headline is the busiest engine. Fixtures follow docs.kernel.org/gpu/drm-usage-stats.html. The polling-cost measurement can't be done here (this host has NVIDIA proprietary only, no engine keys in fdinfo); I'll leave that box open for someone with i915/xe/amdgpu.

  3. added
    claimed
    on Oct 17, 2026
  4. added 3 commits that reference this issue on Oct 17, 2026
    d95cfe5
    f843ab0
    bff8a86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions