Linux AMD (RADV): grass and small plants flicker in and out; pools over udmabuf's 64 MB limit are not imported #2239
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot#2239
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hookshot version
v2.1.0 (source e561602e)
What kind of problem
Graphics (missing, black or wrong-coloured things, lighting, flicker)
What happened
Grass and small ground plants flicker in and out a few times a second, all at once. Fine on NVIDIA.
The log shows pools over 64 MB failing to import, and the foliage culling's storage buffers unbound:
Work-around that fixed it here (game closed, then restart):
Likely cause: in gpu/vk/vk_main.cpp,
dev.sparse_buffersonly checks the replay's queue family forVK_QUEUE_SPARSE_BINDING_BIT. RADV keeps sparse binding on a queue family of its own, so the sparse dma-buf path inimport_dma_buf_piecesis never used, and the host-pointer fallback cannot import the memfd window's shared pages. Suggested fix: when the replay's family has no sparse bit, create a queue from a family that does and callvkQueueBindSparseon it; and when a pool still cannot be imported, log the work-around above.Related: the reporter of #1903 (Radeon 780M, RADV) had already raised size_limit_mb to 16384 by hand, which is why they did not see this.
RX_VK_BATCH=0,RX_VK_WAIT_GPU=1andRX_VK_MESH_OPT=1made no difference.Full log (and patch, if present): https://gist.github.com/davkdavk/6b205d42ee5cc04397e15448306f65c9
A proposed patch is in the gist. It was written with Claude and is NOT built or tested; it needs a run on RADV with the default 64 MB limit.
Where in the game
Kokiri Forest, standing still or walking.
How often
Every time
Graphics card and driver version
AMD Radeon RX 7800 XT, RADV NAVI32, Mesa 25.0.7
CPU, RAM and operating system
32 GB RAM, Debian 13
Changes from the defaults
hookshot_env.txt:RX_VK_WAIT_GPU=1(no effect on this either way)Other software hooked into the game
No, nothing hooked in
I can help turn the sparse-buffer queue proposal into a built and tested contribution. Are you already preparing a PR? If not, is it OK to reuse your patch under the project's license with attribution, then add executed queue-selection/lifetime tests and the platform builds?
I'd keep this to buffer imports: preserve the existing sparse-image policy, handle replay/present/sparse queue-family aliases without duplicate device requests, and verify queue locking plus the bind-completion fence. I can test Windows/NVIDIA and authored Linux fixtures; the default-limit RADV gameplay case would still need your machine. Would you be available to check that candidate?
The sparse-queue patch fixes it on an RX 6800 XT (RADV NAVI21), with udmabuf still at its 64 MB default
I took your hookshot-radv-sparse-queue-plant-flicker.patch to a machine with the same symptom and
ran both sides of it on the same GPU, same spot (Kokiri Forest, standing still), same switches. The
only difference between the two runs is the patch.
How the two runs differ. Both are
mainv2.0.11-871-g9447e1d withRX_VK_FORCE_MESH_FALLBACK=1(needed on this card for #2245) and
RX_VK_CHECKPOINTS=1. The first build has no patch; the secondhas yours. udmabuf's
size_limit_mbstayed at 64 MB in both — no sysctl change — so the limitthe report points at was in force for both.
Without the patch (log attached as hookshot_log-before-flicker-extracto.txt, cut from a 989 MB
container dump so only the symptom's lines travel):
Eight distinct pools failed to import over that session, and twelve distinct storage buffers were
reported unbound; two of each are above. On screen: grass and small ground plants flickering in and
out a few times a second, exactly as reported.
With the patch (log attached as hookshot_log-after.txt, the whole session):
The 40 are all the same line,
program da7a7ab28b8e73d9 stage 1 c5+0 addr 0x4180000000000200 size 0x20, and it also shows up in runs without the patch — a separate single case, not the pools. Thepools over the limit now go in as several dma-bufs, and the flicker is gone at the same spot.
Nothing else moved. No device lost and no GPU reset in the session; 72 frame-rate reports. In a
dense Kokiri Forest scene it held 37–43 fps with GPU time at 9.6 ms a frame, so the patch costs
nothing measurable here.
On the patch itself.
tests/test_sparse_queue.pypasses, and so does the rest of therepository's Python suite. I built inside the image that runs the game (glibc 2.41) so the binary
matches its container, and the warning you added for a pool that still cannot be imported never
fires in this run, as expected.
RX_VK_SPARSE_QUEUE=0reproduces the old behaviour exactly, which ishow the two runs were made comparable.
This also answers @Arkex-ai above: the patch is built, run and measured on RADV now, so a PR can
carry it with the evidence instead of a proposal.
Before
https://github.com/user-attachments/assets/6bc40322-9738-4e2d-85a9-9fb112766264
After
https://github.com/user-attachments/assets/d831a142-a528-4762-851f-d7e1cb738668
Files attached
— the lines quoted above, from the run without the patch (cut out of a 989 MB container dump, so
only the symptom travels).
— the whole session on the patched build (~5,800 lines).
RX_VK_SPARSE_QUEUE=0.Thanks for the report. Reports of the same problem are now collected in #1000, which lists this one with your details and links back here, so one fix closes them together and the open list stays readable. Follow #1000 for the fix, and add new details there (or here). If this turns out to be a separate problem it will be reopened.
A temporary workaround on Linux is running the following before launching
Hookshot.
echo 2048 | sudo tee /sys/module/udmabuf/parameters/size_limit_mb
On Thu, Nov 12, 2026 at 7:57 AM NotRexed @.***> wrote:
@NotRexed flagging that this still reproduces on current main, in case it's useful for tracking.
On
6ff87f59(RX 6800 XT, RADV NAVI21, Mesa 25.0.7, kernel 7.0.0-42):pool ... not imported/storage buffer NOT boundlines, grass flickering;sparse buffers are bound on a queue of family 4,0 not imported, no flicker;
size_limit_mbleft at 64 MB in both runs.The patch no longer applies as posted (queue creation changed in #2325), so I rebased it onto
6ff87f59: 5 files, 119 lines,tests/test_sparse_queue.pypasses. Credit to @davkdavk for the original.hookshot-sparse-queue-radv.patch