fix(radv): keep device-local memory out of a small APU carve-out #483
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!483
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-483"
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?
@ChainedTears on GitHub · 2026-12-04 17:28 UTC · original
ChainedTears:fix/apu-carveout-gtt→main· +38 −4 · 1 files · 1 commits · openWhat is wrong
On an APU, RADV's device-local memory types point at the VRAM domain, which on such a machine is only the BIOS carve-out. RADV places a device-local allocation in VRAM first and spills to GTT only once it is full. On a Ryzen AI Max+ 395 (Radeon 8060S, gfx1151) the carve-out is 512 MB and the desktop alone holds about 316 MB of it, so the title keeps the carve-out full and the compositor's buffers no longer fit:
GNOME Shell aborts and the session logs out, mid-run. Before that, runs on this machine ended now and then in
device removedwith the title's context reported innocent.The change
In
patches/mesa.patch, on a GPU without dedicated VRAM whose carve-out is under 1 GB:radv_physical_device_init_mem_types: the memory types that targetedRADEON_DOMAIN_VRAMtakeRADEON_DOMAIN_GTTwithRADEON_FLAG_GTT_WC(write-combined, uncached for the GPU), withoutRADEON_FLAG_NO_CPU_ACCESS. The heaps and the property flags the application sees are unchanged.radv_amdgpu_winsys_bo_create: RADV's own buffers created directly in VRAM (shader arenas and the like) take write-combined GTT the same way.RADV_APU_CARVEOUT=1keeps the old placement. A carve-out of 1 GB or more (a Steam Deck's) is left as it was: not tested there.Measured (one machine: Ryzen AI Max+ 395, 128 GB, 512 MB carve-out, Proton Experimental)
mem_info_vram_used): 460+ MB before, 316-320 MB after (what the desktop holds without the title).VICTORY_BENCH, 3 minutes of the same cutscene, Series X, 2560x1440, ray tracing on): 26.1 fps (3 runs) before, 26.6 after.The first start after the driver changes prepares the pipelines again (the driver's cache key changes).
This change was written with an AI assistant (Claude Code); the Mesa part carries the
Generated-by: LLMtrailer per Mesa's policy.Generated with Claude Code
On an APU whose BIOS carve-out ("VRAM") is under 1 GB, RADV still placed every device-local allocation in VRAM first and spilled to GTT only when it was full. On a Ryzen AI Max+ 395 (Radeon 8060S) with a 512 MB carve-out the desktop holds about 316 MB of it: the title kept the carve-out full, a GNOME Shell submission was rejected with -ENOMEM ("amdgpu: The CS has been rejected (-12)"), the shell aborted and the session logged out mid-run. On a GPU without dedicated VRAM and a carve-out under 1 GB, memory types that targeted VRAM, and RADV's own buffers created in VRAM, now take write-combined GTT. During a run the carve-out then stays at what the desktop holds (about 316-320 MB, from 460+ MB), with the same frame rate (Series X, 2560x1440: 26.6 fps against 26.1 before; with the translator options 28.1-29.2). RADV_APU_CARVEOUT=1 restores the old placement. A Steam Deck's 1 GB carve-out is left as it was. Generated-by: LLM Co-Authored-By: Claude Opus 5.5 <[email protected]>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.