Repository navigation
fix(agc): check GPU-side indirect dispatch group counts against the device limit - #6360
hypermoist wants to merge 1 commit into
Conversation
…evice limit A DISPATCH_INDIRECT read on the GPU took its group counts unchecked. A count buffer that a skipped producer never wrote (PPSA08427: 0xffffffff left by skipped depth-plane passes) launched up to 2^32 groups and kept the GPU busy until the title hung. The CPU path already refuses counts above maxComputeWorkGroupCount. - Recorder::RecordDispatchArguments copies the three counts from the import into a 12-byte indirect buffer with a one-thread kernel (DispatchArguments.comp), all three 0 when one exceeds the device limit, as RecordMeshArguments does for mesh indirect records. - VulkanDevice records the dispatch from that buffer; without the kernel the import is read directly, as before. - agc_driver_indirect_dispatch_limit: 0xffffffff groups run nothing, one group still runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8tinbP1MUpUaDsbNWnGnu
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Intel and AMD Windows data. On an Intel UHD 770 this fixes the device loss. On an AMD RX 9070 XT the new test fails with and without it, because that device allows 0xffffffff groups in X. Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, Reported
On the RX 9070 XT, Full CTest ( AI-assisted: yes (Claude Code) |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks, the approach (clamping the GPU-side counts through a one-thread kernel, same as the mesh arguments guard) looks right. Two things before this can merge:
core/libs/prx/libSceAgcDriver/tests/execution/IndirectDispatchLimit.cpp:65: the over-limit row is a fixed{0xffffffff, 1, 1}. On devices whose X limit is0xffffffff(RX 9070 XT reports[4294967295, 65535, 65535]) that count is valid, so the guard correctly lets it through and the test fails with and without the change, as @savvaniss measured. Derive the over-limit count from the device limits (e.g.maxComputeWorkGroupCount[1] + 1in Y, or X + 1 when X < 0xffffffff).- The branch conflicts with
maininExecution/src/VulkanDevice.cpp(recordDispatch) andlibSceAgcDriver/CMakeLists.txt. TheVulkanDevice.cpphunk is not a mechanical conflict, so please rebase and re-check that the indirect buffer/offset still feedvkCmdDispatchIndirectcorrectly.
Not covered by what we can run: the hang on the title after the rebase.
What
A
DISPATCH_INDIRECTwhose arguments stay on the GPU (vkCmdDispatchIndirecton the imported argument buffer) took its group counts unchecked. The CPU path already refuses counts abovemaxComputeWorkGroupCount, but the GPU path passed garbage straight to the device: a count buffer that a skipped producer never wrote (PPSA08427 leaves0xffffffffthere when its depth-plane passes are skipped) launched up to 2^32 groups and kept the GPU busy until the title hung.Recorder::RecordDispatchArgumentscopies the three counts from the import into a 12-byte indirect buffer with a one-thread kernel (Graphics/shaders/DispatchArguments.comp), writing all three as 0 when one exceeds the device limit, the same wayRecordMeshArgumentsalready guards mesh indirect records.VulkanDevice::recordDispatchdispatches from that buffer. If the kernel cannot be created, the import is read directly, as before, and stderr says so once.agc_driver_indirect_dispatch_limit:0xffffffffgroups run no thread; one group still runs every thread.Tested
Linux (CachyOS, GCC Release, NVIDIA GeForce RTX 3060): the new test passes; the AGC group of
ctestpasses exceptagc_driver_store_over_untracked, which fails on unmodifiedmaintoo.tools/check_conventions.pypasses;tools/pr_overlap.py --branchreports no line overlap. The hang was found running PPSA08427 on my local branch, where this change removed it; the game was not rerun on this exact rebase.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
https://claude.ai/code/session_01Q8tinbP1MUpUaDsbNWnGnu