GPU: a present waits for the previous frame's submissions, not its own #1828
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!1828
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1828/head"
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?
@Jitheswar on GitHub · 2026-11-24 23:05 UTC · original
claude/595-present-frame-lag→main· +2195 −306 · 15 files · 2 commits · closed without mergingGrand Theft Auto VI submits from one thread: for each batch it calls
ExecuteX, PresentX and Signal, and only then gives its ring slots back
to the producers its main thread waits on (#1118). With submissions
asynchronous,
Host::presentstill drained every submission afterPresent, so that thread waited for the frame's whole GPU time insidePresentX. The title waits for its fences, not for the present, so the
shortcut's condition holds: a present now finishes the previous
frame's submissions (and its copy, whose list it reuses) before it
records this frame's, and leaves this frame's running. ResizeBuffers
still drains; a saved capture settles its frame before reading it back.
The copy list now holds the presented texture, since the title may
release it while the copy still runs.
Diagnostics: the black-frame probe of a frame is read at the next
present, once that frame's work has finished, and reported with that
frame's own number, resource and draws.
Co-Authored-By: Claude Opus 5.5 [email protected]
@DesertGamer on GitHub · 2026-11-24 23:06 UTC · original
VIctory V2: community PRs, merged and tested
Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.
Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).
⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.
Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2
Unofficial community fork of Marvisak/VIctory, GPL-3.0.
@wwwwwwww3333333 on GitHub · 2026-11-25 00:28 UTC · original
Ran this on AMD hardware. One of the PR's own tests fails there; I found why and have a small fix, tested on the same card.
Setup: main
70564ae0+ this PR (dfac3b4,3a85ae5; merges cleanly). RX 6750 XT (RDNA2, driver 32.0.21045.29003), Windows 11, Rust 1.98.1 MSVC.What fails.
host::submissions::a_repeated_list_reads_its_own_upload_memoryfails 10 of 11 runs on hardware, always withleft: [0x00000000, 0x22222222]. It passes on WARP (--features diagnostics,VICTORY_D3D12_WARP=1). The other 9 new tests pass.Narrowing it down. I ran a print-only diagnostic with the test's lists and
outpre-filled with0xEE:[list, between, list],between's copy never lands: out[0] stays0xEEEEEEEE.betweenwriting into a buffer of its own.[list, between]alone, and[list, between, third]with a different third list, are fine.queue.Waiton the previous group's fence before the secondExecuteCommandListsdoesn't help, and neither does a global UAV barrier at the start of the repeat's prelude.So it isn't a memory or cache problem. The lists before the cut don't run when the same list is submitted again in the next
ExecuteCommandListswhile the first group is still pending.Why. The
ExecuteCommandListsdocs say "the driver is free to patch the submitted command lists". They make it the application's job to ensure the GPU isn't still reading any of them from a previous execution. The repeat resubmitslistwhile its first execution is pending.My best explanation, which I haven't verified inside the driver: AMD chains the lists of one call by patching their ends. Resubmitting
listre-patches it before the GPU has read the first group, sobetween, whichlistchained to, is skipped. That would also explain why only a CPU-side wait helps: the patching happens at submission, on the CPU.Fix. Before a later group (the cut a repeat makes), wait on the CPU for the previous group's fence. Only submissions that name a list twice wait; every other submission stays asynchronous. The two-preludes test held the first group behind a gate and asserted that nothing waits, so with the fix it can't finish. It now runs without the gate and checks the same things: the repeat makes its own prelude (counted from the spares pool once it has run), and the final texture state is COPY_SOURCE.
Results with the fix, same card:
a_repeated_list_reads_its_own_upload_memory: 10/10.draw::tests::root_views_reach_their_copy_and_read_zeros_past_it, main's intermittent test, which fails on main alone too.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.Patch on top of this PR (host.rs)
Unit tests only, no game files. AI-assisted (Claude found the cause and wrote the fix; I ran everything on my machine).
@Marvisak on GitHub · 2026-11-25 01:36 UTC · original
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-gpu/src/descriptor.rs,crates/victory-gpu/src/host.rs,crates/victory-gpu/src/shadow.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
@Jitheswar on GitHub · 2026-11-25 02:33 UTC · original
Closing: this was opened against
mainby mistake. It's #595's async-submission commit plus one commit on top, on an old base, so it can't merge on its own. The one commit (a present waits for the previous frame, not its own) is offered to #595's author as https://github.com/wbkepler/VIctory/pull/5 instead. Measured on the game, it doesn't fix the #1118 stop by itself (details on #1118 and in that PR). Sorry for the noise. AI-assisted (Claude Code).Pull request closed