SIGN IN SIGN UP

fix(core): sample every Windows GPU adapter a vendor API cannot read (#1992)

* fix(core): sample every Windows GPU adapter a vendor API cannot read

PDH sampling was restricted to adapters whose DXGI name contains
"Intel", and the ADL path emits an adapter only when its usage query
answers. An AMD APU's integrated Radeon therefore never entered the
sample stream, and the GPU switcher lists only adapters that reported -
so the adapter had no name, no readings, and no entry to select.

PDH now covers every DXGI hardware adapter no vendor API answered for,
under the existing reboot-stable pdh:instance:<id> live id. Coverage is
decided per adapter - by PCI address for ADL, by the presence of any
NVAPI sample for NVIDIA, and by reported name as a last resort - so one
physical card can never be offered as two.

Software adapters (WARP / Microsoft Basic Render Driver) are excluded
via DXGI_ADAPTER_FLAG_SOFTWARE: there is no device behind them to
attribute a reading to.

The sampling gap predates v1.10.0, but v1.10.0's live-samples-only
adapter list (ADR 0016) turned it into a visible regression: the
adapter disappeared from the switcher entirely.

Fixes #1988

* fix(core): keep GPU discovery retryable and decide coverage by PCI address alone

Review corrections for #1992:

- A failed DXGI/SetupDi discovery is no longer cached as an empty
  adapter list for the process lifetime. Only success initializes the
  OnceCell; a failure returns empty for that call and the next sample
  retries, logging the first failure only.

- An adapter with a PCI address is decided by that comparison alone.
  Falling through to the name let a same-name sibling the vendor API
  did read claim coverage for the one it could not, hiding it from PDH
  again. The name fallback now applies only when SetupDi supplies no
  PCI address.
S
shm committed
f3350e87902cd8ecae605ffed975e3b672d0755c
Parent: c42e1a1
Committed by GitHub <noreply@github.com> on 8/23/2026, 3:58:32 AM