GPU: prefer high-performance DXGI adapter supporting FL 12.0 (fixes #1226) #2369
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2371"
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 antikohza on 2026-11-25T12:07:40Z.
Split out of #2146 per maintainer triage feedback.
What this changes
D3D12CreateDevice(None, ...)call incrates/victory-gpu/src/host.rswithbest_adapter():IDXGIFactory6::EnumAdapterByGpuPreference(DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE)first so Windows per-app GPU preferences and discrete/eGPU devices take priority on hybrid laptops instead of falling onto an integrated GPU.D3D_FEATURE_LEVEL_12_0support with a null out-pointer (supports_fl12()) before selecting an adapter.DedicatedVideoMemory, then toD3D12CreateDevice(None, ...)if needed.adapter_memory(&device)(LUID-matched via DXGI) to loghost device memoryon startup.Closes #1226.
Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-25T12:34:29Z.
Review: APPROVED
Verified
bbac5c0on Windows 10 + NVIDIA GeForce RTX 5060:best_adapter()andsupports_fl12()viaEnumAdapterByGpuPreference(HIGH_PERFORMANCE)cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warningscargo xtask policy: 182 files okApproving.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T12:36:02Z.
Review: COMMENTED
Prefer high-performance DXGI adapter supporting FL 12.0, falling back to default device. 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. See cluster note on #2367 — these two collide.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T14:51:14Z.
Automated triage for the maintainers.
Re-reviewed after the rebase. The branch now merges cleanly, and the content is the same as the version reviewed earlier.
In
create(crates/victory-gpu/src/host.rs),best_adapter()replacesD3D12CreateDevice(None, ...). It picks the first non-software adapter fromEnumAdapterByGpuPreference(HIGH_PERFORMANCE)that supports FL 12.0, checked with a null-device probe. If that fails, it takes the one with the most dedicated memory. If creating the device on it fails, it falls back to the default adapter. The startup probes (fuses_fmad) usefrom_device, so they follow the chosen adapter.One minor point, not blocking:
adapter_memoryrepeats the LUID lookup thatvideo_memoryalready does withEnumAdapterByLuid. futurepro62's full-suite run on an RTX 5070 Ti passed.Verdict: merge candidate (a recommendation to look, not an approval). CI: passing.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-25T23:15:02Z.
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head
3ffa2d5(on its base67e8ae1).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 773 passed, 0 failed, 9 ignored.#[test]functions in the diff.--skipleaves out tests that fail on main842b0cbon this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T15:22:46Z.
Review: APPROVED
Reviewed
crates/victory-gpu/src/host.rsat4028dc19merged ontoorigin/main(63bcca43) and verified live on a dual-GPU host (Ryzen 9 9950X AMD Radeon iGPU + NVIDIA GeForce RTX 5090 dGPU) as well as WARP (VICTORY_D3D12_WARP=1) withVICTORY_D3D12_DEBUG=1.Adapter selection & fallback audit
create()(host.rs:193) preserves theVICTORY_D3D12_WARPsoftware branch untouched; for hardware creation it callsbest_adapter()(host.rs:426), which queriesIDXGIFactory6::EnumAdapterByGpuPreference(DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE), filters outDXGI_ADAPTER_FLAG_SOFTWARE, and checks FL 12.0 via a null out-pointer (supports_fl12athost.rs:409), falling back to max non-softwareDedicatedVideoMemoryand finallyD3D12CreateDevice(None, ...)if needed.adapter_memory(host.rs:391) could optionally useEnumAdapterByLuidlikevideo_memory; open#3073addresses the same multi-GPU adapter preference (and#2053adds GPU logging/warnings).Verification
cargo run -p xtask -- policy: 191 files ok.cargo clippy -p victory-gpu --all-targets -- -D warnings(default and--all-features): clean.[0] NVIDIA GeForce RTX 5090 (0x10de, 33,750,515,712 B),[1] AMD Radeon(TM) Graphics (0x1002, 2,119,970,816 B), and[2] Microsoft Basic Render Driver (0x1414, flags=0x2):NVIDIA GeForce RTX 5090(sw=false,adapter_memory = 33,750,515,712).VICTORY_D3D12_WARP=1(--features diagnostics) still selectedMicrosoft Basic Render Driver(0x1414:0x008c,sw=true).host::withVICTORY_D3D12_DEBUG=1: 35/35 passed on RTX 5090 (skippingdynamic_slots_are_held_until_released) and 36/36 passed on WARP (--features diagnostics, skipping the pre-existingmaincompositor_failure_presents_primary_in_the_same_frameDebug Layer mismatch).View 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.