GPU: prefer high-performance adapter and add VICTORY_D3D12_ADAPTER #261
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!261
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-261"
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?
@xADEL on GitHub · 2026-11-24 23:02 UTC · original
xADEL:gpu/adapter-selection→main· +303 −34 · 3 files · 1 commits · openProblem
Both
crates/victory-gpu/src/host.rsandcrates/victory-shader/src/emit/host.rspassNonetoD3D12CreateDevice, which selects DXGI adapter 0. On hybrid-graphics laptops (e.g. Intel UHD Graphics + NVIDIA RTX discrete GPU), adapter 0 is the integrated GPU — which often lacks mesh shaders for the world and differs in wave size/driver behavior — and neither host logs which adapter was chosen or lets the user pick one.Related to #197 (which adds an opt-in
VICTORY_SHADER_ADAPTERoverride forvictory-shadertests only, keeping Windows' default adapter when unset). This PR selects the high-performance hardware adapter by default and adds a singleVICTORY_D3D12_ADAPTERoverride plus adapter logging for both the main runtime (victory-gpu) and the shader test host (victory-shader).What is in it
crates/victory-gpu/src/host.rs:IDXGIFactory6::EnumAdapterByGpuPreference(..., DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE)(skipping software adapters), falling back toD3D12CreateDevice(None, ...).VICTORY_D3D12_ADAPTER(0-based DXGI index or case-insensitive adapter description substring).vram_mb).adapter_selector_matches_index_or_substring.crates/victory-shader/src/emit/host.rs:VICTORY_D3D12_ADAPTERoverride, keeping the SM 6.6 check and the software-adapter rejection needed on GPU-less CI runners (7b0f736).adapter_selector_matches_index_or_substring.README.md: DocumentVICTORY_D3D12_ADAPTERin the environment variable table.Tested
32.0.16.2124, wave32, SM 6.6, mesh shaders) + Intel(R) UHD Graphics (driver32.0.101.7026, no mesh shaders), Windows SDK10.0.26100.0(dxil.dllactive).cargo xtask policy->169 files okcargo clippy --workspace --all-targets --locked -- -D warnings-> 0 warningscargo clippy --workspace --all-targets --all-features --locked -- -D warnings-> 0 warningscargo test --workspace --locked-> 498 passed, 0 failed, 7 ignored (automatically selected RTX 3050 6GB, includinga_mesh_pipeline_loads_from_the_libraryand all hardware shader tests; verifiedVICTORY_D3D12_ADAPTER=intelselects Intel UHD Graphics andVICTORY_D3D12_ADAPTER=nvidiaselects RTX 3050).target\release\victory.exe run ... --execute): loggedhost D3D12 adapter adapter=NVIDIA GeForce RTX 3050 6GB Laptop GPU vendor=0x10de device=0x25ec vram_mb=6001and booted menus at 30.0 fps.Not tested
AI use
Written and verified with Antigravity (model name not exposed in the agent environment).
test result: FAILED. 204 passed; 6 failed; 2 ignored; 0 measured; 0 filtered out; finished in 6.90s#356View 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.