Skip to content

kyty: GPU hang (TDR) in compute shader 0x05dc60d7ff9e4fce during PPSA38500 scene load #314

Backlog

Description

@Ryongen
  • [kyty] the GPU has not reached tick N in 10 s ... compute shaders of the unfinished tick N, last first: 0x05dc60d7ff9e4fce, then Not implemented (result != vk::Result::eSuccess) masterSemaphore.cpp:111. Windows: nvlddmkm 153 + Display 4101 (TDR).
  • Same shader last in the unfinished tick in 4 of ~45 runs (runs 6, 15 on older trees, 40, 42 on Brainrot dbb4a66), at the first 3D scene load, KYTY_RT_EMULATION=0 and default alike.
  • KYTY_SKIP_SHADERS=0x05dc60d7ff9e4fce: no hang in the following runs.
  • Not checked yet: whether it is a BVH walk (kyty_rt_probe), loop bound, or a bad buffer address.
  • RTX 2070 SUPER 617.42, Windows 10.

Activity

  1. simnJS commented on Nov 26, 2026

    @simnJS
    Owner

    Thanks. We see the same hang on Linux as well, on the same title: it is intermittent, it happens at the first 3D scene load or a little later, and this shader is the last one in the unfinished tick every time. So far:

    • The shader has three loops: a walk over a leaf's primitive list that only ends on an entry whose second dword is negative (an out-of-bounds read returns 0, so a missing terminator never ends it), a waterfall loop over v_readfirstlane on a per-lane descriptor read from a 0x78-byte table, and a climb up the tree through buffer_atomic_sub on the parents' counters.
    • We have ruled out the translation of readfirstlane and of ds_bpermute, and the ignored CS_PARTIAL_FLUSH. Sessions with the same SPIR-V and no hang ran the BVH build and this shader dozens of times to completion. So the hang depends on the data it gets, most likely what the BVH build dispatched just before it writes, not on how it is translated.
    • In the sessions that hung, the compute loop guard never reported a loop it had to leave. The loops are nested, so a guard on each loop alone can still run longer than the 10 s watchdog.

    About KYTY_SKIP_SHADERS: with a hang in about 1 run in 10, a few clean runs do not show much yet. In one of our runs with this hash in the list, the unfinished tick still named it last, so please check that the log says the shader was refused. If you can run 20 or more sessions with the skip, the rate will tell us more.

    Useful from your side, if you have time:

    • the dispatch just before it in the unfinished tick, and whether a [HACK] compute loop left by the loop guard line appears;
    • the Windows event time of the TDR against the Kyty log, to see whether the GPU stopped inside this dispatch or the driver reset it during a later one.

    If you want to dig into the data side (which loop runs away, and on what input), say so and we will share our disassembly notes for these shaders.

  2. added
    bug
    area: ray-tracing
    hard
    needs: game
    on Nov 26, 2026
  3. adam25136 commented on Nov 26, 2026

    @adam25136

    @simnJS, the same hang here on an RTX 5080 (Windows 10 22H2), with what you asked for.

    AnyKyty 688dbf145d8, plus a local relinker change carried since 441382ef20b to convert the title on Windows (the fs-segment path in pipeline/Conversion.cpp and guest/GuestModuleBuilder.cpp also taken for TargetSystem::Windows), a local debug print and a local skip switch, both described below
    GPU GeForce RTX 5080 16 GB, driver 621.14, Vulkan 1.4.357, native ray tracing on (the default)
    Rate Without the skip: 4 GPU hangs in 10 runs of up to 5 min (3 of the 10 runs had the GetProgram-only check below, which never printed), about 79, 83, 85 and 90 s after the game started; 1 more run ended earlier, at 75 s, on a resource tracking stop

    Dispatches before the hang. Here the [kyty] the GPU has not reached tick ... line never printed: Windows reset the driver first (event 4101). A local print of the last 64 entries of MasterSemaphore's m_work ring, when waitSemaphores or vkQueueSubmit returns ErrorDeviceLost, gives the same order in both hangs it caught:

    hang 1, ErrorDeviceLost at tick 5794          hang 2, ErrorDeviceLost at tick 6462
    t5794       1 x 0x817d9d2f8e73938d (newest)   t6462       1 x 0x817d9d2f8e73938d (newest)
    t5794       9 x 0x05dc60d7ff9e4fce            t6462       2 x 0x05dc60d7ff9e4fce
    t5789-5793  1 to 3 x 0x05dc60d7ff9e4fce       t6454-6461  1 to 4 x 0x05dc60d7ff9e4fce
    t5770-5788  1 x 0xd24748ebb1d46694 per tick   t6433-6453  1 x 0xd24748ebb1d46694 per tick
    t5769      19 x 0xed687a796ba2e63f            t6432      21 x 0xed687a796ba2e63f (oldest kept)
    t5768       6 x 0xc7eaa99bab022ae0 (oldest kept)
    

    Both came from MasterSemaphore::Wait, for tick 5794 and tick 6462. After the loss the counter reads UINT64_MAX, so this shows what was submitted, not which dispatch the GPU was in when it stopped. Windows logged the reset in the same second as the end of the err log, or one second later. That end is the ErrorDeviceLost report and crash dump, so the timing can't separate this dispatch from a later one either.

    Loop guard. 688dbf145d8 has no compute loop guard, so these runs can't show one. There is no [RT] cs line in the four hang logs.

    KYTY_SKIP_SHADERS=0x05dc60d7ff9e4fce. AnyKyty has no such switch, so I added a local one. With a check only in GetProgram, it never printed in its 3 runs. A second check, right after the program is known in each compute dispatch path of renderCompute.cpp (the two Dispatch paths and DispatchIndirectThreads), returns as for a missing program. With both checks:

    • 10 runs of 3 min, no GPU hang.
    • The shader was refused in 5 of them, at least 16 to at least 256 times (the counter prints at 1, 2, 3 and then powers of two). In runs 2, 5 and 8 only one of the two checks printed. All 5 ran to the 3 min limit, and 2 more never asked for it and also reached the limit.
    • The other 3 ended at 81 to 89 s without a GPU reset, inside the window where the hangs came: on the resource tracking stop of 0x40fce521f47c54f9, a guest int 0x41 at app.exe+0x8bf562b, and invalid image view: image_format=97 view_format=139 type=1 aspect=0x1 mip=3+6 layer=0+1 usage=0x0 image_levels=1 image_layers=1.

    So 0 hangs in the 7 runs with the skip that got past 90 s, against 4 hangs in the 9 runs on the same commit without it. The skip and no-skip runs came in blocks, not alternated, so this is only a hint. If a GetProgram-only check is what your runs used, that may be why the unfinished tick still named the shader in one of them. I can run the 20+ sessions, alternated, or test a branch.

    AI-assisted: yes. Claude Code wrote the local debug print and skip switch, ran the builds and the runs, and drafted this comment; a separate review agent checked it. The numbers are from the runs on this machine.

  4. SleglJan commented on Nov 26, 2026

    @SleglJan
    Contributor

    A GPU hang in the same phase on Linux and RADV, likely the same shader. All 3 runs here that got past the first-boot screens hung.

    • Build: local 24873d2752. That is AnyKyty 90a48455d2, plus the fix(kyty): apply a metadata clear issued before its depth target exists #289 v7 commits (runtime as in f41e7d80e3), plus one local commit with CPU-only texture-cache counters.
    • Setup: PPSA38500 01.002.001. Linux, RX 9070 XT (RDNA4), RADV GFX1201, Mesa 26.2.6.
    • Runs (first-boot screens played by hand):
      1. Empty caches. While it translated shaders it ran under 1 FPS for minutes. It hung in the first cutscene, about 3 minutes after the privacy policy.
      2. Warm caches. It hung on the loading screen after the privacy policy, 14-20 s after that screen first showed.
      3. Warm caches with RADV_DEBUG=hang. It hung at the same point, 20-26 s after the privacy policy first showed.
    • Each run:
      • The kernel logged ring gfx_0.0.0 timeout and the ring reset succeeded.
      • Runs 1 and 2 ended with vkQueueSubmit failed: ErrorDeviceLost. RADV printed "This context is guilty of a hard recovery" in run 1 and "This context is innocent" in run 2. Run 3 ended with RADV's hang report.
      • Kyty's "the GPU has not reached tick" line did not print in any of them, as adam25136 saw on Windows.
      • This build has no compute loop guard, so it printed no guard line either.
    • The RADV_DEBUG=hang report (syncshaders,hang):
      • vm_fault.log is empty.
      • A direct compute dispatch (vkCmdDispatchBase, 1x1x1 groups) completed: the trace point after it was reached.
      • Then come a barrier, a push descriptor set, a barrier, a pipeline bind and vkCmdDispatchIndirect. The last trace point the CP reached sits right before that dispatch's packets. Those are three one-dword COPY_DATA from consecutive dwords, SET_BASE and DISPATCH_INDIRECT (compute). The next trace point is not reached, so that indirect dispatch never finished. The next command would have been a vkCmdCopyBuffer.
      • The bound compute pipeline, the only one in the report, has a 64x1x1 workgroup and 1 KiB of LDS. Its code uses v_readfirstlane, ds_bpermute and buffer_atomic_sub, as in your description. I haven't traced its loops. The report carries no Kyty shader ID, so 0x05dc60d7ff9e4fce is likely but not shown.

    If a run with a particular switch or log would help, say which: here it has hung each time it reached this phase.

    AI-assisted: yes (Claude Code)

  5. github-actions commented on Nov 26, 2026

    @github-actions

    The RADV trace narrows the hang to an indirect dispatch; the Windows submission log alone can't identify which dispatch stalled. Could you share the three workgroup counts (X, Y, Z) for that RADV dispatch, if the capture has them? If you have the counts for the same dispatch in a clean run, that comparison would help distinguish an unexpectedly large dispatch from a stall inside the shader.

  6. SleglJan commented on Nov 26, 2026

    @SleglJan
    Contributor

    The RADV capture has no counts, so these come from 2 new runs. Same setup as my comment above, with warm caches, a saved profile past the first-boot screens, and a script pressing Cross every 4 s. The build is AnyKyty 90a48455d2 with one local diagnostic switch.

    • The switch: before each indirect dispatch of 0x05dc60d7ff9e4fce, it records a barrier after all earlier commands on that queue, then a copy of the 12 bytes that vkCmdDispatchIndirect reads into a host-visible buffer. A CPU thread prints each copy once the GPU has written it.
    • Both runs:
      • 14 copies printed, with the same counts in the same order. X was 6, 10, 1, 12, 17, 14, 2, 2, 3, 1, 3, 18, 9, 25, and Y and Z were 1 in all 14.
      • The last line was CI: feat/webrtc-logmessage-safety-flag #14 (25, 1, 1). The kernel logged ring gfx_0.0.0 timeout 46 and 44 s after the start.
      • RADV printed "This context is innocent" in one run and "This context is guilty of a hard recovery" in the other.
    • What that shows: on that queue, all work recorded before dispatch CI: feat/webrtc-logmessage-safety-flag #14 had finished. The barrier before each of these dispatches did not stop the hang.
    • No clean run to compare: every run here that got this far with the shader enabled hung, 5 of 5 (the 3 above and these 2, on two local builds of 90a48455d2).
    • With a local switch that drops this shader's dispatches (bindings and barriers stay):

    AI-assisted: yes (Claude Code)

  7. github-actions commented on Nov 26, 2026

    @github-actions

    Thanks, this narrows it down. The (25, 1, 1) count makes an oversized dispatch unlikely, and the 17 confirmed skips are good evidence that this dispatch is involved in the early hang. The later hangs are still unclassified.

    The next useful check is which loop is active when dispatch #14 stalls. Could you try recording a loop ID and iteration count in a diagnostic buffer at a high iteration threshold, so it can catch excessive work across nested loops even if no individual loop guard fires?

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

    area: ray-tracingbughardneeds: game

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions