GPU: select high-performance D3D12 adapter and probe host caps #208
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!208
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/208/head"
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?
@wbkepler on GitHub · 2026-11-24 01:25 UTC · original
wbkepler:gpu/high-perf-adapter→main· +642 −45 · 1 files · 1 commits · closed without mergingSummary
D3D12CreateDevice(None, ...)with explicit DXGI adapter selection viaIDXGIFactory6::EnumAdapterByGpuPreference(DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE)(falling back toIDXGIFactory1::EnumAdapters1whenIDXGIFactory6is unavailable).DXGI_ADAPTER_FLAG_SOFTWARE) by default while preservingVICTORY_D3D12_WARPsoftware validation underdiagnostics.VICTORY_D3D12_ADAPTERoverride (0-based hardware adapter index or case-insensitive description substring match). Note: a non-matchingVICTORY_D3D12_ADAPTERvalue returns a hard device-creation error (listing available adapters in the error/log) rather than silently falling back to the default adapter.HostCaps(adapter metadata, Options 0/1/5/7/9/11, downwardSHADER_MODELprobe), logs a concise startup summary, and exposes capability getters onHost(caps,mesh_shaders,supports_wave64,wave_lane_count_max,supports_atomic_int64_typed,resource_binding_tier).Verification
cargo clippy --workspace --all-targets— passedcargo clippy -p victory --features diagnostics --all-targets— passedcargo test --workspace— passed (50 passed, 1 ignored invictory-gpu)cargo xtask policy— passed (151 files ok)@SkippySteve on GitHub · 2026-11-24 01:33 UTC · original
I ran this PR under Proton on Linux. I used only synthetic
victory-gputests: no game files and no title run.Host: Arch Linux (kernel 7.2), single GPU: RTX 2060 SUPER, NVIDIA 615.78.08. Runtime: UMU-Proton 11.0-2e (
files/bin/wine) with a fresh dedicated prefix thatproton runcreated, so the prefix has Proton's vkd3d-proton and DXVK DLLs. I ran withWINEDLLOVERRIDES="d3d12=n;d3d12core=n;dxgi=n;d3d11=n", so DXGI is DXVK's and D3D12 is vkd3d-proton's. Build:cargo xwin test --target x86_64-pc-windows-msvc -p victory-gpu --no-run(Rust 1.98.1), and I ran the test exe underwine --test-threads=1.Test suite
main@d2a4baeeb72359victory-gpu, all testshost::tests(7 new tests)victory-gpu --features diagnosticsThe PR results were the same in 4 runs (3 with one test thread, 1 with parallel threads). The 3 failures are the ones
mainalready has here:argument_clamp_builds,a_rejected_blob_gives_an_empty_libraryandbuffer_data_reaches_the_host_texture. They have nothing to do with this PR. Every test that creates a realHost(and so runs the newcreate_device()) still passes.Adapter selection under vkd3d-proton
The tests don't log the startup summary, so I added a temporary
#[ignore]test locally. It is not pushed. It prints what DXGI enumerates and whatcreate_device()+probe_caps()pick:The probed caps make sense for Turing on vkd3d-proton. The shader model probe steps down past 6.9 and lands on 6.8, which is what vkd3d-proton reports. Wave lanes are 32..32, so
supports_wave64()is false on NVIDIA, as it should be.VICTORY_D3D12_ADAPTERoverride:""0,nvidia,RTX1,amd,zzzcreate_devicefails with0x887A0002(DXGI_ERROR_NOT_FOUND)So the index and the case-insensitive substring match both work. An override that matches nothing is a hard failure, not a fallback to the default adapter. That looks intentional given the
warn!that lists the available adapters. Still, someone with a stale value in their environment will get no device at all, so it may be worth saying so in the PR description or docs.WARP under Proton
DXVK's
EnumWarpAdapterlogsWARP not supported, returning first hardware adapterand returns the RTX (flags0x0).warp_adapter_accepts_only_softwarechecks thatwarp_adapter()refuses it, and it passes.warp_device_creation_and_caps_probereturns early here, so on Proton it passes without testing anything. Its WARP assertions only run on real Windows. In adiagnosticsbuild withVICTORY_D3D12_WARP=1, device creation fails withE_FAIL, which is the same asmain. The software adapter filter in the normal path never comes into play here because DXVK lists no software adapter.Not covered
This machine has only one GPU, so I couldn't check high-performance ordering across iGPU and dGPU, or a hybrid laptop setup. I also didn't do a title run.
@wbkepler on GitHub · 2026-11-24 01:38 UTC · original
Thanks @SkippySteve for testing on Proton/vkd3d-proton! Updated the PR description to clarify that a non-matching `VICTORY_D3D12_ADAPTER` value returns a hard device-creation error (listing available adapters) rather than falling back to the default adapter.
@AgneyaK on GitHub · 2026-11-24 16:37 UTC · original
Test report on
eb72359, merged ontomaind2a4bae(clean merge). Laptop: Intel Iris Xe is DXGIadapter 0, NVIDIA RTX 3050 is adapter 1.
Tested
main:Intel(R) Iris(R) Xe Graphics;NVIDIA GeForce RTX 3050 6GB Laptop GPU.cargo test -p victory-gpu --lib: 50 passed, 0 failed, 1 ignored.Note:
victory-shader's test host (emit/host.rs) still usesD3D12CreateDevice(None), so theshader tests keep running on the iGPU here. #94 changes both hosts.
Not tested: AMD, Wine, a desktop with one GPU, the title.
Details: #1232.
AI use: Claude Code (Claude Opus 5.5) merged and built the trees, ran the title on my machine and drafted this note; results are from the runs described.
@ayanbarosan on GitHub · 2026-11-24 16:53 UTC · original
A second hybrid laptop, adding to the report above. The default choice is the same, and this run also covers the
VICTORY_D3D12_ADAPTERoverride, WARP on real Windows and the startup summaries. I used syntheticvictory-gputests only: no game files and no title run.Host: Windows 11 build 26300, i5-11400H laptop with Intel UHD Graphics (Tiger Lake, driver 31.0.101.5333) and an NVIDIA GeForce RTX 3050 Laptop GPU (driver 610.91). Build:
eb72359cherry-picked ontomainatffe310e(applies cleanly).cargo test -p victory-gpu --locked: 57 passed, 0 failed, 1 ignored (the benchmark). The three tests that fail under Proton pass here.--features diagnostics,host::tests: 11 passed.warp_device_creation_and_caps_probegets a real WARP device here, so its assertions run.cargo clippy -p victory-gpu --all-targets --locked -- -D warnings, also with--all-features: clean.Adapter selection
I checked this with a temporary local test that calls
create_device()andprobe_caps(). It is not pushed. DXGI's own order here is Intel UHD (LUID 0:e012), RTX 3050, a second Intel UHD entry (0:17ac3), then the Microsoft Basic Render Driver (flags 0x2). Somainruns on the Intel. The PR's high-performance list is RTX 3050, UHD 0:e012, UHD 0:17ac3.VICTORY_D3D12_ADAPTERnvidia,RTX 3050,0intel,UHD,123,99,amd,Basic RenderDXGI_ERROR_NOT_FOUND, after the warning that lists the three adapters aboveIn a
diagnosticsbuild,VICTORY_D3D12_WARP=1gets the Basic Render Driver, even withVICTORY_D3D12_ADAPTER=nvidiaset.Startup summaries (
caps.summary()):Notes
RT=unknownon the RTX: the driver reportsRaytracingTier12 (DXR 1.2).raytracing_tier_labelhas no arm for it, and windows 0.62 has no constant for it. Printing an unknown tier's number, such asRT=unknown(12), would keep it in the log.0is the RTX here, while DXGI's adapter 0 is the Intel. The README's variable table doesn't listVICTORY_D3D12_ADAPTERyet, and a row there could say this.DXGI_ADAPTER_FLAG_SOFTWAREhere, so the PR skips it. Where it is the only adapter and carries the flag,create_devicefails withDXGI_ERROR_NOT_FOUNDandhost()isNone, whilemaingets a WARP device. Thevictory-gputests that return early without a host would then pass without testing anything. #439'semit/host.rsnotes that a CI runner can list this adapter without the flag. There the PR keeps it, so nothing changes. A WARP fallback when no hardware adapter is found and no override is set would keepmain's behavior there.No game data used. AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-25 00:00 UTC · original
Automated triage for the maintainers. Closing because another open pull request covers the same change.
See #967. Same goal as #967 (choose a hardware adapter instead of the default) in 642 lines inside host.rs with a block of unused capability accessors.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed