Repository navigation
Add RX_VK_SKIP_CODE to avoid the Steam Deck GPU hang - #1165
Conversation
… hang (issue 817) On the Steam Deck (RADV VANGOGH) the GPU runs for seconds in the task/mesh programs that share the task shader 2c56dc1006942f74 (a nested loop over a 2D grid, a culling pass) until the kernel resets the ring at 10 s. About 30 programs in Kokiri Forest and the Great Deku Tree use it. RX_VK_SKIP_CODE=<code key prefix,...> leaves out the draws of every program with a stage of that native code, decided once a program (RX_VK_SKIP_PROG names whole programs only). Off unless set; the readme gives the Deck line. The match is in gpu/vk/skip_code.h, checked game-free by tests/test_skip_code.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NotRexed#1165) The skipped programs are task + mesh programs, so their geometry goes with them: on the Steam Deck key models were seen missing in the Great Deku Tree with RX_VK_SKIP_CODE=2c56dc1006942f74 set. The readme row, the switch note and the code comment said nothing was missing; they now call it a workaround that hides those models. Still opt-in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review. Two corrections first, then your points. What the skipped programs draw: visible models. With Test spots: what I called a Kokiri Forest cave is an early room inside the Great Deku Tree (its save's caption says so). Both v2.0.7 spots were in the Deku Tree. The lock: agreed, while it's set every draw serializes on that mutex. A cached per-program result (an atomic tri-state on the |
Edited after review: the switch hides the models these programs draw (see my comment below), and both v2.0.7 test spots were inside the Great Deku Tree.
What
A new renderer switch,
RX_VK_SKIP_CODE=<code key prefix,...>, leaves out the draws of every program that has a stage whose native code key starts with one of the prefixes. It is decided once per program (memoized by program key) and costs nothing while unset.RX_VK_SKIP_PROGalready leaves out whole programs; this one targets a stage that many programs share.gpu/vk/vk_draw.cpp: the switch, right afterRX_VK_SKIP_PROG. It logs the first 32 programs it leaves out, with their code keys.gpu/vk/skip_code.h: the prefix match (comma-separated, either case, only at the start of a stage's key).tests/test_skip_code.py+.cpp: a game-free check of the match (picked up bytests/run_all.py).readme.md: a troubleshooting row for the Deck, and the switch under Switches for testing.Why
On the Steam Deck (RADV VANGOGH) the GPU hangs in Kokiri Forest and the Great Deku Tree:
ring gfx_0.0.0 timeout, then a GPU reset (#817, tracked in #1000). Buffer markers read while the GPU was still stuck showed that every stalled draw belongs to a task + mesh program sharing one task shader, code2c56dc1006942f74: two nested loops over a 2D grid (a culling pass), used by about 30 programs. On RDNA 2 some of these draws run for seconds (one took 9 s and then finished); past 10 s the kernel resets the ring.RX_VK_MESH_OPT=1does not change it.RX_VK_NO_MESH=1avoids it, but doors and foliage go missing (#1000).RX_VK_SKIP_CODE=2c56dc1006942f74leaves out only those programs, and with them the geometry they draw: key models go missing while it is set. Why that shader runs so long on RDNA 2 is still open; this is an opt-in workaround to get past the hang, not a fix.Tested
Steam Deck OLED, SteamOS 3.9.5, RADV VANGOGH (Mesa 26.2), Game Mode, 720p handheld, with the same change applied to v2.0.4 and to v2.0.7 (
RX_VK_LOW_SPEC=1,HOS_HANDHELD=1,RX_VK_MESH_OPT=1, the memory caps from #817):python -I -B tests/run_all.py skip_codepasses. I have not run main itself on the Deck.The
RX_VK_CHECKPOINTSwatchdog that found the shader (it reads the AMD buffer markers while the GPU is still stuck, because the reset kills the process beforedevice lostcan read them) is a separate change; I can send it as its own PR.Refs #817, #1000
🤖 Generated with Claude Code