agc: a dispatch wider than maxComputeWorkGroupCount aborts instead of being split (Ghost of Yōtei PPSA26344, 129199x1x1 on the software device) #3212
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?
Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-11T01:32:15Z.
What
On a device whose
maxComputeWorkGroupCountis the value the Vulkan spec guarantees as aminimum —
(65535,65535,65535), which is exactly what the software device reports, per thespec's Limits chapter — a legitimate compute dispatch aborts the whole process.
The driver throws; the presentation loop catches it, prints that line, and then calls
std::terminate()from inside its own handler — so the reported error still aborts the process(SIGABRT, core dumped).
Title that hits it: Ghost of Yōtei (PPSA26344), in the presentation path, on the software
device. The requested count is
129199x1x1— just under twice the limit, so two chunksalong X would cover it.
Why this is a driver gap and not a title bug
Vulkan requires the caller to stay inside
maxComputeWorkGroupCount; nothing splits a dispatchautomatically. Desktop drivers report large limits (typically 2³¹−1 per dimension), so on the
3080 Ti the identical dispatch is legal and the title carries on. That is why the title "aborts at
presentation" only on the software device — the failure is a property of the limit, not of the
shader or of the title's packet.
The driver already requires Vulkan 1.1 or newer (
VulkanDevice.cpp:746checksproperties.apiVersion < VK_API_VERSION_1_1), sovkCmdDispatchBaseis core-available andthe split needs no feature bit and no
VK_KHR_device_groupfallback.Where it throws
All three sites check the device limit and throw, and none of them split:
(Line numbers are from
3194b802, the tree these runs were made on, before the diagnosticschange described at the end; that change adds a few lines at each site, moving them to 3462 / 3616
/ 3905.)
This is not the indirect look-ahead of #2990
#2990 (merged,
30ab2f6e) fixed an indirect dispatch reading its arguments before the dispatchthat writes them had run, and the counts there were garbage
(
16926492x1116079131x3241227624).129199is a plausible count for a surface-sized dispatch,so this is a different cause — a real dispatch wider than a low device limit. The tree I measured
predates
30ab2f6e, but the count rules that class out on its own. (#2365 mentions thismessage in a comment, and it is that same indirect class.)
Measured on
(
~/.local/opt/lavapipe/lvp_icd_abs.json) — the Linux CI device.maxComputeWorkGroupCount = {65535, 65535, 65535}(vulkaninfo).systemd-run --user --scope -p MemoryHigh=18G -p MemoryMax=22G -p MemorySwapMax=8G -- ./app.elfwith
APS5_TEXTURE_CACHE_MIB=512(caches pinned so memory growth cannot reach the cap first;the process peaked at 10.08 GiB and aborted on the dispatch, not on memory).
(#1940) — i.e. this is the next wall after #1920's, not a regression of it.
Proposed fix
Split an oversized dispatch along one dimension into chunks within the device limit, using
vkCmdDispatchBasewith the correspondingbaseGroupX/Y/Z. The specification makes this exactlyequivalent rather than merely equivalent in practice:
vkCmdDispatchisvkCmdDispatchBase(0,0,0,groupCountX,groupCountY,groupCountZ), and a dispatch assemblesgroupCount*local workgroups withWorkgroupIdranging from[baseGroup*, baseGroup* + groupCount*)in each component (spec, Dispatching Commands). So theshader sees the same global IDs it would have seen, and two chunks of 65535 cover
129199x1x1on adevice sitting at the minimum limit.
vkCmdDispatchBaseis core in Vulkan 1.1 (Provided by VK_VERSION_1_1), and this driveralready requires at least 1.1, so no feature bit and no
VK_KHR_device_groupfallback is needed.Clamping and documenting the limit instead is the cheaper option, but it silently drops the tail of
the work.
Small diagnostics change, offered separately
The three throws do not print the requested count or the device limit, even though
groupsTextis already computed at each site — so this arrives as an unidentifiable abort. I have a local
patch that adds both (comment-free, no
TechnicalDebtentry needed,tools/check_conventions.pyclean) and it is what made this issue possible: the first run of the title on the software device
reported only "workgroup count exceeds device limits" with no numbers. Happy to submit it as its
own PR when intake reopens, or here if preferred.
Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-11T06:34:18Z.
Fix branch ready:
fdfawef324:fix/agc-split-wide-dispatches, one commit onmain. I can't open it as a PR because of the intake check; anyone eligible is welcome to carry it as is.maxComputeWorkGroupCountis recorded asvkCmdDispatchBasechunks within the limits, as proposed above. Guest compute pipelines are created withVK_PIPELINE_CREATE_DISPATCH_BASE_BIT. Both the direct path and the recipe path record throughrecordDispatch, and a CPU-resolved indirect dispatch is split the same way.NumWorkgroups, which differs per chunk. This is recorded in TechnicalDebt together with GPU-read indirect counts, which are not checked.2147483647x65535x65535, so a dispatch taller than 65535 aborts the same way there.agc_driver_dispatch_split: a unit check of the chunking, plus an end-to-end 1x65537x1 dispatch throughSubmitwhere each group stores its Y id. Onmainit fails withworkgroup count 1x65537x1 exceeds device limits 2147483647x65535x65535; with the branch every group lands. It runs in 1.4 s.Tested on Windows Server 2025, WinLibs GCC 15.2.0 r7, Release, RTX 3060. Full
ctestpasses, except the BDA tests that hang on NVIDIA (#3291). Not run on lavapipe.AI-assisted: yes.