Repository navigation
fix(agc): keep RADV's descriptor pool overrun inside the pool's pages - #1065
Merged
adriadam10 merged 1 commit intoOct 8, 2026
Merged
Conversation
RADV (Mesa 26.0 and later) initialises a FREE_DESCRIPTOR_SET pool's allocator with bo_size + RADV_POOL_HEAP_OFFSET as its size, so a set can be placed up to 32 bytes past the pool's buffer. The chain pools are 0x26000 bytes, a page multiple, so a set at the end of a full pool has its last descriptors on an unmapped page: the CPU descriptor write faults, or the shader's scalar load raises a GPU page fault and the ring is reset. Two more storage buffer descriptors make the pool 0x26020 bytes; the buffer's last page then holds those 32 bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 tasks done
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
9 tasks done
9 tasks done
This was referenced Oct 7, 2026
9 tasks done
9 tasks done
Collaborator
|
Checked: build + ctest on the merge with current Note for #1184: it rewrites the same |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The descriptor cache's chain pools are created with two more storage buffer descriptors than a set may take (
ChainPoolCreateSizes). This keeps a RADV overrun inside the pool's pages. A TechnicalDebt line records the workaround.RADV (Mesa 26.0 and later, since 849d41db "radv: implement a new descriptor sets allocator") sets up a
FREE_DESCRIPTOR_SETpool's allocator withutil_vma_heap_inittakes a start and a size, so the heap ends 32 bytes past the pool's buffer, and a set can be placed up to 32 bytes past its end. Mesa main still has this. The chain pools come out at exactly 0x26000 bytes, a page multiple, so those 32 bytes are an unmapped page:SQC (data)). The gfx ring times out and is reset, and the recorder then waits on a fence that never signals. In PPSA14632, Unreal aborts after 120 s withGameThread timed out waiting for RenderThread. ARADV_DEBUG=hangdump shows a 160-byte set at offset 0x25f80, with ans_load_b128of its storage buffer descriptor at 0x26000.vkUpdateDescriptorSetscan write there. Under GPU-assisted validation this segfaulted inradv_write_sampler_descriptor, with the destination exactly at the end of a 0x26000-byte/dev/dri/renderD128mapping.With two more storage buffers the pool is 0x26020 bytes. The 16-byte slack RADV adds per set is already capped by
maxSets, so the only change is the 32 bytes. The buffer then spans 0x27000 bytes and the overrun stays in mapped memory. The other pools in the driver are linear (noFREE_DESCRIPTOR_SET), and RADV bounds those correctly.Standalone repro on RADV, no AnyPS5 needed: a pool for four sampled images (128 bytes,
maxSets1).FREE_DESCRIPTOR_SETpoolVK_ERROR_OUT_OF_POOL_MEMORYVK_ERROR_OUT_OF_POOL_MEMORYVK_ERROR_FRAGMENTED_POOLTested
Linux 7.2.9 (Arch), Mesa 26.2.4 RADV, RX 9070 XT (RDNA4).
cteston this branch: 382 of 382 pass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code