AMD/RADV (Linux): ~10 fps because each vkQueueSubmit2 costs ~13 ms – batching the replay's submits gives 30-50 fps (patch attached) #413
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#413
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?
Builder version
foliage-linux-updater release (commit
170ce53)How you built
Hookshot Builder app (Windows)
Game files given to it
A .nup
The error
Visual Studio or Build Tools version, and Windows SDK version
No response
Operating system and free space on the output drive
Bazzite (Linux), RADV / Mesa 26.2.6 933.7 Free
Before you send it
amd-batched-submits.patch.txt
hookshot_amd_1_before_default.txt
hookshot_amd_2_before_chunk4.txt
hookshot_amd_3_after_batched.txt
I have found similar performance issues on cachy os with my sapphire pure 9070. I average somewhere around 13-18 FPS in Kokiri Forrest when not looking at a wall. I built via the app image instead of windows. I have noticed occasionally getting one frame of solid green but im not sure if that is related to the performance issues.
Thank you, this is excellent work and exactly the kind of report that makes a fix easy. The three commits are on main now (
2d8b180,b1b7b6a,afac079, authorship kept), and batching is switched on by default when the driver is RADV (aa1a4ce); RX_VK_BATCH=0/1 still overrides. I checked the other side here: on an RTX 4060 Ti forcing it on costs fps (25 -> 16), so it stays off on NVIDIA. It ships in the next release, which is close; if you can, please confirm the numbers with it then.Thank you! One more data point for the RADV default: RX_VK_BATCH_POLL_US mattered as much as batching itself here.
With RX_VK_BATCH=1 alone, get_replayed() polls flushed 8-16 times a frame (~27 fps at ~1300 draws, queue submit ~25 ms);
with RX_VK_BATCH_POLL_US=2000 it dropped to ~1-2 flushes a frame (~40 fps, queue submit ~5-7 ms) - see the "by reason"
lines in 3_after_batched. It may be worth defaulting it to ~2000 with RADV too. RX_VK_IMPORT_CHUNK_MB=4 also helped
slightly (10 -> 11.5 fps before batching). I'll confirm the numbers with the next release.
(Written with help from Claude, Anthropic's AI assistant.)
The new release is out: https://github.com/NotRexed/Hookshot/releases/tag/no-visual-studio. Please rebuild with it and tell me here whether it's fixed for you (attach hookshot_log.txt if not).
Confirmed with the no-visual-studio release on the GPD WIN 5 (Radeon 8060S, RADV, Bazzite):
"batched submits on (RX_VK_BATCH, on with RADV)", ~1 submit a frame, queue submit ~4 ms a frame.
Same route as before: ~470 draws ~51 fps, ~800 draws 45-48, ~1600 draws 38-40, ~2800 draws ~35
(was ~10 fps everywhere before the fix; the new release's CPU work helps most in the heavy scenes).
One thing that matters on RADV: with the default RX_VK_BATCH_POLL_US=0, the progress polls flushed
~750 times per 120 presents ("by reason: poll 750") and fps dropped noticeably; with
RX_VK_BATCH_POLL_US=2000 it is "poll 0", one flush per present. It may be worth defaulting it to
~2000 with RADV as well. Also used RX_VK_IMPORT_CHUNK_MB=4.
(Written with help from Claude, Anthropic's AI assistant.)
Profile of the remaining limit on RADV (no-visual-studio release, Radeon 8060S, Bazzite), in case it helps
with the next step. With batching, Presentation Thread is the busiest thread (HOS_PROFILE: ~73-84% of a core;
sead::MainThread ~20%). HOS_SAMPLE on it during gameplay (summary + full samples attached, names from the
release's hookshot_vk.so):
Idea, untested: the present's submit is a second driver submission every frame on RADV; folding the held
batch into it (or the present's command buffer into the batch) might save part of that ~14%.
Current fps on the same route: ~35 (heavy) to ~51 (light), with RX_VK_BATCH_POLL_US=2000.
(Profile analysis written with help from Claude, Anthropic's AI assistant.)
hookshot_presentation_samples_radv.txt.gz
presentation_thread_profile_summary.txt
On the new release I experience a performance bump to about 20-23 FPS under the same circumstances but now have a lot of things flickering fairly frequently such as the grass and other parts of the environment.
hookshot_log.txt
Follow up: The fps seems to have dipped back down to the initial levels after I beat the first dungeon, not sure why this happened.
The replay's submits were batched (PRs merged since), and release faster-fps adds per-queue fences (about 33 to 47 fps here). Please update and open a new issue with your fps and log if RADV is still slow.