GPU: read the host GPU's vendor and capabilities once (host profile) #511
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/Belobug--VIctory-Belobug-AMD!511
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-511"
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?
@0xkn0wh3r3 on GitHub · 2026-11-27 07:57 UTC · original
0xkn0wh3r3:nvidia-host-profile→a-publier· +322 −53 · 6 files · 1 commits · openGroundwork for NVIDIA-specific defaults that leave the AMD RDNA paths as they are. This PR changes no behaviour; it gives later changes one place to choose a path by vendor or capability.
The NVIDIA reports (#333, #346, #457, #487) trace most of the gap to defaults tuned on the RX 7900 XTX: fallback heaps, residency waits, and card-buffer limits on 8–12 GB cards. Changing those for NVIDIA alone first needs the vendor known in one place. Today each check works it out for itself:
indirect::amd()creates a DXGI factory on every call, and an OPTIONS19 query runs on every pipeline creation.Changes
1.
host::profile, read once (newcrates/victory-gpu/src/host/profile.rs)host GPU profile.Vendor: AMD, NVIDIA, Intel, Microsoft, other, by PCI ID)WaveLaneCountMin/WaveLaneCountMaxNoneon older runtimes)Profile::amd(),nvidia()andrdna()give the answers; RDNA means AMD with waves of 32 and 64, as before.2. The existing checks read it
host.rs).indirect::amd(): the host device's answer comes from the profile. A test's or benchmark's own device is still asked directly, so the WARP tests are unaffected.Host::mapped_card_memory(), which keeps its own log line.tiles::wanted().pipeline/host.rs, which ran on every pipeline creation.3.
switch::by_host(name, read, default, nvidia)=1, or anything but0).nvidia. Every other host, including one whose vendor is not known, keepsdefault, the current value.#[expect(dead_code)], so the build fails once the first switch uses it, as a reminder to remove the attribute.Not changed
crates/victory-shader/srcchanges. Any edit there changes the translator's fingerprint (victory-gpu/build.rs), and every cached shader is translated again. So offlinetranslatekeeps its own AMD check inemit/host.rs.descriptor::host::probe_view_limit, which makes a heap to test it. The profile's value is what the runtime reports, for the log and for code that runs before any heap exists.Tests
Profileanswers for an RX 7900, an RTX card, an older AMD card and an unnamed adapterby_host's choice: a set variable wins on every host; a host that is not NVIDIA keeps the old defaultcargo test -p victory-gpu: 405 passed, 34 ignored. With--features diagnostics: 454 passed, 34 ignored.watch::port7_tests::no_write_is_lost_with_port_7failed once in a full run. It is a timing-sensitive write-watch test this PR does not touch. It passed five times alone and in a full rerun.cargo test -p xtask: 9 passed.cargo clippy -p victory-gpu -p victory --all-targets -- -D warnings: clean, with and without--features victory-gpu/diagnostics.Not verified
host GPU profileline in the log should sayvendor=Some(Nvidia)withwave_lanes=Some((32, 32)).@MamaLeVrai on GitHub · 2026-11-27 11:40 UTC · original
Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At
0f7c528:victory-gpu405 passed, 0 failed, 34 ignored.AI-assisted (Claude Code); no game data.
@WellyngtonSantos on GitHub · 2026-11-27 13:08 UTC · original
Tested on an older AMD card, the case
an_older_amd_card_or_unknown_lanes_is_not_rdnadescribes: RX 580 2048SP (Polaris / GCN4), AMD legacy driver 31.0.21925.1001, Windows 11 26200. The device reports PCI vendor 0x1002 and waves of 64 to 64 lanes. Cross-compiled with the pinned 1.98.1 toolchain (cargo xwin test -p victory-gpu --release --target x86_64-pc-windows-msvc --no-run), run from the crate directory with--test-threads=1.victory-gpua-publier4eb6cfd0f7c528The extra nine are the PR's new tests, and the six
host::profiletests among them pass. By the profile's rule (Amdwith lanes32..=64), this card is AMD and not RDNA, because it runs 64 lanes only. That is the casean_older_amd_card_or_unknown_lanes_is_not_rdnaencodes, and nothing in the crate's tests changes for it.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.