[GAME STATUS]: GRAND THEFT AUTO V #2277

Open
opened 2026-11-26 10:17:51 +00:00 by github-bot · 1 comment
Owner

@⁠mariengirard471-code on GitHub · 2026-11-14 17:25 UTC · original

Game title

GRAND THEFT AUTO V

Game ID / serial

PPSA04263

KytyPS5 version

v0.3.0

Compatibility status

Main menu

Last working build / first broken build

No response

Result details

The emulator initializes correctly (Vulkan, shader cache, filesystem, audio), the title ID is detected and the game starts compiling shaders, then it stops with a fatal error in shader resource tracking on a compute shader:

shader resource tracking: hash=0xe777d90ed493bd6c stage=compute pc=0x0000093c buffer descriptor is not a valid runtime value; GPU-selected access requires a scalar, raw 8/16-bit, raw DWORD x1/x2/x3/x4, or formatted X load in D:\a\KytyPS5\KytyPS5\src\graphics\shader\recompiler\ir\passes\ResourceTracking.cpp:605

The result is identical after updating the GPU driver (same hash, same pc).

Steps to reproduce the result

  1. Open KytyPS5
  2. Boot Game
  3. Crash during shader compilation with the error above

Expected behavior

The game should boot to the intro / main menu

OS

Windows 11

CPU

Intel Core i5-12400F

GPU

NVIDIA GeForce RTX 3050

RAM / VRAM

RAM 32GO

Log file upload

_kyty.txt

Screenshots/video

No response

Extra notes

No response

**@⁠mariengirard471-code** on GitHub · 2026-11-14 17:25 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/2277) ### Game title GRAND THEFT AUTO V ### Game ID / serial PPSA04263 ### KytyPS5 version v0.3.0 ### Compatibility status Main menu ### Last working build / first broken build _No response_ ### Result details The emulator initializes correctly (Vulkan, shader cache, filesystem, audio), the title ID is detected and the game starts compiling shaders, then it stops with a fatal error in shader resource tracking on a compute shader: shader resource tracking: hash=0xe777d90ed493bd6c stage=compute pc=0x0000093c buffer descriptor is not a valid runtime value; GPU-selected access requires a scalar, raw 8/16-bit, raw DWORD x1/x2/x3/x4, or formatted X load in D:\a\KytyPS5\KytyPS5\src\graphics\shader\recompiler\ir\passes\ResourceTracking.cpp:605 The result is identical after updating the GPU driver (same hash, same pc). ### Steps to reproduce the result 2. Open KytyPS5 3. Boot Game 4. Crash during shader compilation with the error above ### Expected behavior The game should boot to the intro / main menu ### OS Windows 11 ### CPU Intel Core i5-12400F ### GPU NVIDIA GeForce RTX 3050 ### RAM / VRAM RAM 32GO ### Log file upload [_kyty.txt](https://github.com/user-attachments/files/34857094/_kyty.txt) ### Screenshots/video _No response_ ### Extra notes _No response_
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:17:51 +00:00
Author
Owner

@⁠taklaciwiz-maker on GitHub · 2026-11-21 21:07 UTC · original

PR #2501 fixes this exit. Below: what limits FPS after the fix (~55% of frame time is synchronous buffer readback).

With that PR, GTA V (PPSA04264, 01.011.001) gets past this error and plays the prologue (Ludendorff bank)
at 11–13 FPS. Hardware: RTX 5070 / Ryzen 5 7600X. CPU usage is only 6–9% of 12 threads.

The performance panel shows "CPU waiting on GPU" at 600–670 ms/s, with 3000–3900 waits/s (about 300 per
frame).

Almost all of these waits come from one place:
BufferCache::ReadMemory → DownloadBufferMemory<false> → m_scheduler.Wait(CurrentTick()).
Each call submits the open command buffer, waits for the GPU and copies a 512 KiB window. That takes
~0.09–0.4 ms per call.

The underlying cause: ObtainBuffer(..., is_written = true) marks the entire bound range as
GPU-modified (m_gpu_modified_ranges.Add(vaddr, size)) on every bind. GTA V binds large heaps as
written storage buffers (one is 41 MB). CPU and GPU-thread accesses to unrelated data in those heaps
therefore keep faulting.

I first measured this on a21fd80 plus the shader fix. The shader fix does not cause it; see item 4
below.

Current main (39936ff) is unchanged: in the prologue I measured 11.6–13.1 FPS, with "CPU waiting on
GPU" at 666–682 ms/s and 3360–3445 waits/s. Resident Evil Requiem (PPSA31246) shows the same pattern, at
~560 ms/s.

Measurements (temporary per-call-site counters, 5-second windows, accurate mode)

Wait origin (who called ReadMemory) calls / 5 s time / 5 s per call
Guest CPU read fault ~13 500 ~1.25 s ~0.09 ms
Guest CPU write fault ~900 ~0.10 s ~0.10 ms
GPU thread page fault (HandleFault on the GPU thread) ~4 500 ~1.15 s ~0.3 ms
TryReadBufferBacking from ReadShaderGuestMemory 0 — —
ImageHeap::Refresh 0 — —
BindSharedMemory indirect-args read 0 — —
TextureCache color-metadata readback 0 — —
  1. GPU thread faults:
    • About 60% of them hit a single 64 KiB block at 0x2a4a10000.
    • That block is the start of a 41,472,000-byte region. Game shaders bind the region as a written
      storage buffer about 136 times/s.
    • Each bind re-marks all 41 MB. The next GPU-thread access to that block then faults again. The block
      is likely SRT/descriptor data, which the x86 SRT walker reads directly.
  2. Guest CPU faults:
    • They are spread over about 220 buffers, mostly once per frame each.
    • Some hit 512 KiB windows of a 58 MB buffer that contains the 41 MB region.
    • More than 10,000 distinct addresses are bound as written storage buffers per 5 s, which looks like a
      ring or dynamic allocator.
  3. Sync downloads total 0.3–0.7 GB/s at about 0.125 ms per call. Most of the cost is submit-and-drain
    latency, not the bytes.
  4. Disabling GPU-written tracking for indirect candidates larger than 16 MB (the shader-fix path) did
    not change FPS. The same 41 MB range is also bound as written by a normal, non-indirect binding.

What did not work (for reference)

  • Downloading every GPU-modified buffer behind one wait:
    • Waits dropped 30× (21k → 700 per 5 s).
    • But buffers that only the GPU uses, which the CPU never reads, were re-copied on every fault. This
      overflowed the 64 MiB download stream buffer and dropped FPS to 2–3.
  • The same, limited to dirty spans of 4 MiB or less: downloads rose to 2.5 GB/s, and FPS was 3.3.
  • Skipping readbacks for GPU-thread reads: device lost at mission start (masterSemaphore.cpp:54),
    because descriptors were specialized from stale data.
  • Skipping readbacks for guest CPU reads only: the render froze at mission start while audio
    continued. The game reads GPU-written data to make progress, so readbacks cannot be skipped.

Possible directions

  • Track written ranges more precisely than "whole bound range per bind". One option is a GPU-side
    written-range or dirty-page feedback buffer that stores write into, resolved when a fault arrives.
  • Promote buffers that are read back repeatedly to host-visible, host-cached memory, and keep a
    last-GPU-write tick per buffer:
    • A fault whose write tick has already completed can copy from the mapping without recording a copy or
      submitting.
    • After one submit-and-wait, the other faults in the same tick need no further waits.
  • For the 41 MB case: if the writing shader's store range can be bounded, avoid marking ranges that hold
    only CPU-written data (SRT/descriptor tables).

PR #2469 (a large GTA integration) reports much higher FPS on an RTX 3090. I have not tested it, and I
don't know whether it changes this path.

Reproduce

  1. Enable "Show performance panel" in the launcher.
  2. In game, press F2.
  3. Start the first mission and watch "CPU waiting on GPU".
**@⁠taklaciwiz-maker** on GitHub · 2026-11-21 21:07 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/2277#issuecomment-7069251043) **PR #2501 fixes this exit. Below: what limits FPS after the fix (~55% of frame time is synchronous buffer readback).** With that PR, GTA V (PPSA04264, 01.011.001) gets past this error and plays the prologue (Ludendorff bank) at 11–13 FPS. Hardware: RTX 5070 / Ryzen 5 7600X. CPU usage is only 6–9% of 12 threads. The performance panel shows "CPU waiting on GPU" at 600–670 ms/s, with 3000–3900 waits/s (about 300 per frame). Almost all of these waits come from one place: `BufferCache::ReadMemory` → `DownloadBufferMemory<false>` → `m_scheduler.Wait(CurrentTick())`. Each call submits the open command buffer, waits for the GPU and copies a 512 KiB window. That takes ~0.09–0.4 ms per call. The underlying cause: `ObtainBuffer(..., is_written = true)` marks the **entire bound range** as GPU-modified (`m_gpu_modified_ranges.Add(vaddr, size)`) on every bind. GTA V binds large heaps as written storage buffers (one is 41 MB). CPU and GPU-thread accesses to unrelated data in those heaps therefore keep faulting. I first measured this on a21fd80 plus the shader fix. The shader fix does not cause it; see item 4 below. Current main (39936ff) is unchanged: in the prologue I measured 11.6–13.1 FPS, with "CPU waiting on GPU" at 666–682 ms/s and 3360–3445 waits/s. Resident Evil Requiem (PPSA31246) shows the same pattern, at ~560 ms/s. ## Measurements (temporary per-call-site counters, 5-second windows, accurate mode) | Wait origin (who called `ReadMemory`) | calls / 5 s | time / 5 s | per call | |---|---|---|---| | Guest CPU read fault | ~13 500 | ~1.25 s | ~0.09 ms | | Guest CPU write fault | ~900 | ~0.10 s | ~0.10 ms | | **GPU thread page fault (`HandleFault` on the GPU thread)** | ~4 500 | **~1.15 s** | ~0.3 ms | | `TryReadBufferBacking` from `ReadShaderGuestMemory` | 0 | — | — | | `ImageHeap::Refresh` | 0 | — | — | | `BindSharedMemory` indirect-args read | 0 | — | — | | `TextureCache` color-metadata readback | 0 | — | — | 1. **GPU thread faults:** - About 60% of them hit a single 64 KiB block at `0x2a4a10000`. - That block is the start of a 41,472,000-byte region. Game shaders bind the region as a written storage buffer about 136 times/s. - Each bind re-marks all 41 MB. The next GPU-thread access to that block then faults again. The block is likely SRT/descriptor data, which the x86 SRT walker reads directly. 2. **Guest CPU faults:** - They are spread over about 220 buffers, mostly once per frame each. - Some hit 512 KiB windows of a 58 MB buffer that contains the 41 MB region. - More than 10,000 distinct addresses are bound as written storage buffers per 5 s, which looks like a ring or dynamic allocator. 3. Sync downloads total 0.3–0.7 GB/s at about 0.125 ms per call. Most of the cost is submit-and-drain latency, not the bytes. 4. Disabling GPU-written tracking for indirect candidates larger than 16 MB (the shader-fix path) did **not** change FPS. The same 41 MB range is also bound as written by a normal, non-indirect binding. ## What did not work (for reference) - **Downloading every GPU-modified buffer behind one wait:** - Waits dropped 30× (21k → 700 per 5 s). - But buffers that only the GPU uses, which the CPU never reads, were re-copied on every fault. This overflowed the 64 MiB download stream buffer and dropped FPS to 2–3. - **The same, limited to dirty spans of 4 MiB or less:** downloads rose to 2.5 GB/s, and FPS was 3.3. - **Skipping readbacks for GPU-thread reads:** device lost at mission start (`masterSemaphore.cpp:54`), because descriptors were specialized from stale data. - **Skipping readbacks for guest CPU reads only:** the render froze at mission start while audio continued. The game reads GPU-written data to make progress, so readbacks cannot be skipped. ## Possible directions - Track written ranges more precisely than "whole bound range per bind". One option is a GPU-side written-range or dirty-page feedback buffer that stores write into, resolved when a fault arrives. - Promote buffers that are read back repeatedly to host-visible, host-cached memory, and keep a last-GPU-write tick per buffer: - A fault whose write tick has already completed can copy from the mapping without recording a copy or submitting. - After one submit-and-wait, the other faults in the same tick need no further waits. - For the 41 MB case: if the writing shader's store range can be bounded, avoid marking ranges that hold only CPU-written data (SRT/descriptor tables). PR #2469 (a large GTA integration) reports much higher FPS on an RTX 3090. I have not tested it, and I don't know whether it changes this path. ## Reproduce 1. Enable "Show performance panel" in the launcher. 2. In game, press F2. 3. Start the first mission and watch "CPU waiting on GPU".
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/KytyPS5--KytyPS5#2277
No description provided.