Repository navigation
Use the discrete GPU on laptops instead of the integrated one - #22
spy0eye-beep wants to merge 1 commit into
Conversation
The host device and the shader test host were made on the default adapter,
which on a laptop with two GPUs is the integrated one (adapter 0) unless the
user set a per-app preference in Windows. On an RTX 4060 Laptop + Intel UHD
machine the game and every "hardware" test ran on the Intel UHD.
Now the first hardware adapter in DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE order
that makes a D3D12 device is used, and its name is logged ("host device").
Falls back to the default adapter if DXGI cannot order them. Software
adapters (WARP, the Basic Render Driver) are never picked. For the tests,
VICTORY_TEST_ADAPTER=n takes the n-th hardware adapter in that order, so a
suite can be run on each GPU of a machine.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks a lot @spy0eye-beep! Noted. It goes into tonight's RX 9070 XT test queue and I'll report the result here. |
The host device and the shader test host were made on the default adapter, the integrated GPU on a laptop with two. Now the first hardware adapter in DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE order that makes a D3D12 device is used, its name logged; software adapters (WARP, the Basic Render Driver) never. VICTORY_TEST_ADAPTER=n runs the tests on the n-th hardware adapter. Same change as PastiiJay/klbf-lab#22 and Marvisak/VIctory#1483. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
On a Windows runner with no physical GPU, I tested a three-line change on top of this PR that gives the runtime selector the same PCI-ID check. It then returns |
|
Thanks for catching the Basic Render Driver case on GPU-less runners. We'll try it on a laptop before merging. |
What
On a laptop with two GPUs, KLBF Lab made its D3D12 device on the default adapter, which Windows lists as the integrated GPU unless the user sets a per-app preference. So on a hybrid laptop the game, and every "hardware" shader test, run on the integrated GPU.
Found on an RTX 4060 Laptop GPU + Intel UHD Graphics (i7-13620H, Windows 11 24H2): adapter 0 is the Intel UHD, adapter 1 the RTX 4060.
Change
victory-gpuhost: the first hardware adapter inDXGI_GPU_PREFERENCE_HIGH_PERFORMANCEorder that creates a D3D12 device is used, and its name is logged (host device adapter=...). If DXGI cannot order adapters it falls back to the default, as before. Software adapters (WARP, the Basic Render Driver) are never picked.emit/host.rs): the same choice, so GPU tests run on the discrete GPU.VICTORY_TEST_ADAPTER=ntakes the n-th hardware adapter in that order, to run the suite on each GPU of a machine. The adapter name is printed in test output only.high_performance_adapter_is_hardware.Note: this overrides a "power saving" choice made for victory.exe in Windows graphics settings, which is the usual behaviour for games.
Testing
cargo test --workspace --all-featuresonbeta(c71c7d6), RTX 4060 Laptop + Intel UHD, Windows 11 24H2, Rust 1.98.1:betaas publishedVICTORY_TEST_ADAPTER=17 of the 9 failures are Intel UHD driver behaviour (
intersect_tests×4,ds_min_max_f32...,v_permlane16...,whole_wave_f64...). The 2 left (emit::rect::tests::*) fail onbetatoo and are not touched here.Also seen: in one run of
betaas published on the Intel UHD, thevictory-gputest binary exited withSTATUS_ACCESS_VIOLATIONafterwatch::mapping_tests::reads_in_place_and_remappings_wait_for_each_other. It did not happen with this PR, but I did not look into it.cargo check/cargo build --release -p victory: OK.cargo clippy -D warningsreports the same two errors with and without this PR (draw.rssort_unstable_by_key,indirect.rsdepth_written); none are new.The same fix is open upstream as Marvisak/VIctory#1483.
AI-assisted (Claude).
🤖 Generated with Claude Code