gpu: avoid three AMD device removals (alias default, aside flight, enhanced barriers) #176
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/ReTerryDavis--ReVIctory!176
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-175"
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?
@scarlett7023 on GitHub · 2026-12-05 21:06 UTC · original
scarlett7023:fix/amd-device-removals→main· +41 −2 · 3 files · 1 commits · openThree small fixes for the device removals we hit on an RX 7900 XT (Windows 11 23H2, driver 32.0.32015.16001). All three were reproduced on a self-compiled
--features diagnosticsbuild withVICTORY_D3D12_DEBUG=1, and each one alone is enough to kill a session.1. Zero-copy alias kills a plain double-clicked launch
crates/victory-gpu/src/resource.rs-relaxed_format_casting(). With the alias enabled the first frames already fail, before any of the fence problems show up:The fix flips the default: the alias is now opt-in (
VICTORY_DIRECT_ALIAS=1), instead of opt-out. This is the one that makes a launcher-started run die instantly, so it is the difference between "crashes on launch" and "runs".2. The resident copy list is re-executed before its previous flight lands
crates/victory-gpu/src/host.rs,mapped_at(). The single recordedAside.listis executed on the copy queue every time card memory is made, and nothing waits for the previous execution. Two threads making memory at once re-execute it while the old flight is pending, which D3D12 rejects:Adding a wait before the submission (
a.fence.GetCompletedValue() < a.value->SetEventOnCompletion(a.value, None), which blocks) makes id 553 disappear.@YamoriCoutested this on RDNA 2 with the JOIN defaults left on (VICTORY_JOIN_SEND=1 VICTORY_JOIN_PARTS=8), which used to crash within seconds, and got 34+ minutes with no errors at ~27.6 fps in v0.6.0.3.
ID3D12GraphicsCommandList7is QI'd on devices without enhanced barrierscrates/victory-gpu/src/host/rec.rs. The QI succeeds even whenD3D12_OPTIONS12::EnhancedBarriersSupportedis false, and the first barrier recorded through it then fails:The fix asks the device first (
CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12)) and keepslist7asNonewhen it is not supported, falling back to legacy barriers.Testing
With the three changes, a plain double-clicked launch with no environment variables at all runs with 0 ERROR lines and no device removal. 3840x2160 native is GPU-bound at ~12 fps on the 7900 XT, both with this build and with the official binary once the pipeline warm-up is done, so the changes do not regress performance.
cargo check -p victoryis clean (no warnings).Happy to adjust naming/comments to match the project's conventions.
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.