GPU: log the host GPU, and warn when it is not the one to run on #2053
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!2053
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2053"
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?
@rminzao on GitHub · 2026-11-25 04:10 UTC · original
rminzao:gpu-log-host-adapter→main· +250 −0 · 3 files · 2 commits · openClaimed in #1633 (claim).
Problem
host::createmakes the device withD3D12CreateDevice(None, …), i.e. DXGI's default adapter. On a laptop with an integrated and a discrete GPU that is usually the integrated one, unless the user set the program to "High performance" in Windows. Nothing in the log says which GPU the run was on, so a report from such a laptop silently describes the iGPU.It matters more on an Intel iGPU: the Intel UHD here runs waves of 16 lanes only (
WaveLaneCountMin/Max16/16, as in #1829). Translated compute programs that depend on lane layout declare the console'sWaveSize(32)/(64)(emitmodule docs), so they get no pipeline there, and the log only shows the refused pipelines.Change
A new
adaptermodule, called once next totdr::log()when the device is made (not on the WARP path):infolinehost GPU: adapter name, vendor id, user-mode driver version, dedicated memory and wave lane range.warnwhen DXGI's high-performance adapter (EnumAdapterByGpuPreference, software adapters ignored) is another GPU than the device's, naming both and where to change it in Windows.warnwhen the device runs waves of at most N < 32 lanes.Logging only. It selects nothing, so it doesn't overlap the adapter selection in #967, #1483 or the selector split out of #1630, and works with whichever lands. With a selector, the first warning simply stops firing.
Tested
Intel UHD Graphics (driver 31.0.101.4146, the default adapter) + RTX 4050 Laptop (595.97), Windows 11.
adapter::tests: the warning rules (other GPU preferred, same GPU, only software preferred, 16 vs 32-64 lanes) and a hardware test on the default device. On this laptop the hardware test prints: With the test's device made on the RTX 4050 instead (local, uncommitted), both lines name the RTX 4050 and nothing is warned.cargo test -p victory-gpu --lib: 143 passed, 3 failed. The 3 fail the same way onmain940d32fhere (the two view-heap cap tests anda_texture_written_in_one_format_reads_in_another_through_a_placed_view).cargo clippy -p victory-gpu --all-targets -- -D warnings, with and without--all-features: clean.rustfmt --checkon the new file: clean.cargo xtask policy: ok.Not run: the title, and the runtime's log with a subscriber (the lines go through
tracingliketdr::log).AI-assisted (Claude Code).
🤖 Generated with Claude Code
@jeremygold02 on GitHub · 2026-11-25 04:12 UTC · original
Triage verdict — Keep the diagnostics, reconcile with adapter selection (
8e0fcbf)Evidence
adapter.rsmodule, so the two PRs share an integration point. Preserve the actual-device log if the selector lands first. Device lookup · #967 patchWaveOpsfalse deserves different wording from an adapter that supports a narrow wave. Warning rules · D3D12 wave-size validationChecks and limits
mainand #967. The hybrid-adapter run is author-reported. I did not run adapter tests in this pass.Next step
This verification was AI-assisted.
@Marvisak on GitHub · 2026-11-25 09:22 UTC · original · edited 2026-11-26 02:15 UTC
Automated triage for the maintainers.
Merge candidate. Both points from the last triage are addressed.
bd233b3adds the// SAFETY:comment on theCheckInterfaceSupportblock inadapter::describe, and CI (check) now passes on this head.adapter::warningsnow warns separately for each console wave size, 32 or 64, that falls outside the device'sWaveLaneCountMin..=Max, and for a device withoutWaveOps. The unit tests cover 16-16, 32-32, 64-64 and no-ops. The change only logs:adapter::logruns once afterD3D12CreateDeviceinhost::create(not on the WARP path) and selects nothing. It still merges cleanly. #967, which also addsadapter.rs, does not merge cleanly at the moment.On your reply: thanks, that matches what is on
bd233b3(the// SAFETY:comments inlog/describeand the per-size wave warnings). Nothing further from triage; verdict unchanged.Generated by Claude Code
@rminzao on GitHub · 2026-11-26 01:43 UTC · original
Rebased onto
main(63bcca4) and pushedbd233b3:unsafeblock indescribenow has its// SAFETY:comment.cargo clippy --workspace --all-targets --locked -- -D warningsis clean, with and without--all-features.WaveOpsis false gets its own message ("has no wave operations").a_gpu_without_the_consoles_wave_sizes_is_warned_aboutcovers 16-16, 32-32, 64-64, 32-64, 4-128 and no wave ops.cargo test -p victory-gpu --lib adapter::: 3 passed. On this laptop the log still names the Intel UHD and points at the RTX 4050.AI-assisted (Claude Code).
@catminou4 on GitHub · 2026-11-25 04:17 UTC · original · reviewed
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Logs the host GPU and warns when it isn't the one to run on — multi-GPU diagnostics; useful for the laptop/Optimus class of issues (#1483 related).
@DenRakEiw on GitHub · 2026-11-25 04:50 UTC · original · reviewed
Tested locally merged onto
origin/main(940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC):cargo test -p victory-gpu --lib adapter::— 3 passed, 0 failedcargo xtask policy— ok (184 files ok)cargo clippy -p victory-gpu --all-targetsreports 1 warning (which fails-D warningsin CI):Holding off approval until the
// SAFETY:comment is added to the undocumentedunsafeblock.AI-assisted (Gemini 4 Neon).
@fuzeofficlal on GitHub · 2026-11-26 15:38 UTC · original · approved these changes
Reviewed
bd233b3ac16db13f9962638d9c5be86df74212c3and verified on a live dual-GPU Windows 11 desktop (AMD Ryzen 9 9950X integratedAMD Radeon(TM) Graphics+ discreteNVIDIA GeForce RTX 5090+ WARP) with D3D12 Debug Layer.Audit
crates/victory-gpu/src/lib.rs:20,crates/victory-gpu/src/host.rs:195,crates/victory-gpu/src/adapter.rs:25,:78,:120):adapteris cleanly gated behind#[cfg(windows)]and logged once inhost::createon the non-WARP path right beforetdr::log(), keeping WARP runs quiet and avoiding any interference with adapter selection.describedecodes adapter name, LUID, vendor ID, dedicated VRAM MiB, and 4-part UMD driver version viaCheckInterfaceSupport(&IDXGIDevice::IID).warningsaccurately distinguishes high-performance GPU mismatches (ignoring software adapters), missingWaveOps, and each missing console wave size (32/64).Verification
cargo run -p xtask -- policy(192 files ok)cargo clippy -p victory-gpu --all-targets -- -D warnings(default &--all-features)victory-gpuadapter::withVICTORY_D3D12_DEBUG=1: 3/3 passed on RTX 5090; 4/4 passed (adapter::+warp_adapter_accepts_only_software,--features diagnostics) on WARP.describe+warningsdirectly against every live DXGI adapter on this dual-GPU host:NVIDIA GeForce RTX 5090(0x10de, driver32.0.16.1656,32187 MiB,32-32lanes): matched DXGI high-performance adapter (no wrong-GPU warning) and emitted only thewave of 64warning.AMD Radeon(TM) Graphics(0x1002, driver32.0.21042.62,2021 MiB,32-64lanes): emitted the high-performance mismatch warning pointing toNVIDIA GeForce RTX 5090and no wave-size warning.Microsoft Basic Render Driver(0x1414,software=true, driver10.0.26100.9818,4-4lanes): flagged both wrong-GPU and32 or 64wave sizes if ever hit on the non-WARP path, while skipped underVICTORY_WARP=1.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.