Skip to content

Cyberpunk 2077 (PPSA04029) on NVIDIA: guest storage texture format 4 (R5G6B5) cannot be used as a storage image #6119

Closed

Description

@snoozedDev

Title: Cyberpunk 2077 (PPSA04029 v02.120.000, EU disc, owned). Converted from the dump's eboot.bin with relinker --registry built from the same main, no --to-intel. Follows #3308 and #4634: stops 1 and 2 of #3308 are fixed on main; stop 3 (the title's EngineWatchdog) trips in 2 of 3 cold runs on this main (rerun on #4634). This is the stop the title reaches on bare main when it gets past the watchdog.
Host: Linux (kernel 7.2.5), GCC 16.2.1, RTX 3090, NVIDIA 610.57.04, selected with ANYPS5_GPU=3090. The format query below was also run on the host's RADV Raphael iGPU (Mesa 26.2.2).
Build: main 799982f, Release, -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON (what build.yml's linux job uses). No probes; no cherry-picks in the runs quoted.
Launch: APS5_TRACE_DISPATCH_IO=1 ANYPS5_GPU=3090 timeout 520 ./app.elf inside gamescope --backend headless -W 2304 -H 1296 -r 60, one launch at a time. Times are from launch to the title's exit, measured by the wrapper script.
sce_module/: as in #3308.

The stop

At the first presentation, 491 s after launch cold (10,330 compute dispatches before it) and 205 s warm (12,954):

[videoout] presentation failed: compute shader 0x1aa4f07500: AGC graphics: guest storage texture format 4 cannot be used as a storage image
terminate called after throwing an instance of 'std::runtime_error'
  what():  compute shader 0x1aa4f07500: AGC graphics: guest storage texture format 4 cannot be used as a storage image
[gpu] driver failure: compute shader 0x1aa4f07500: AGC graphics: guest storage texture format 4 cannot be used as a storage image

The same shader and exception text ended two more cold runs and one warm run of this main with #1324's (a) branch cherry-picked (#4634; the warm run's log has no [videoout] line before it). The lines before the stop in the cold run ([dispatch-io] resource lines left out; guest addresses differ between runs):

[src/Texture.cpp:1088 StorageTexture] StorageTexture address=0x1cb2bf0000 200x113 mips=1 mip=0 layers=0 base=0 dim=1 tile=2 format=1 vk=9
[dispatch-io] shader 0x1aa4cd0a00
[src/Texture.cpp:749 Texture] Texture address=0x1cb2bf0000 200x113 mips=1 viewed from storage image (vk=9)
[dispatch-io] shader 0x1aa4f74d00
[dispatch-io] shader 0x1aa4f07500
[videoout] presentation failed: compute shader 0x1aa4f07500: AGC graphics: guest storage texture format 4 cannot be used as a storage image

Where it comes from

Line numbers are on 799982f. format 4 is the VkFormat value, VK_FORMAT_R5G6B5_UNORM_PACK16, which guest format 133 resolves to (TextureFormat.cpp:70). StorageFormatOrUndefined (Texture.cpp:909) accepts a format as a storage image only when the device reports VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT in optimalTilingFeatures, and falls back only from the five sRGB formats to their UNORM forms; StorageFormatFor (line 963) throws for every other unsupported format. A dispatch's storage image reaches StorageFormatFor through cachedStorageTexture (ShaderResources.cpp:887; its SurfaceKey at line 835 calls StorageFormatForGuest) and, on a cache miss, again in StorageTexture's constructor (Texture.cpp:1086); both throw this text. vkGetPhysicalDeviceFormatProperties on this host:

format RTX 3090, NVIDIA 610.57.04 RADV Raphael, Mesa 26.2.2
VK_FORMAT_R5G6B5_UNORM_PACK16 (4) 0x0001dd81, no STORAGE_IMAGE_BIT 0x0001dd83
VK_FORMAT_B5G6R5_UNORM_PACK16 (5) 0x0001d401, no STORAGE_IMAGE_BIT 0x0001dd83
VK_FORMAT_A1R5G5B5_UNORM_PACK16 (8) 0x0001dd81, no STORAGE_IMAGE_BIT 0x0001dd83
VK_FORMAT_B4G4R4A4_UNORM_PACK16 (3) 0x0001d401, no STORAGE_IMAGE_BIT 0x0001dd83

So the stop depends on the driver: NVIDIA exposes none of these four packed 16-bit formats as a storage image, and RADV exposes all four. The sampled-texture path already asks before choosing (SampledFromStorageEligible, ShaderResources.cpp:410, through StorageFormatAvailable). A run of the title on the RADV iGPU did not reach its first presentation within the 520 s limit (9,869 dispatches, no watchdog; the iGPU is slower and the shader cache is per device), so whether the title gets past this point on RADV is not shown here.

Seen, not stops, in every run

79 s_swappc_b64 deferrals and 4 unsupported registered shader type 8; no not implemented line. The GetImageResource dword 0 background preparation failures and the sceSysmoduleLoadModule unknown id listed in #3308 and #4634 no longer appear on this main.

AI-assisted: yes (Claude Code, Claude Fable 5.1), operating under my supervision; I am accountable for this report and will respond to review.

Activity

  1. harry-z-kang commented on Oct 15, 2026

    @harry-z-kang
    Contributor

    @snoozedDev I've opened #6218 to address the packed 16-bit storage-format failure reported here. It keeps the native packed sampled format and writes through a compatible R16_UINT storage view, preserving the original guest bytes.

    The full build and 98 related tests passed on Windows 11 with an RTX 5080 (NVIDIA 617.14), including three packed-format GPU regressions. These local runs used ANYPS5_ENABLE_SPIRV_TOOLS=OFF; Cyberpunk 2077 has not been run, so title progress is unverified.

    Could you compare current main with #6218 on your RTX 3090 using PPSA04029 v02.120.000 and the same build/launch settings from this report, including ANYPS5_ENABLE_SPIRV_TOOLS=ON? The PR head is 8322164f15e322f727a5fc35aaf10822de678970 (harry-z-kang:codex/issue-6119-packed-storage).

    Please report whether the guest storage texture format 4 exception disappears, whether the title reaches its first presentation, and any replacement error. Commit IDs and the relevant log tail would help distinguish this fix from changes on main or an earlier watchdog stop. Thank you.

  2. snoozedDev commented on Oct 15, 2026

    @snoozedDev
    ContributorAuthor

    Compared on main d92a8da and on d92a8da + #6218 at 8322164, the head named in the request (cherry-picked, no conflict; libs rebuilt), plus one run on the PR's current head 628767b (refactor(shader): isolate packed storage conversion from SINT stores, on top of 8322164). Same title (PPSA04029 v02.120.000), host, build configuration and launch as in the report: Release, ANYPS5_ENABLE_SPIRV_TOOLS=ON, GCC 16.2.1, RTX 3090, NVIDIA 610.57.04, gamescope headless. Times are from launch to the title's exit, measured by the wrapper script; bare main and the first run with #6218 ran under a 540 s wrapper limit (the report's was 520 s), the later ones under 1500 s. Successful presents are not logged, so the last four runs carried APS5_TRACE_SUMMARY_EVERY=30 and the last three APS5_TRACE_DRAWS=1 (one [draw] ... ok line per completed draw). The summary writes one line per interval, with that interval's presents count. An interval starts at the first present and closes at the first present 30 s or more after it opened, so a stalled interval writes no line.

    tree run result time compute dispatches
    main cold guest storage texture format 4 cannot be used as a storage image ([videoout] presentation failed: + what()) 367 s 5,687
    main warm (1438 hits, 2 misses) same text ([gpu] driver failure: + what(), no [videoout] line in this log) 174 s 11,073
    + #6218 (8322164) cold 1 no stop within the 540 s limit; still dispatching when the wrapper stopped it 546 s 10,846
    + #6218 (8322164) warm 1 (cold 1's cache, 1438 hits, 30 misses) unsupported PA_CL_CLIP_CNTL flags is unsupported (register 0x204 = 0x00090000) 310 s 14,834
    + #6218 (8322164) cold 2 (presents counted) 807 presents, then !!! EngineWatchdog timeout! 540 s 20,455
    + #6218 (8322164) warm 2 (cold 2's cache, 1440 hits, 0 misses; presents and draws counted) 657 presents and 1,449 completed draws, then the same PA_CL_CLIP_CNTL refusal 351 s 15,152
    + #6218 (8322164) cold 3 (presents and draws counted; log lines timestamped) 714 presents and 1,550 completed draws, then the same PA_CL_CLIP_CNTL refusal at 524 s 530 s 16,469
    + #6218 (628767b) cold 4 (cold 3's cache left in place: 0 hits, 1440 misses; presents and draws counted; timestamped) 645 presents and 1,497 completed draws, then the same PA_CL_CLIP_CNTL refusal at 514 s 519 s 15,090

    Does the guest storage texture format 4 exception disappear? Yes, in every run with #6218. Shader 0x1aa4f07500 is dispatched once per run on a 256x256 format 133 surface created as a storage texture (StorageTexture address=0x1cb2b50000 256x256 mips=1 ... format=133 vk=4 in cold 1, Texture.cpp:1111; the address differs per run), followed by Texture ... 256x256 mips=1 viewed from storage image (vk=4). cannot be used as a storage image appears in none of the six logs with #6218. On bare main that dispatch is the stop in both runs.

    Does the title reach its first presentation? Yes. In cold 3, whose log lines carry seconds since launch, the swapchain is created at 15 s, the first compute dispatch and the first draw come at 186 and 187 s, and the first present at 189 s ([trace] summarizing summary_every 30 from present 0). The summary lines then count 288, 295, 8 and 123 presents in the four intervals after it, 714 in all (frame p50 94 to 227 ms; the third interval is 96 s long because one frame took 95 s). Cold 2 counts 260, 274, 25 and 248 (one 102 s frame), 807 in all; warm 2 counts 280, 260 and 117 (one 82 s frame), 657 in all. Cold 4 on 628767b has its first dispatch and draw at 174 s and its first present at 176 s, and counts 298, 223 and 124 (one 105 s frame), 645 in all. Most draws are single-instance draws of 4, 6 or 12 indices (VulkanDevice::Draw indices=6 instances=1 ... colorTarget=1). In warm 2 these are 458, 720 and 210 of the 1,449, and the rest are 42 draws of 3 indices and 18 of 60 to 13,560 indices. 615 of warm 2's draws come before the 0x1aa4f07500 dispatch and 834 after it, 811 of those to one color target.

    With the storage format accepted, the title renders and presents at about 10 frames per second before the stall (frame p50 93 to 106 ms) and at 4 to 8 after it, with one stall of 82 to 105 s per run. In the stalled interval the largest leaf phase per frame is Driver.Dispatch.materialize (2,020 ms in cold 3, 646 ms in cold 2), and an eu-stack sample of cold 3 at 520 s has the queue worker inside SPIRV-Tools optimization passes under materializeResult (from Driver::draw). In cold 3 the fourth interval closes 186 s after the first present (375 s after launch). No fifth line follows, but 401 more draws run until the refusal at 524 s.

    Replacement errors. Two, neither in code the PR touches:

    1. Both warm runs, cold 3 and cold 4 end on a draw refused for PA_CL_CLIP_CNTL (State.cpp:857/:1472, same text). ClipControlMask at :160 accepts bits 19, 24, 26 and 27, and PacketExecution.cpp:295 throws the precheck's reason, which fails the queue worker and the presenter. 0x00090000 is bit 19 (DX_CLIP_SPACE_DEF, accepted) and bit 16 (CLIP_DISABLE in AMD's gc_10_3_0_sh_mask.h). State.cpp is identical on d92a8da and both PR heads, the same check is on main 0029e62 today (State.cpp:1051/:1679, ClipControlMask unchanged at :160), and feat(agc): accept linear attribute clipping in PA_CL_CLIP_CNTL #678 left CLIP_DISABLE rejected on purpose, so this is main's next draw stop once the storage format is accepted. Tail of warm 2 ([dispatch-io] body lines and two Texture lines omitted):

      [draw] target 0x1cb4370000 mask 0xf ok
      [dispatch-io] shader 0x5912e64b2300
      [dispatch-io] shader 0x5912e64b0000
      [dispatch-io] shader 0x1aa4fd6900
      [videoout] presentation failed: unsupported PA_CL_CLIP_CNTL flags is unsupported (register 0x204 = 0x00090000)
      terminate called after throwing an instance of 'std::runtime_error'
        what():  unsupported PA_CL_CLIP_CNTL flags is unsupported (register 0x204 = 0x00090000)
      

      (Warm 1 has [gpu] driver failure: with the same text before the [videoout] line.) No issue or PR mentions 0x00090000; CLIP_DISABLE appears only in feat(agc): accept linear attribute clipping in PA_CL_CLIP_CNTL #678's list of bits it leaves rejected. I can open an issue for it in the shape of this report if useful.

    2. Cold 2 ends on the title's own watchdog 540 s after launch, with no host error. There is no present from 226 s after the first present onward (a fifth interval opened at 196 s and never wrote its line). The last log line before !!! EngineWatchdog timeout! is a dispatch ([dispatch-io] shader 0x1aa4f59500), and the title then opens /temp0/CrashInfo.json for writing. This is the intermittent cold-run stop of Cyberpunk 2077 (PPSA04029) on Linux: EngineWatchdog still trips on main d592d54e after #4321; the sceKernelBatchMap2 threads are now in the GuestAllocations registry walks #4634. It did not fire in cold 1 (cut at the limit, 546 s), in cold 3 (524 s), in cold 4 (514 s) or in bare main's cold run here. The eu-stack samples of cold 3 at 360 and 450 s each show one sceKernelBatchMap2 thread in the registry walks listed there (GuestAllocationsAcquire_nid_postfix from DoMprotect, GuestAllocationsRequireAvailable_nid_postfix from DoMapDirect).

    Tests on Linux (ANYPS5_ENABLE_SPIRV_TOOLS=ON, RTX 3090): ctest -R 'packed16|agc_.*(texture|image|storage|unorm|format)' passes 81 of 81 on d92a8da + 8322164 and on d92a8da + 628767b, including agc_driver_image_packed16_storage_133, _134 and _136.

    The wrapper's timeout cut only cold 1, at its 540 s limit; every other run ended before its limit, on the title's own exit. Seen, not stops, in every run on both trees: 79 s_swappc_b64 deferrals, 4 unsupported registered shader type 8, one [gpu] always-pass depth/stencil state is rendered without a depth target (DB_DEPTH_CONTROL=0x00000062), one [gpu] DCC keys of mipmapped color targets are ignored, 8 storage image ...: guest memory changed while GPU results were pending and 4 memory no longer registered.

    AI-assisted: yes (Claude Code, Claude Fable 5.1), operating under my supervision; I am accountable for this comment and will respond to review.

  3. harry-z-kang commented on Oct 15, 2026

    @harry-z-kang
    Contributor

    Thank you, @snoozedDev. Your comparison confirms that #6218 removes the original format-133 storage failure on both tested heads and reaches rendering/presentation. I've credited your Linux, SPIRV-Tools-enabled and title results in the PR, and updated its Unblocks entry.

    Yes, please open a separate issue for the CLIP_DISABLE refusal, including register 0x204 = 0x00090000, the relevant log tail, commit IDs and the #678 reference. A current search found only this issue mentioning that stop. The intermittent watchdog remains tracked in #4634.

    The PR is rebased onto current main; its packed-storage implementation is unchanged from 628767b52. The additional change consolidates its documentation. The later clip-control failure belongs in a separate fix.

  4. coltken95 commented on Oct 15, 2026

    @coltken95

    @snoozedDev #6572 accepts PA_CL_CLIP_CNTL CLIP_DISABLE as depth clamp. Its test fails on main with the same register 0x204 = 0x00090000 refusal you hit here, and passes with the PR on Linux (lavapipe). Might be worth a PPSA04029 run with it.

    AI-assisted: yes (Claude Code)

  5. snoozedDev commented on Oct 16, 2026

    @snoozedDev
    ContributorAuthor

    Opened #6806 for the PA_CL_CLIP_CNTL refusal (register 0x204 = 0x00090000), with the log tail, the commit IDs and the #678 reference.

    As coltken95 suggested, the title was also run with #6572 (3e28c99) on top of #6218 (1057f47) on main 5d9dcc4. On that tree the #4634 watchdog came before the refusal's point, so #6321 (a52b723) was added. With it, main + #6218 + #6321 still refuses the draw at 282 s. With #6572 as well, two runs went to the 1500 s limit with no 0x204 line and no throw, and one cold run stopped on the #4634 watchdog before its first dispatch. The runs are in #6806.

    AI-assisted: yes (Claude Code, Claude Fable 5.1 and Claude Opus 5.5), operating under my supervision; I am accountable for this comment and will respond to review.

  6. klosixgaming-arch commented on Oct 19, 2026

    @klosixgaming-arch
    Contributor

    Tested on Windows 11, RTX 5090 (driver 572.16):
    With packed 16-bit storage fallback (format 4 / \VK_FORMAT_R5G6B5_UNORM_PACK16\ mapped to \VK_FORMAT_R16_UINT), Cyberpunk 2077 (PPSA03974) completely bypasses the compute shader \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions