Card steps: leave out copies outside their buffers instead of recording them (GPU page fault and whole-GPU reset on RADV) #351
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!351
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-351"
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?
@Fedalv on GitHub · 2026-11-26 18:13 UTC · original
card-steps-bounds→main· +24 −0 · 1 files · 1 commits · closed without mergingProblem
A card step (
VICTORY_CARD_STEPS, on inplay.ps1) recordsCopyBufferRegioncalls whose offsets and lengths are worked out from title memory, and nothing checks them against the buffers before they are recorded. On Windows the runtime/driver may catch a bad range; vkd3d-proton does not validateCopyBufferRegion, and on RADV a copy past a buffer's end becomes a write by the card's command processor to an address of no allocation.What that looks like when it happens (Linux, RX 7900 XTX, RADV 26.2.5, Proton Experimental with vkd3d-proton master, three minutes into the opening sequence):
A write (RW 1) by the command processor (CPC) on vkd3d's compute queue to
0xfffffffff000: the shape of a buffer copy or fill with a wrapped offset. The queue reset fails, the whole GPU is reset, and the Wayland compositor dies with it (a full desktop crash, not just the title). #13 sawVICTORY_CARD_STEPS=2remove the device on the same card under Proton.Change
record()inhost/card_steps.rschecks every range against its buffer's width (GetDesc) and the staging buffer (BETWEEN), with overflow-checked sums, and leaves out a range that does not fit, with a warning (card step: a copy out of its buffer's range left out, the first 16 and then at powers of two). The barriers are built from the ranges that remain. One file, 25 lines; nothing else changes when every range fits.What this does and does not show
CARD_STEPS=2) the warning count is 0 and the kernel logged no GPU fault. So I cannot prove the reset above came from this path rather than another write on that queue; the PR is a guard, not a diagnosed fix.Tested
cargo xwin clippy -p victory-gpuwith and without--features diagnostics: no lint incard_steps.rs(the one error iswatch.rs:3626, already on main and fixed by #241/#324).cargo xtask policy: ok.AI-assisted (Claude Code); runs on my machine.
🤖 Generated with Claude Code
@Fedalv on GitHub · 2026-11-26 20:47 UTC · original
Update: the reset in the description is not from this path. It happened again (run 23, ~3 min in) with this check active: the same command-processor write to
0xfffffffff000, this time oncomp_1.2.0, and the check logged nothing (card step: a copy out of its buffer's range0 times). Both faults are in VMID 0 (vmid:0 pasid:0) on compute rings, which points below the layer (the driver's or firmware's handling of the compute queue) rather than at a copy the layer recorded.So this PR is only what it was described as in "What this does and does not show": a guard that turns an out-of-range card-step copy into a log line instead of a GPU write past a buffer, with no observed case of it firing. Fine to close if you'd rather not carry an unexercised check; I'll follow up on #352 with what the reset turns out to be.
AI-assisted (Claude Code).
Pull request closed