GPU: prefer high-performance DXGI adapter supporting FL 12.0 (fixes #1226) #2371
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!2371
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@antikohza on GitHub · 2026-11-25 12:07 UTC · original
antikohza:feat/dxgi-high-perf-adapter→main· +81 −1 · 1 files · 1 commits · openSplit 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.
@Marvisak on GitHub · 2026-11-25 14:51 UTC · original · edited 2026-11-26 03:21 UTC
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
@futurepro62 on GitHub · 2026-11-25 23:15 UTC · original
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
@Xvania7 on GitHub · 2026-11-25 12:34 UTC · original · approved these changes
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.
@catminou4 on GitHub · 2026-11-25 12:36 UTC · original · reviewed
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.
@fuzeofficlal on GitHub · 2026-11-26 15:22 UTC · original · approved these changes
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.