GPU: select host DXGI adapter via VICTORY_ADAPTER and log GPU #2367
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2367
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2367"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@PanS4ge on GitHub · 2026-11-25 11:59 UTC · original
PanS4ge:gpu-adapter-selection→main· +160 −1 · 2 files · 1 commits · openRelates to #1736 (reported difficulty choosing between iGPU and dGPU on dual-GPU laptops).
Verification
epository_passes_policy).
@welisonzika14-jpg on GitHub · 2026-11-25 12:25 UTC · original
First run on NVIDIA hardware here, as far as I can see. RTX 5070 (Blackwell, driver 621.24), Ryzen 7 5700X, Windows 11, Rust 1.98.1 MSVC, no game files. Head
d8e3d9fmerged ontomain940d32f,cargo test -p victory-gpu -p victory-shader --lib --no-fail-fast.The PR's new test(s) pass on this card:
host::tests::adapter_spec_parses_presets_indices_and_names,host::tests::adapter_name_trims_trailing_nulls. The rest is the same asmainon this card: the 5 known NVIDIA failures from #1744 (2 view heap cap tests invictory-gpu, 3 invictory-shader), nothing new.One run, unit tests only, title not run.
Written with AI help (Claude/Kiro); the numbers are from runs on my machine.
@KainanP on GitHub · 2026-11-25 12:43 UTC · original
Tested head
d8e3d9f(identical to a merge ontomain940d32f) on a dual-GPU laptop. DXGI adapter 0 is an RTX 4060 Laptop (driver 610.47 / 32.0.16.1047), 1 is Intel UHD 8086:a78b (31.0.101.5445), 2 is Microsoft Basic Render Driver. Windows 11 26200, Rust 1.98.1 MSVC, no game data.cargo testinstalls no tracing subscriber, so the newhost GPUline is not printed there. To see it, I temporarily added a local test (not pushed) that sets a print-everything subscriber and callshost(). It also checks the device'sGetAdapterLuidagainstEnumAdapters1. Both always agreed.VICTORY_ADAPTER0/DGPU/nvidiahost GPU name=NVIDIA GeForce RTX 4060 Laptop GPU vendor=0x10de dedicated_mib=7956igpu/1/Intel/intel(r) uhdhost GPU name=Intel(R) UHD Graphics vendor=0x8086 dedicated_mib=1282host GPU name=Microsoft Basic Render Driver vendor=0x1414 dedicated_mib=07WARN VICTORY_ADAPTER index matched no GPU; using default index=7, then RTX 4060Radeon/Microsoft BasicWARN VICTORY_ADAPTER matched no GPU; using default, then RTX 4060VICTORY_D3D12_WARP=1(±VICTORY_ADAPTER=Intel)host device on the software adapter (WARP),host GPU name=Microsoft Basic Render Drivercargo test -p victory-gpu --lib --locked --no-fail-fast(probe skipped):dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_views).Intel,igpu,1: 142 / 3 / 2 each. That matchesmain940d32fon this iGPU (140 / 3, from an earlier local hook) plus this PR's 2 tests. The third failure isa_texture_written_in_one_format_reads_in_another_through_a_placed_view.Radeon(no match): 143 / 2 / 2, i.e. back on NVIDIA.The switch works. All four spellings reach the iGPU, matching is case-insensitive, and the log line names the adapter actually used. Notes:
host GPUline make that visible. Undercargo testit is invisible: a typo gives NVIDIA results and nothing says so.None, which reachesD3D12CreateDevice(None, …), i.e. DXGI adapter 0. Unset uses the high-performance preference. On laptops where adapter 0 is the iGPU, a typo would land on the iGPU while the README saysdgpuis the default. Both are the RTX here, so this is from reading the code. Falling back toby_pref(HIGH_PERFORMANCE)would make them agree.=2puts the title's host on WARP in a non-diagnosticsbuild, whichVICTORY_D3D12_WARPotherwise gates behind that feature. WithVICTORY_D3D12_WARP=1, WARP wins andVICTORY_ADAPTERis silently ignored. That is fine, but worth a word in the README.Relation to #1889. No conflict:
git merge-treeis clean for each PR ontomainand for the two together. They are complementary, not duplicates: #1889 picks the adapter forvictory-shader's testHost::new, this PR picks it forvictory-gpu's title host. But both readVICTORY_ADAPTERwith different grammars. #1889 accepts only an index, and any other value is an error there, including for WARP. With both merged,VICTORY_ADAPTER=igpu(as documented here) makescargo test -p victory-shaderfail 75 tests (measured on #1889's head with=Intel). Indices mean the same in both (EnumAdapters1order). Sharing one parser would fix it, sincevictory-gpualready depends onvictory-shaderwithhost; otherwise, one PR could adopt the other's spellings.AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.
@Marvisak on GitHub · 2026-11-25 14:50 UTC · original · edited 2026-11-25 16:01 UTC
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts inREADME.md,crates/victory-gpu/src/host.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (needs-work) was for an older state ofmain.Generated by Claude Code
d8e3d9f1betoe405bb2697@catminou4 on GitHub · 2026-11-25 12:36 UTC · original · reviewed
VICTORY_ADAPTER selects host GPU (dgpu/igpu/index/name substring). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Cluster warning: this is the third adapter-selection PR — #2371 (high-performance FL12 preference) and the conflicted #1889 overlap the same host.rs create() device selection lines. #2367 and #2371 both rewrite the same D3D12CreateDevice call path; whichever merges second conflicts. Suggest converging on one (this one is the most configurable).
@PanS4ge on GitHub · 2026-11-26 11:21 UTC · original
Rebased onto current main (
63bcca4) to resolve conflicts in README.md and crates/victory-gpu/src/host.rs, and addressed review feedback from @KainanP and @catminou4:Verification on
e405bb2View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.