Skip to content

obs-gpu-status: Detect Windows GPUs through DXGI (#942) - #958

Merged
zackees merged 3 commits into
masterfrom
feat/942-dxgi-gpus
Oct 16, 2026
Merged

zackees merged 3 commits into
masterfrom
feat/942-dxgi-gpus

Conversation

@zackees

@zackees zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member

Fixes #942 (part of #939).

On Windows only nvidia-smi found GPUs. An AMD- or Intel-only machine that fell back to Microsoft Basic Render Driver therefore detected no GPU and showed red, when it should show yellow ("your GPU was detected, but OBS is not using its driver").

Change

  • dxgi::devices_from_dxgi() (pure, tested on every host): keeps hardware adapters from NVIDIA, AMD and Intel, and drops DXGI_ADAPTER_FLAG_SOFTWARE adapters and Microsoft's vendor 0x1414 (Basic Render Driver, Hyper-V video). Trailing NULs and spaces are trimmed from names.
  • platform::windows::dxgi_adapters(): CreateDXGIFactory1 → EnumAdapters1 → GetDesc1, called through the COM vtables. This is about 60 lines, behind the crate's cfg_select! boundary. The workspace only has windows-sys, which has no COM vtables, so no new dependency was added. The results are merged with nvidia-smi.

RED → GREEN

  • RED (Add failing tests for Windows GPU detection through DXGI): 4 tests fail on todo!(), including amd_only_machine_on_basic_render_is_yellow_not_red.
  • GREEN: all obs-gpu-status tests pass. Clippy and the Dylints are clean on the host and for x86_64-pc-windows-msvc.
  • Runs on Windows in this PR's CI: system_probe_does_not_panic calls system_devices(), and so the real DXGI enumeration, in the Rust Tests (windows-2025-vs2026) job.

…XGI (RED)

On Windows only nvidia-smi finds GPUs, so an AMD- or Intel-only machine
on Microsoft Basic Render Driver shows red instead of yellow.

Refs #942
devices_from_dxgi() keeps hardware adapters from known vendors and drops
software and Microsoft adapters (Basic Render Driver, Hyper-V video).
platform::windows enumerates them with CreateDXGIFactory1, EnumAdapters1
and GetDesc1; the results merge with nvidia-smi. An AMD- or Intel-only
machine on Basic Render Driver is now yellow, not red.

Fixes #942
merge_devices only merged into unnamed entries, and DXGI names every
GPU, so on Windows nvidia-smi added each NVIDIA GPU a second time. Match
on vendor and device ID; a match fills in a missing name. Also assert
DXGI_ADAPTER_DESC1's size (312 bytes on 64-bit) at compile time.

Refs #942
@zackees
zackees force-pushed the feat/942-dxgi-gpus branch from 2726f47 to 86e23a3 Compare October 16, 2026 04:12
@zackees

zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

Review fix: merge_devices only merged into unnamed entries, and DXGI names every GPU, so on Windows nvidia-smi would have listed each NVIDIA GPU a second time. A GPU is now matched on vendor and device ID; test nvidia_smi_does_not_duplicate_a_named_dxgi_gpu failed before the fix and passes after. Also added a compile-time check that DXGI_ADAPTER_DESC1 is 312 bytes on 64-bit. Rebased on master, which now has the lint-probe fix (#972).

@zackees
zackees added this pull request to the merge queue Oct 16, 2026
@zackees
zackees removed this pull request from the merge queue due to a manual request Oct 16, 2026
@zackees
zackees merged commit 6963c9d into master Oct 16, 2026
26 checks passed
@zackees
zackees deleted the feat/942-dxgi-gpus 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.

feat: Windows GPU detection through DXGI adapter enumeration

1 participant