gpu: prefer high-performance DXGI adapter on multi-GPU systems #245
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/245"
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 DexNom/VIctory. Originally posted by rudy-07 on 2026-11-30T16:55:24Z.
On dual-GPU laptops (tested on AMD Radeon Graphics iGPU + AMD Radeon RX 5600M dGPU),
D3D12CreateDevice(None, ...)picks the integrated GPU by default. Because the iGPU lacks SM 6.6 dynamic resource support,victory-shaderhardware tests skipped anddepth_bounds_pipeline_loads_and_filters_drawsfailed atCreateRootSignaturewithE_INVALIDARG (0x80070057).Changes:
crates/victory-gpu/src/host.rs: enumerate hardware adapters withIDXGIFactory6::EnumAdapterByGpuPreference(DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE)(skipping software adapters, falling back toNone), and extractHost::shader_model_6_6()reused byHost::mesh_shaders().crates/victory-shader/src/emit/host.rs: apply the same high-performance adapter preference inHost::new(false).crates/victory-gpu/src/pipeline/host.rs: make direct-heap root signature flags conditional inroot_signature(...)and passfalseindepth_bounds_pipeline_loads_and_filters_draws, which does not use dynamic heap indexing.Tested on Windows 11 x64, AMD Radeon RX 5600M (driver 32.0.21043.19003):
cargo clippy --workspace --all-targets --locked -- -D warnings: passcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passvictory-gpu: 219 passed, 0 failed, 4 ignoredvictory-shader: 115 passed, 0 failedxtask: 4 passed, 0 failedImported from DexNom/VIctory. Originally posted by Zippp69 on 2026-11-30T17:38:35Z.
Check SM 6.6 before ending adapter enumeration. On
9df1f9c, the shader test host stops at the first adapter that creates a feature-level 12.0 device. The SM 6.6 check runs after selection, soHost::new(false)can fail and hardware shader tests can skip even when a later adapter supports SM 6.6. Shader test hostI moved the existing shader-model query into
require_shader_model_6_6(&ID3D12Device)and reused it for WARP and the default fallback. In the preferred hardware loop, after checking the adapter description and excluding software, the local patch selects a candidate only when both checks pass:The
emit::valu_tests::filter on Windows reported 22 passed, 0 failed, and 1 ignored. One passing test logged that its WARP pipeline was skipped. I did not verify the specific adapter ordering on a multi-GPU machine.Imported from DexNom/VIctory. Originally posted by rudy-07 on 2026-11-30T17:54:41Z.
Good catch, updated the branch:
crates/victory-shader/src/emit/host.rs: extractedrequire_shader_model_6_6and reused it inside the high-performance adapter loop (so it keeps iterating if an earlier adapter lacks SM 6.6) as well as WARP and the default fallback.crates/victory-gpu/src/host.rs: extracteddevice_supports_sm66(reused byHost::shader_model_6_6) and updatedcreate_high_performance_deviceto prefer an SM 6.6 hardware adapter while falling back to the first hardware adapter if none supports SM 6.6.Re-verified
victory-gpu(219 passed, 4 ignored),clippy(default &--all-features), andcargo xtask policy --staged.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.