Skip to content

obs-gpu-status: Windows GPU utilization through PDH GPU Engine counters #1022

Closed

Description

@zackees

Use \\GPU Engine(*)\\Utilization Percentage:

  • Add the counter with PdhAddEnglishCounterW, so it works in every Windows language.
  • Filter by the render adapter's LUID.
  • Whole-adapter value = max over engine types, as Task Manager does it (unverified; confirm while implementing).
  • PdhCollectQueryData twice per baseline.

This covers all vendors.

Acceptance

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. Plan: Tier 1 parse_pdh_instance (pid_<n>_luid_0x<hi>_0x<lo>_phys_<n>_eng_<n>_engtype_<type>) and pdh_utilization(samples, luid, pid): filter by the render adapter's LUID (from #1198), sum each engine (phys, eng) over processes, report the busiest engine (Task Manager's whole-adapter value), Unavailable when nothing matches; with pid the same for OBS's own share. Then a Windows sampler in src/platform/windows.rs (raw FFI like the DXGI code: PdhOpenQueryW, PdhAddEnglishCounterW(\\GPU Engine(*)\\Utilization Percentage), two PdhCollectQueryData, PdhGetFormattedCounterArrayW), cross-compiled for Windows. The polling-cost measurement needs a Windows host; I'll leave that open if I can't get one.

  3. added
    claimed
    on Oct 17, 2026
  4. 13 remaining items

  5. removed
    claimed
    on Oct 19, 2026
  6. added
    P2
    size:M
    on Oct 25, 2026
  7. zackees commented on Oct 25, 2026

    @zackees
    MemberAuthor

    /ready

    Triage: a concrete design (PdhAddEnglishCounterW, LUID filter, max over engine types) with RED → GREEN and smoke-test acceptance. The UI decisions are settled by #1004 defaults. The work is already split as the maintainer arranged (backoff follow-up after #1271). P2, size:M.

  8. added
    ready
    on Oct 25, 2026
  9. zackees commented on Oct 25, 2026

    @zackees
    MemberAuthor

    Correction to my triage above: this is done. #1228 (merged 2026-10-17) added Windows GPU utilization through the PDH GPU Engine counters with the parser/aggregator tests, #1264 the GPU: x% display, #1271 the persistent PDH query, and #1287 the backoff for slow sources the maintainer asked for. If the packaged Windows smoke test (#941) shows a problem, please file it as its own bug.

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

    P2readysize:M

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions