Share GPU selection between runtime and shader validation #7

Merged
gomeaw merged 1 commit from upstream-pr/7 into main 2026-11-26 08:17:50 +00:00
gomeaw commented 2026-11-25 23:08:19 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by gomeaw on 2026-11-25T23:08:19Z.


Summary

A hybrid laptop can give D3D12's default adapter to the Intel GPU even when the NVIDIA GPU can run the title. This adapts the high-performance preference and override from fxceless/victory-fork#261.

  • The runtime and offline pipeline checker share adapter selection. Both prefer a high-performance hardware adapter with Shader Model 6.6. The existing software adapter switches still take precedence.
  • VICTORY_D3D12_ADAPTER can pick a hardware adapter by DXGI index or name. The runtime logs the actual adapter, PCI IDs and VRAM.
  • translate --pipelines uses the selected adapter's wave size and AMD RDNA setting for translation, unless the caller gives explicit translation overrides. That keeps the check from asking a 32-lane card to compile the default wave64 output for programs for which a Wave32 lowering is available.

Verification

Windows x64 built the application and passed the selector test. The CLI rejected an unknown explicit adapter and reported Microsoft Basic Render Driver when the WARP override was set. The asset policy passed. Windows validation

The original PR reports adapter selection and title boot on an Intel/NVIDIA hybrid laptop. A physical hybrid GPU check on this port is pending.

AI-assisted with Codex.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6615611278 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/7). Originally posted by [gomeaw](https://github.com/gomeaw) on 2026-11-25T23:08:19Z. --- ## Summary A hybrid laptop can give D3D12's default adapter to the Intel GPU even when the NVIDIA GPU can run the title. This adapts the high-performance preference and override from [fxceless/victory-fork#261](https://github.com/fxceless/victory-fork/pull/261). - The runtime and offline pipeline checker share adapter selection. Both prefer a high-performance hardware adapter with Shader Model 6.6. The existing software adapter switches still take precedence. - `VICTORY_D3D12_ADAPTER` can pick a hardware adapter by DXGI index or name. The runtime logs the actual adapter, PCI IDs and VRAM. - `translate --pipelines` uses the selected adapter's wave size and AMD RDNA setting for translation, unless the caller gives explicit translation overrides. That keeps the check from asking a 32-lane card to compile the default wave64 output for programs for which a Wave32 lowering is available. ## Verification Windows x64 built the application and passed the selector test. The CLI rejected an unknown explicit adapter and reported Microsoft Basic Render Driver when the WARP override was set. The asset policy passed. [Windows validation](https://github.com/gomeaw/VIctory-7900XTX/actions/runs/45718326375) The original PR reports adapter selection and title boot on an Intel/NVIDIA hybrid laptop. A physical hybrid GPU check on this port is pending. AI-assisted with Codex.
Marcosmarb commented 2026-11-25 23:53:37 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by Marcosmarb on 2026-11-25T23:53:37Z.


Tested this port on a physical hybrid-graphics laptop.

Machine: Windows 11 Home (26200), AMD Ryzen 7 6800HS, 16 GB RAM, Rust 1.98.1 (MSVC). DXGI lists:

DXGI Adapter Waves SM Mesh tier
0 NVIDIA GeForce RTX 3050 Laptop GPU, 4 GB (driver 32.0.16.2101) 32–32 6.8 1
1 AMD Radeon(TM) Graphics (680M integrated, 483 MB) 32–64 6.8 not supported
2 Microsoft Basic Render Driver 4–4 6.8 1

DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE puts the NVIDIA first.

Branch: 0a4253f (this PR). victory translate --pipelines <empty folder>, with each value of VICTORY_D3D12_ADAPTER:

VICTORY_D3D12_ADAPTER Result
unset pipeline adapter: NVIDIA GeForce RTX 3050 Laptop GPU
0 NVIDIA
1 AMD Radeon(TM) Graphics
radeon AMD Radeon(TM) Graphics
NVIDIA NVIDIA
basic Error: VICTORY_D3D12_ADAPTER=basic matched no hardware adapter (the software adapter is refused, as intended)
nope Error: VICTORY_D3D12_ADAPTER=nope matched no hardware adapter

Tests on this branch: an_explicit_adapter_matches_an_index_or_name ok; victory-gpu lib 326 passed, 0 failed, 34 ignored; victory bin 10 passed.

Caveat: on this laptop the NVIDIA is already DXGI adapter 0, so the case this PR is mainly for (Windows handing the default device to the integrated GPU) does not occur here by default. I did not reproduce it by forcing a power-saving GPU preference for the executable. Also not tested: anything in-game.

Side note for the integrated Radeon: it reports no mesh shader support, so preferring the discrete card (or failing clearly) matters on machines like this one.

Tested with the help of Claude Code.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7178176458 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/7#issuecomment-7178176458). Originally posted by [Marcosmarb](https://github.com/Marcosmarb) on 2026-11-25T23:53:37Z. --- Tested this port on a physical hybrid-graphics laptop. **Machine:** Windows 11 Home (26200), AMD Ryzen 7 6800HS, 16 GB RAM, Rust 1.98.1 (MSVC). DXGI lists: | DXGI | Adapter | Waves | SM | Mesh tier | |---|---|---|---|---| | 0 | NVIDIA GeForce RTX 3050 Laptop GPU, 4 GB (driver 32.0.16.2101) | 32–32 | 6.8 | 1 | | 1 | AMD Radeon(TM) Graphics (680M integrated, 483 MB) | 32–64 | 6.8 | not supported | | 2 | Microsoft Basic Render Driver | 4–4 | 6.8 | 1 | `DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE` puts the NVIDIA first. **Branch:** `0a4253f` (this PR). `victory translate --pipelines <empty folder>`, with each value of `VICTORY_D3D12_ADAPTER`: | `VICTORY_D3D12_ADAPTER` | Result | |---|---| | unset | `pipeline adapter: NVIDIA GeForce RTX 3050 Laptop GPU` | | `0` | NVIDIA | | `1` | `AMD Radeon(TM) Graphics` | | `radeon` | `AMD Radeon(TM) Graphics` | | `NVIDIA` | NVIDIA | | `basic` | `Error: VICTORY_D3D12_ADAPTER=basic matched no hardware adapter` (the software adapter is refused, as intended) | | `nope` | `Error: VICTORY_D3D12_ADAPTER=nope matched no hardware adapter` | Tests on this branch: `an_explicit_adapter_matches_an_index_or_name` ok; `victory-gpu` lib `326 passed, 0 failed, 34 ignored`; `victory` bin `10 passed`. **Caveat:** on this laptop the NVIDIA is already DXGI adapter 0, so the case this PR is mainly for (Windows handing the default device to the integrated GPU) does not occur here by default. I did not reproduce it by forcing a power-saving GPU preference for the executable. Also not tested: anything in-game. Side note for the integrated Radeon: it reports no mesh shader support, so preferring the discrete card (or failing clearly) matters on machines like this one. Tested with the help of Claude Code.
avatarmanz commented 2026-11-26 07:56:24 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by avatarmanz on 2026-11-26T07:56:24Z.


Merged into main in the next push (tests pass); thanks.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7186002087 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/7#issuecomment-7186002087). Originally posted by [avatarmanz](https://github.com/avatarmanz) on 2026-11-26T07:56:24Z. --- Merged into main in the next push (tests pass); thanks.
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
avatarmanz/VIctory-7900XTX!7
No description provided.