Let the hardware checks select a GPU by name on multi-GPU PCs #116

Manually merged
github merged 2 commits from gh-pr/116/head into gh-pr/116/base 2026-11-26 21:28:02 +00:00
Owner

@⁠danielradosa on GitHub · 2026-11-21 16:27 UTC · original
danielradosa:gpu-adapter-select → main · +12 −2 · 4 files · 2 commits · merged 2026-11-22 03:03 UTC

Change

offscreen_check always used the first D3D12 hardware adapter in high-performance order. On a PC with both a discrete and an integrated GPU, only the discrete one could be tested. Several reporters in #1 use laptops, whose integrated GPU is never exercised.

XBOX2WINDOWS_ADAPTER now selects the first hardware adapter whose description contains the value, ignoring case. When it is unset, selection is unchanged. A value that matches no adapter fails with No D3D12 hardware adapter matches XBOX2WINDOWS_ADAPTER=... instead of exiting with 77, so a typo cannot turn into skipped tests. Adapters that are passed over are named on stderr.

Run-GpuCheck.ps1 -Adapter <part of a name> sets the variable for each test and adds an Adapter filter: line to the report. The README and the package instructions describe both. Refs #1.

Verification

Windows 11 build 26300.9974, MSVC 19.51.36256. This PC has an NVIDIA GeForce RTX 4060 and the integrated AMD Radeon(TM) Graphics of a Ryzen 5 7600 (vendor 1002, device 164e, driver 32.0.21045.29003).

Check Result
adapter_selection_unmatched (new; also works without a GPU) passes; the output names both skipped adapters, then the error
full suite, variable unset 74 passed, 2 skipped (bvh_wave64_*), 0 failed; hardware tests ran on the RTX 4060 as before
XBOX2WINDOWS_ADAPTER=Radeon, all 22 _hardware tests all ran on the Radeon; 20 passed, including bvh_wave64_hardware (native wave width 64, 38 groups, 0 mismatches)
package from tools/package-gpu-check.ps1 (WARP smoke passed), -Adapter Radeon Radeon used, report contains Adapter filter: Radeon
same package, no option RTX 4060 used, report unchanged
same package, -Adapter "no such gpu" all ten cases FAIL with the error
ctest --preset dev --no-tests=error -R '^adapter_selection_unmatched$' -V
$env:XBOX2WINDOWS_ADAPTER = 'Radeon'; ctest --preset dev --no-tests=error -R '_hardware$'

Evidence and follow-up

Two results on the integrated Radeon that this selection made reachable, neither caused by the selection:

  • dxr_update_hardware: record=0 field=3 expected=3f800000 actual=3f7fffff, the same 1-ULP ray distance #112 reports on an RX 6600M. With #112 applied, it passes here too.
  • ffx_provider_loop_hardware (desktop-control path, no package input): RCAS texel=1 field=4 expected=08120000 actual=001ffe01, then RCAS texel readback mismatch. It repeats on every run, and the debug layer reports 0 errors and 0 warnings. I found no earlier AMD result for this test and have not investigated it.

tools/root_device_probe.cpp has its own adapter loop and is not changed.

AI-assisted.

**@⁠danielradosa** on GitHub · 2026-11-21 16:27 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/116) `danielradosa:gpu-adapter-select` → `main` · +12 −2 · 4 files · 2 commits · merged 2026-11-22 03:03 UTC ## Change `offscreen_check` always used the first D3D12 hardware adapter in high-performance order. On a PC with both a discrete and an integrated GPU, only the discrete one could be tested. Several reporters in #1 use laptops, whose integrated GPU is never exercised. `XBOX2WINDOWS_ADAPTER` now selects the first hardware adapter whose description contains the value, ignoring case. When it is unset, selection is unchanged. A value that matches no adapter fails with `No D3D12 hardware adapter matches XBOX2WINDOWS_ADAPTER=...` instead of exiting with 77, so a typo cannot turn into skipped tests. Adapters that are passed over are named on stderr. `Run-GpuCheck.ps1 -Adapter <part of a name>` sets the variable for each test and adds an `Adapter filter:` line to the report. The README and the package instructions describe both. Refs #1. ## Verification Windows 11 build 26300.9974, MSVC 19.51.36256. This PC has an NVIDIA GeForce RTX 4060 and the integrated AMD Radeon(TM) Graphics of a Ryzen 5 7600 (vendor `1002`, device `164e`, driver `32.0.21045.29003`). | Check | Result | |---|---| | `adapter_selection_unmatched` (new; also works without a GPU) | passes; the output names both skipped adapters, then the error | | full suite, variable unset | 74 passed, 2 skipped (`bvh_wave64_*`), 0 failed; hardware tests ran on the RTX 4060 as before | | `XBOX2WINDOWS_ADAPTER=Radeon`, all 22 `_hardware` tests | all ran on the Radeon; 20 passed, including `bvh_wave64_hardware` (native wave width 64, 38 groups, 0 mismatches) | | package from `tools/package-gpu-check.ps1` (WARP smoke passed), `-Adapter Radeon` | Radeon used, report contains `Adapter filter: Radeon` | | same package, no option | RTX 4060 used, report unchanged | | same package, `-Adapter "no such gpu"` | all ten cases FAIL with the error | ```powershell ctest --preset dev --no-tests=error -R '^adapter_selection_unmatched$' -V $env:XBOX2WINDOWS_ADAPTER = 'Radeon'; ctest --preset dev --no-tests=error -R '_hardware$' ``` ## Evidence and follow-up Two results on the integrated Radeon that this selection made reachable, neither caused by the selection: - `dxr_update_hardware`: `record=0 field=3 expected=3f800000 actual=3f7fffff`, the same 1-ULP ray distance #112 reports on an RX 6600M. With #112 applied, it passes here too. - `ffx_provider_loop_hardware` (desktop-control path, no package input): `RCAS texel=1 field=4 expected=08120000 actual=001ffe01`, then `RCAS texel readback mismatch`. It repeats on every run, and the debug layer reports 0 errors and 0 warnings. I found no earlier AMD result for this test and have not investigated it. `tools/root_device_probe.cpp` has its own adapter loop and is not changed. _AI-assisted._
offscreen_check always used the first D3D12 hardware adapter in
high-performance order, so the integrated GPU of a laptop or desktop with
a discrete card could not be tested. XBOX2WINDOWS_ADAPTER now selects the
first hardware adapter whose description contains the value, ignoring
case; unset, the selection is unchanged. A value that matches no adapter
is an error, so a typo cannot turn into skipped tests.

Run-GpuCheck.ps1 gains -Adapter, which sets the variable for each test
and records the filter in the report. adapter_selection_unmatched checks
the error path on any machine, including CI without a GPU.

Refs #1
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:28:00 +00:00
github manually merged commit 9a68c7fdf3 into gh-pr/116/base 2026-11-26 21:28:02 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-21 16:27 UTC · original · edited 2026-11-21 16:29 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T16:29:41.257979Z c659916 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-21 16:27 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/116#issuecomment-7065665705) · edited 2026-11-21 16:29 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"c6599162b579809ef100423ed3c296cdfb32a34f","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-21T16:29:41.257979Z">2026-11-21T16:29:41.257979Z</relative-time> | `c659916` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-21 17:18 UTC · original

The adapter-filter behavior looks good. GitHub now reports conflicts with main. Please reconcile the packaged runner with #62's report summary and submit path, then run the ZIP smoke test as well as hardware adapter selection.

**@⁠R0Y00** on GitHub · 2026-11-21 17:18 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/116#issuecomment-7066375490) The adapter-filter behavior looks good. GitHub now reports conflicts with main. Please reconcile the packaged runner with #62's report summary and submit path, then run the ZIP smoke test as well as hardware adapter selection.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-21 17:58 UTC · original

#137 has landed with the adapter-name filter and the single-device selection path. Please reuse that implementation when reconciling this PR and keep the packaged runner's adapter option, report summary and submit flow. The remaining verification is the packaged ZIP smoke test and adapter selection.

**@⁠R0Y00** on GitHub · 2026-11-21 17:58 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/116#issuecomment-7066909778) #137 has landed with the adapter-name filter and the single-device selection path. Please reuse that implementation when reconciling this PR and keep the packaged runner's adapter option, report summary and submit flow. The remaining verification is the packaged ZIP smoke test and adapter selection.
This discussion has been locked. Commenting is limited to contributors.
No description provided.