GPU: a wait for a submission ends when the device is lost or the GPU stalls #1750
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!1750
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1750"
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?
@x3ero0 on GitHub · 2026-11-24 21:59 UTC · original
x3ero0:gpu-wait-device-lost→main· +160 −3 · 1 files · 1 commits · openRefs #1118 and #714.
Problem
Host::executewaits for each submission withWaitForSingleObject(INFINITE)and only afterwards asks the device whether it was removed. A host that loses its device does not have to signal the fences of the work it dropped. vkd3d-proton after a GPU fault does not, and with its default settings it does not mark the device removed either: its fence wait on the driver has no timeout unlessVKD3D_CONFIG=faultorbreadcrumbsis set.What follows is the crash many reports end with:
+0x23cf683.crashes.logthen holds the title's crash and nothing about the GPU. On this machine that was the outcome of 9 of 9 world runs without this change, 24 to 30 s after the Xid each time.Change
One file,
crates/victory-gpu/src/host.rs. The wait goes in 250 ms slices (wait_for_submission):host submission still on the GPU).fail, with a report of its own:host GPU has not finished a submission of N lists in 25 s and reports no removal.VICTORY_GPU_TIMING), records that list asremoved_in, as the check after each list does onmain, so the report still names it.A fence that comes is taken exactly as before, so a healthy run and a Windows device removal (which signals) behave as they do now.
The one policy choice here is the 25 s limit, and it is a single constant (
STALL_SECS). It is below the title's 30 s so that the run ends with our report of the cause and not with the title's crash. For scale: vkd3d-proton's source calls a fence wait of more than 5 s "pretty much a guaranteed timeout (TDR) scenario", and Windows resets a device after about 2 s. If you would rather it only reported and kept waiting, that is a two-line change.Testing
Rebased onto
main940d32f. The only conflict was two tests added side by side; both are kept.On the rebased commit (Linux, RTX 5080, driver 620.70, GE-Proton11-6's Wine, vkd3d-proton
30b0eb9, diagnostics build of this branch + #177 + #259):host submission still on the GPUat 10 s and 20 s and the stall report at 25 s (... a submission of 18 lists in 25 s and reports no removal), also incrashes.log. No title crash.VICTORY_SKIP_PIPELINESfor three compute pipelines whose creation never returned under vkd3d-proton (476446edcac7d521,e79dd4bd900b4200,d6dba265fd10bc2b; the run froze without it). The earlier base needed no skips. That is not this change.VKD3D_CONFIG=fault+VICTORY_GPU_TIMINGrun that would exercise theremoved_inline. On this tree that run froze the whole process during world load before any fault, with no wait of ours involved.cargo test --workspace, Windows target under Wine: 621 passed, 81 failed;mainis 620 passed with the same 81 failures, all environmental (no hardware adapter for the shader tests under Wine).victory-gpualone: 144 passed (147 with--all-features).cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--all-features;cargo xtask policy. The lines this change adds are rustfmt-clean.Before the rebase (base
ffe310e+ #177 + #259, same machine):+0x23cf683, 24 to 30 s later (8 of 8 runs)VKD3D_CONFIG=fault+0x23cf683, 29 s laterVKD3D_CONFIG=faulthost GPU device removed ...; device removed: 0x887A0005, 4 s latera_wait_for_a_submission_ends_when_the_device_is_removedcovers the four outcomes with closures in place of the fence and the device (no GPU needed).Notes
wait_gpuis alsoINFINITE. If #595 lands first I will redo this on top of it.VICTORY_STACKSon a run that died. The submit thread sat invictory_gpu::queue::execute, the render thread in its wait for a free ring slot, the main thread in the wait the watchdog guards. No game data is attached.🤖 Generated with Claude Code
@acetonahard-code on GitHub · 2026-11-24 22:35 UTC · original
Tested on Windows 11, RTX 4070 SUPER (driver 621.14), with the repo toolchain, merged into current
main(70564ae):cargo test -p victory-gpumainmain+ this PRmain,--all-featuresmain+ this PR,--all-featurescargo clippy --all-targets -- -D warnings, with and without--all-features: clean.cargo fmt --checkwould rewrap 3 blocks this PR adds (host.rs).mainisn't rustfmt-clean either, so take it or leave it.victory-gputests fail on currentmainon this NVIDIA card:dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_views. That's the 1,000,000-view heap cap, see #1744. They fail the same way with this PR, and no other test does.I didn't test with game data.
Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.
@Marvisak on GitHub · 2026-11-25 01:35 UTC · original · edited 2026-11-25 22:24 UTC
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main:mainhas moved since the last triage, and the branch now conflicts incrates/victory-gpu/src/host.rs. It will be reviewed again once it is rebased onto currentmain.Previous verdict for this head: merge candidate.
Generated by Claude Code
@Jitheswar on GitHub · 2026-11-25 08:47 UTC · original
Verification on Linux: RTX 3050 6 GB Laptop, Proton 11, vkd3d-proton. Tree:
ffe310e+ #1296 + #491, with this PR merged cleanly atb58b779.On the #1118 hang (the GPU stuck at 100% inside one mesh or compute dispatch; details on #1118), the control tree ended 2 of 2 runs with the title's watchdog at
+0x23cf683. With this PR, 0 of 2 did. Both runs instead logged "host GPU has not finished a submission of 27 lists in 25 s and reports no removal" (28 lists in the second) and ended cleanly at frames 1714 and 1719. That's the behaviour the PR describes: the stall becomes a report that names the cause instead of a null write in the title. It doesn't remove the hang itself, which is expected.AI-assisted (Claude Code). Tested with my own dump of Grand Theft Auto VI 1.0.2.1.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.