Share GPU selection between runtime and shader validation #7

Manually merged
github merged 1 commit from github-bot/gh-7 into main 2026-11-26 08:21:45 +00:00 AGit
Owner

@⁠gomeaw on GitHub · 2026-11-25 23:08 UTC · original
gomeaw:fix/prefer-d3d12-adapter → main · +175 −33 · 5 files · 1 commits · merged 2026-11-26 08:17 UTC

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.

**@⁠gomeaw** on GitHub · 2026-11-25 23:08 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/7) `gomeaw:fix/prefer-d3d12-adapter` → `main` · +175 −33 · 5 files · 1 commits · merged 2026-11-26 08:17 UTC ## 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.
Adapt the selector and high-performance preference from fxceless/victory-fork#261. Prefer Shader Model 6.6 in the shared path and seed offline translation from the selected adapter.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:31:14 +00:00
Author
Owner

@⁠Marcosmarb on GitHub · 2026-11-25 23:53 UTC · original

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.

**@⁠Marcosmarb** on GitHub · 2026-11-25 23:53 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/7#issuecomment-7178176458) 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.
Author
Owner

@⁠avatarmanz on GitHub · 2026-11-26 07:56 UTC · original

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

**@⁠avatarmanz** on GitHub · 2026-11-26 07:56 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/7#issuecomment-7186002087) Merged into main in the next push (tests pass); thanks.
github manually merged commit f3f6bb62af into main 2026-11-26 08:21:45 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.