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

Merged
danielradosa merged 2 commits from upstream-pr/116 into main 2026-11-22 03:03:51 +00:00
danielradosa commented 2026-11-21 16:27:43 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by danielradosa on 2026-11-21T16:27:43Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6531419043 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/116). Originally posted by [danielradosa](https://github.com/danielradosa) on 2026-11-21T16:27:43Z. --- ## 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._
upstream-sync closed this pull request 2026-11-24 06:41:23 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 06:47:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T16:27:52Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7065665705 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/116#issuecomment-7065665705). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-21T16:27:52Z. --- <!-- 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>
R0Y00 commented 2026-11-24 06:47:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T17:18:23Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7066375490 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/116#issuecomment-7066375490). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T17:18:23Z. --- 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 commented 2026-11-24 06:47:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T17:58:46Z.


#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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7066909778 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/116#issuecomment-7066909778). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T17:58:46Z. --- #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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!115
No description provided.