GPU: select host DXGI adapter via VICTORY_ADAPTER and log GPU #2365
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by PanS4ge on 2026-11-25T11:59:40Z.
Relates to #1736 (reported difficulty choosing between iGPU and dGPU on dual-GPU laptops).
Verification
epository_passes_policy).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T12:36:00Z.
Review: COMMENTED
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).
Imported from Marvisak/VIctory. Originally posted by welisonzika14-jpg on 2026-11-25T12:25:03Z.
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.
Imported from Marvisak/VIctory. Originally posted by KainanP on 2026-11-25T12:43:42Z.
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.
upstream-sync referenced this pull request2026-11-25 13:02:56 +00:00
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T14:50:55Z.
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
Imported from Marvisak/VIctory. Originally posted by PanS4ge on 2026-11-26T11:21:39Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.