Repository navigation
Grand Theft Auto V (PPSA04264) #1203
Replies: 31 comments 19 replies
|
Update 2026-10-08: Performance mode in the prologue bank is now around 27-28 fps (23.5 before, same build with the new changes switched off). The changes are on by default on the |
|
Do you know what stage the game has reached on the current main branch? |
|
Hi @MichonGoddijn231849, thanks for keeping this discussion so detailed. It made it easy to see what GTA V still needs on main. I went through
Which of these would you like to upstream yourself, and which would you be happy for us to port (keeping you as the author and crediting this discussion)? I won't open anything until you say. I'll also stay off the Performance work and #1184 since you're re-cutting those. |
|
Totally should try again |
|
A contribution loop we run reads this thread as a work source, and it just opened a pull request against one of the items tracked here: #6321,
Measured on the host, on the real translation unit, with 35,000 registered 64 KiB ranges and 20,000 probes spread across range starts, interiors and gaps:
Identical results before and after: 4375 overlaps found, 4375 mappings refused. The subtle part is that a plain Not verified on the title. This is measured on the registry with this thread's range count; it is not an end-to-end frame-rate or watchdog claim, and it does not touch anything the shader recompiler or the AGC driver do. @MichonGoddijn231849 β if you run it, the question worth answering is whether the EngineWatchdog stop in #4634 moves for PPSA04264. Also merged since this thread was last updated: #5543, which fixes a relinker layout bug where the extra AI-assisted: written and reviewed with Claude Code plus a local model ladder, gated by the repository's own build, ctest and conventions checker. Happy to re-run anything above if the numbers look wrong. |
|
Current stop on It is the waterfall loop over per-lane T#s (each lane loads its T# with #6488 brings the fold back on the #757 image tables. With it, offline replay prepares all 10 captured GTA V requests of the run (9 fail on Written by Claude (AI assistant) on a contributor's machine. |
|
Update to my note above: #6488 has now been run in game (f85278a on fa9365c).
It has not got past the landing page: the two scripted R1 presses came before the landing page appeared, so the Story tab was never selected and nothing after it ran, and the eight compute shaders with the same loop were most likely not dispatched yet. A Story-mode run is next; I'll post the result. Windows Server 2025, RTX 3060 12 GB (591.86), Ryzen 9 5900X, PPSA04264 01.000.000 relinked, cold shader cache. AI-assisted: yes |
|
A contribution loop we run reads this thread as a work source, and it just opened a pull request against one of the items tracked here: #6638, fix(shader): ballot a predicate both wave64 halves share only once. Not verified on the title. Reported against this title from its blocker and thread data; measured locally, not on a run of the game. If you run it, a reply with what you see is worth more than anything we can add. AI-assisted: written and reviewed with Claude Code plus a local model ladder, gated by the repository own build, tests and conventions checker. |
|
A contribution loop we run reads this thread as a work source, and it just opened a pull request against one of the items tracked here: #6644, fix(shader): ballot each predicate once per block. Not verified on the title. Reported against this title from its blocker and thread data; measured locally, not on a run of the game. If you run it, a reply with what you see is worth more than anything we can add. AI-assisted: written and reviewed with Claude Code plus a local model ladder, gated by the repository own build, tests and conventions checker. |
|
A contribution loop we run reads this thread as a work source, and it just opened a pull request against one of the items tracked here: #6654, fix(shader): ballot 32-lane host subgroups with a subgroup OR. Not verified on the title. Reported against this title from its blocker and thread data; measured locally, not on a run of the game. If you run it, a reply with what you see is worth more than anything we can add. AI-assisted: written and reviewed with Claude Code plus a local model ladder, gated by the repository own build, tests and conventions checker. |
|
A contribution loop we run reads this thread as a work source, and it just opened a pull request against one of the items tracked here: #6677, fix(shader): shuffle both wave64 halves of a scalar with one vector shuffle. Not verified on the title. Reported against this title from its blocker and thread data; measured locally, not on a run of the game. If you run it, a reply with what you see is worth more than anything we can add. AI-assisted: written and reviewed with Claude Code plus a local model ladder, gated by the repository own build, tests and conventions checker. |
|
Story-mode runs on #6488 (f85278a), following my note above. The load now stops on two things; #6786 fixes the first. Before (gta-ckpt-c01, 1258 s in; the last frame dumped shows "Entering Story Mode (10%)"): A clear kernel of the title's BVH build read its indirect arguments on the CPU (160x288x4294967295 threads) before the setup kernel's address-based store had replaced them with After (same build with #6786 cherry-picked, two runs): no device-limit error. The clear kernel's first dispatch read 212x1x1 and 2872x1x1 threads. Both runs still stop later in the same BVH build: Windows logged an nvlddmkm event 153 at each. A run without the fix (gta-6488-c02) also lost the device (1342 s in, event 153) before the clear kernel had been seen, so this is a separate stop, and Story mode still does not load. I don't know its cause yet. Windows Server 2025, RTX 3060 (591.86), Ryzen 9 5900X, warm shader cache. AI-assisted: yes |
|
Data point from another machine (i9-13900K, RTX 4090, Windows 11): with a POC branch on main from Oct 14, Story (prologue bank, Performance mode) runs at ~21 FPS, with correct rendering. Video and details in #6754. Most of our CPU work turned out to parallel what's here (#1201/#1202/#494/#1191/#1747). The part that may be new for this thread is GPU-side:
Switching both to native ops took GTA's hottest compute from 8.25 to ~1.2 ms per frame. We also tried the committer spin and hysteresis from |
|
@MichonGoddijn231849 FYI, I tried to benchmark
So I could only compare ideas, not numbers. On our POC branch (main from Oct 14), I ported the committer spin, room hysteresis, the 64 KiB collect granule and the kept chunk batches. The first three were neutral to slightly negative here, and keeping the batch open across released rewind chunks was slower (19.3 vs 20.4 FPS: the GPU starts later). They are kept as opt-in switches in case they behave differently on your machine. |
|
Proposal before writing code, since it touches the queue-0 path from #1201/#1202 (@MichonGoddijn231849, would like your view). Data. On current main + #6488, GTA Story is CPU-bound at ~14.6 FPS here; with #6892 and #6848 it reaches ~17.3. On our test branch, the remaining big CPU lever is preparing draws in parallel. Turning it off there costs 5.4 % (19.96 β 18.88 FPS). The preparation steps involved are decode, capture, shader lookup, key and validation, and vertex layout. How it would work on main. Main runs every draw's preparation on the packet thread, then hands the commit to the draw pipeline. The idea is to keep that FIFO exactly as it is, so commits, labels and waits stay in packet order, and only run the preparation of the next N draws on a small pool. Each preparation works on a snapshot of the packet state. The commit still happens in order on the draw thread, and waits for its own preparation if it isn't done yet. The trap we hit. On our branch, label writes are ordered jobs, and they overtook preparations that weren't finished. The rule that fixed it is that a label, a wait or any non-draw packet that drains the pipeline must also wait for the pending preparations, not only for the pending commits. Questions before I start:
|
|
GTA V in game on plain main, Linux. Title: PPSA04263 (EU) 01.010.002, relinked with --to-intel (Intel CPU without SSE4A) Resume Story loads the prologue (140 s after the press, warm shader cache), then 60 s in the bank with no driver failure or crash. Frame p50 about 103 ms with APS5_TRACE_SUMMARY_EVERY=10 set, so not a Performance report capture. #6654 is no longer needed on this driver: main without it no longer crashes in libnvidia-gpucomp, which it did on 385ed71. AI-assisted: yes |
|
A tip for anyone testing GTA V on Windows: set In the open world on current Two more notes from tonight:
AI-assisted: yes (Claude Code) |
Suggestion: Dynamic Contract & Parameter Logging via Comparative Runtime Tracingcc @MichonGoddijn231849 @CPritch @AlxcBTW @harisibrar1 @tibzejoker β tagging active GTA V testers and investigators here in case trace captures or telemetry runs can be gathered to map these boundaries: To help bridge the gap on missing/throwing exports without violating the strict "no made-up success / no invented state" invariant, we could consider a structured comparative tracing approach using titles running under instrumented environments (e.g. jailbroken PS5 hardware with DTrace/klog, or instrumented emulators/dynamic hooks): 1. Why this is neededA major roadblock for complex AAA titles like Grand Theft Auto V (PPSA04264) is hitting 2. How to implement the loggerUsing dynamic binary instrumentation (DBI) or a lightweight detour wrapper at the relinker / PRX boundary:
3. What specifically to captureWhen capturing logs from a running session, the following telemetry provides immediate engineering value:
This empirical capture can directly supply the test assertions, boundary validations, and technical debt documentation needed to implement clean, permanent implementations for upstream AnyPS5. |
|
GTA V in game on Linux with one open PR, and the open issues for it. Title: PPSA04264 (US) 01.011.001 Story mode loads, the opening cutscenes play and the open world is playable, in six runs of up to 674 s with no driver failure or crash. Frame p50 about 70 ms in cutscenes and 120β240 ms in the open world (warm shader cache, Needed on current
Open issues:
AI-assisted: yes (Claude Code) |
|
Performance update for the first two Story cutscenes on Linux ( The frame is bound by the queue-0 draw committer, at ~1,900 draws per frame and 30β36 Β΅s per draw. The measurements are in #7895: #7895 (comment). AI-assisted: yes (Claude Code) |
Where the frame goes in gameplay: North Yankton bank, Linux, RTX 3080 TiSetup:
Route from a fresh profile: title Cross, calibration Cross, R1 twice to the Story tab, Cross. With Result: 63 presents in 20 s (about 3 FPS), frame p50 316 ms, GPU busy 242 ms per present. Queue worker 0 is the limit, not the draw committer. It is busy 297 of the 316 ms. The other four queue workers wait on it 83 to 93 % of the time, and the draw committer is busy 20 %. Where queue worker 0's time goes, per frame:
So about 44 draw stages per frame miss the draw cache. For each one the driver walks the shader again for its resources ( This differs from the cutscene numbers above, where the draw committer was the limit at about 1,900 draws per frame. I haven't yet looked at why these 44 stages miss each frame (which shaders, which key changes). That is my next run with the resource-key miss trace. AI-assisted; the runs are from my machine(s). |
The GPU side of the bank scene: one compute shader at 255 registersA follow-up to my post above: the CPU side there points at #6188; this is the GPU's 242 ms per frame. Same setup: One program is half the GPU frame. With Why it is slow on NVIDIA:
So it is latency-bound at very low occupancy: register pressure, not ALU work or bandwidth. What the 214k words are: the main function has 38,303 instructions. The arithmetic is small (1,270
So the cost comes from how guest-memory reads through GPU pointers are emitted (page-table walks, fault checks, lane-mask selects), not from the shader's own work. Tried, no change to this program:
The load-side table decoding (#3656, #8721) and #11711 are already in AI-assisted; the runs are from my machine(s). |
Bank scene follow-up: what is on the critical path, and what we testedSetup (as in my posts above): PPSA04263 (EU) 01.010.002, Two corrections to my posts above:
Where the GPU waits. The GPU is idle about 77 ms per frame, mostly in gaps of 2 ms or more (up to ~40 ms). In those gaps queue worker 0 runs one compute dispatch that takes ~33 ms of CPU per frame, almost all of it building that dispatch's resources:
Each frame it resolves ~3 image tables of ~3,820 entries from scratch. Tested on this scene:
Why the image tables are rebuilt each frame: ~1,557 entries per table are views through storage images (host-import surfaces), ~38 have a DCC address, and ~167 sit in memory the write watch doesn't cover (~58 with #12452). Table reuse also stops at each collect epoch. Even with all of that handled, the table build's own cost stays, so I'm not pursuing it further. What is left, as far as I can see: the waterfall shader on the GPU, and the per-table materialize cost on the CPU. I keep the scene set up as a test bench: if a PR touches either of these, I can run it here (main vs PR, traces) within the hour. AI-assisted; the runs are from my machine(s). |
Update: the bank scene on plain
|
10-31 (9f748f4d8e + #11580) |
now (e5dba50ccb, last 10 s windows of 3 runs) |
|
|---|---|---|
| presents per second | about 3.1 | 3.0β3.1 |
| frame p50 | 316 ms | 320β323 ms |
| GPU busy per present | 242 ms | 236β237 ms |
| queue worker 0 busy | about 99 % | 99.4 % |
GPU time by program in the bank with APS5_PROFILE_GPU=1, per 10 s ([gputime], 30β32 presents):
| program | 10-31 | now |
|---|---|---|
compute 0x25b454a00 (the 255-register one) |
3,970 ms | 3,870β3,950 ms |
0x25b458800 |
about 700 ms | 650β700 ms |
0x25b47e400 |
about 490 ms | 490β510 ms |
| all timed GPU work | about 5,800 ms |
0x25b454a00 is still about two thirds of the GPU time on this card, about 125 ms per frame. As in my last post, it is a per-pixel waterfall over a table indexed by per-lane data, so it needs a different translation of that loop. Nothing in main since 10-31 has touched it.
AI-assisted.
The same bank scene on AMD (RADV): the heavy compute also maxes out the registersA follow-up to my update above, to check whether the 255-register compute Setup: PPSA04263 (EU) 01.010.002, the same Story save, plain
The On the 780M the bank runs at only 0.12β0.21 presents/s. Queue worker 0 is 100 % busy there, and the GPU is busy only about 1 s per 10 s, so this slower machine is limited by the CPU before the GPU. This program is still the largest single GPU cost. So on the GPU family the game was written for, this program's translated loop is still at the register limit and spills. A translation that turns the lane-keyed scalar loads into a direct per-lane access, instead of keeping the loop, would help on both vendors. AI-assisted. |
Correction and a closer look at
|
| op | count |
|---|---|
SelectU32 |
1,983 |
BitwiseAnd32 |
1,338 |
BitCastF32U32 + BitCastU32F32 |
1,938 |
Phi |
638 |
FPMad32 + FPMul32 |
about 400 |
ReadLane / FindILsb32 / Ballot |
26 / 30 / 126 |
Most SelectU32 are the EXEC emulation: SelectU32 <lane active>, <new>, <old> after each vector result in a masked region. One lane-active value has 98 uses. Each select keeps the old value live next to the new one, and on both vendors that's what fills the registers. The only ReadLane loop near the end gathers the wave's distinct values into a list of at most 60 entries. It is small and loads no descriptors. It isn't the cause.
2. Both vendors hit the limit. On RADV the program runs natively as wave64, with no spanned-wave log line, and still allocates 256 VGPRs with spills (my post above). So the EXEC selects are enough to reach the limit on their own.
3. Why NVIDIA falls back to two lanes per invocation. The log says:
[spanned-wave] 0x25b454a00 falls back to two lanes per invocation: an OpControlBarrier in block %1633 of function %156 sits in control flow a per-invocation value decides
I ran SpannedBarrierInDivergentFlow (#7922) offline on this program's spanned module, with a few local prints added. The chain:
- The emitter puts some masked vector code in real per-lane branches (condition: this lane's EXEC bit, ANDed with a per-lane flag). Their merges are divergent merges, so a
Phiof an EXEC-derived value at such a merge is non-uniform. That's correct, since lanes really do come from different predecessors there. - One spanned ballot runs under a branch on such a value. It writes the ballot parity variable (the
Privatetoggle that picks thewave_ballotslot) in divergent flow, sostoredNonUniformtakes that variable (SpirvSpannedUniformity.cpp:482). - From then on, every load of the parity variable is non-uniform. So is every spanned ballot result, and every branch on one. The barrier it reports, in
%1633, is just the first one in flow order. It sits under a branch on a ballot result that is actually the same for all 64 lanes.
So the fallback is not a false positive that a small fix would remove. A ballot really does run under a per-lane branch. Avoiding the fallback would need the emitter to keep EXEC and ballot state out of per-lane branches, or the check to prove that those Phis carry the same value on every path. Getting that wrong would hang the device, and it would help NVIDIA only, since RADV hits 256 VGPRs without it.
What would help on both vendors: fewer EXEC selects whose old value is never read again. MaskedSelectEliminator covers only the narrow case in docs/dev/debt/shader.md. I'm not opening a PR for either path; this is a note for whoever works on the emitter or #7922. I can run any change against this program and the bank scene on both an RTX 3080 Ti and a Radeon 780M, reporting register counts, [gputime] and FPS. The IR and the modules stay local, since they're the title's code.
AI-assisted.
|
GTA V (PPSA04264 01.010.002) on Windows, North Yankton bank, Performance mode: 12.5 β 16.3 fps with System: Windows 11 Pro 10.0.26200, Ryzen 9 5900X, RTX 3080 Ti (32.0.16.1742), 64 GB, WinLibs GCC 15.2.0, Release. Graphics mode matters most: the save defaulted to Fidelity, where the ray-traced compute takes ~165 ms per frame on this card: 2.3 fps. Performance mode in the same spot: 12.5 fps on
Note for unattended runs: with the display asleep, presents are capped at about 5 per second on this machine regardless of the build; wake the display before measuring. AI-assisted: yes (Claude Code) |
|
For testers on Linux: the On Subnautica, the branch renders 182.9 FPS against 112.4 for native Kyty on the same PC, so it may be worth a try here too. Build steps and settings: AnyKyty. Reports are welcome as issues on the fork, whether it works or not. |
|
For anyone comparing GTA V performance on Windows, StoryBench can launch the five benchmark scenes already present in the US PS5 game ( On one Windows PC with AnyPS5 I'd be interested in results from a second PC. If you try it, please share your AnyPS5 revision, GPU, whether the shader cache was warm, and the five rows from |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Tested
sce_module.Status
On the
gta-v/testingbranch (based onmainfrom before #639): in game on Windows. "Resume Story" starts the North Yankton prologue, which plays with rendering, reflections, music, speech, sound effects and the HUD working.On current
main(d70b899, 2026-10-09): stops at boot. With the open pull requests under "Needed on current main" below it presents its first frames (the start screens), then stops on a T# read from a material table (bindless image tables, #1184). Getting it in game onmainis what I am working on now.[GTA V prologue, Performance mode - deleted img]
gta-v/testing)Only tested in the prologue, in the bank. The frame rate drops a bit depending on where you are and where you look.
Story Mode is an add-on entitlement. Listing
GTAVSTORYMODE001inanyps5-entitlements.ini(#153) enables "Resume Story".Needed on current main
Since #639,
mainneeds these open pull requests to get this far, in the order of the stops they fix:fix-shader-sampled-heap-capacity)How to run it
The
gta-v/testingbranch is the pull requests in the "Pull requests" section below merged together, plus the 2026-10-08 Performance work that is not split into pull requests yet. It is a testing branch, not for merging: each change is, or will be, its own pull request. The first launch compiles the shader cache and can sit on a black screen for a few minutes before the first frame.Performance
Performance mode is CPU-bound, not GPU-bound. During gameplay the GPU is about 48% busy and the CPU about 25% (3 busy threads). A frame has about 1,800 draws, and one thread records them into Vulkan command buffers at about 23 Β΅s each, which caps the frame rate. Going from 11 to around 20-23 fps came from pipelining that recording behind the packet decoding and making each draw cheaper. On 2026-10-08 a further set of draw-path changes took the bank from 23.5 to 27.8 fps (measured with the same build, switches off and on): finished draws freed by the decoding thread, fewer and batched GPU submits on a submit thread, render-target checks and draw keys reused while nothing changed, and wider write-watch reads. They are on by default on the testing branch and reach the pull requests separately. Next: moving more of the per-draw work off the recording thread; compute dispatches that no longer drain the pipeline are in #1747 (no change in GTA V, which has few dispatches between draws).
Open issues
Pull requests
Every change on the testing branch that the title needs is in one of these. Stacked pull requests say so with "Depends on".
Rendering:
Shaders:
Memory:
Performance (11 to 23 fps):
All reactions