Linux: one dma-buf import larger than udmabuf size_limit_mb (default 64) fails UDMABUF_CREATE #5329
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 darklinkworker on 2026-10-13T17:18:40Z.
What
On Linux, importing one contiguous direct-memory run as a dma-buf fails when the run is larger than the kernel
udmabufmodule limit. The import then falls through to the address-copy path and aborts on the 64 MiB cap./sys/module/udmabuf/parameters/size_limit_mbwas64on this machine. A single registered range failed:Raising that parameter to
2048for the current boot made the same import succeed. The write does not survive a reboot. This is a host tweak, not a change in the emulator.Open #4449 covers a scattered range as a
UDMABUF_CREATE_LISTrun list. A single run still uses oneUDMABUF_CREATE, so a run bigger thansize_limit_mbis still rejected by the kernel even with that PR.Repro
Dragon Quest III HD-2D Remake (PPSA20612) on Linux, RADV, during boot after the window is up. The copy-cap abort is the one above: 147.6 MiB, one range. With
size_limit_mbleft at 64 it returns; with it raised, that abort did not return.Environment
udmabufsize_limit_mb: 64 by defaultAI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by David-cmrg on 2026-10-13T17:23:20Z.
I'm working on this: when
UDMABUF_CREATEfails because a range is larger than udmabuf'ssize_limit_mb, the import failure will say so and name/sys/module/udmabuf/parameters/size_limit_mb, and USAGE.md will describe raising the limit so that it survives a reboot.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T17:30:25Z.
I checked the current-main import path. The existing
createChunkedDmaBufImportonly accepts a range that fits wholly inside one 64 MiB chunk (within + entry.bytes <= ImportChunkBytes); a larger range falls back to oneUDMABUF_CREATE. That explains why the reported 147.6 MiB run still hits the kernel limit. The kernel also appliessize_limit_mbto the total page count when creating a list-backed dma-buf, so splitting the ioctl list alone would not bypass the limit (kernel implementation). A general fix looks like it would need to represent one guest range with multiple Vulkan buffers, or expand the address-copy path beyond its current cap. I have not found a safe focused change for that yet; the raised module limit remains the available workaround.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T17:31:52Z.
Correction to my earlier analysis: I missed open PR #5309. It implements sparse buffer imports backed by the existing 64 MiB udmabuf chunks, covering the large shared-range case described here. The earlier note about whole-range fallback does not account for that in-flight implementation. I will not propose a duplicate; any remaining size-limit diagnostic or documentation follow-up should be coordinated separately.
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-13T18:17:01Z.
This is the same limit I hit in ASTRO BOT (PPSA21567), and #5309 is the fix I opened for it. A memfd-backed range larger than 64 MiB is imported as one sparse
VkBuffer, bound to the existing 64 MiB udmabuf chunks, so no singleUDMABUF_CREATEasks the kernel for more than 64 MiB andsize_limit_mbcan stay at its default.Measured today with
size_limit_mbreset to 64 on an RX 9070 XT (RADV): ASTRO BOT reaches its title screen at about 19 FPS, and the "memory access" write-backs (2,109 / 21.4 GB every 10 s before) are gone. On main with the same limit it stalls on the opening at 0 FPS. simonbbby also verified the PR's test at the default limit on an RDNA2 iGPU in #5309.I don't have Dragon Quest III HD-2D Remake, so I could not run your title. Your range
0x2041fd0000+0x93a0000should take the new path if its offset in the backing file is 64 KiB aligned; a log from #5309 on that title would confirm it. Ranges whose offset is not 64 KiB aligned still fall back to copies, and I am working on that next.@David-cmrg, #5309 also adds a line to
docs/user/USAGE.mdabout this, so the two changes may overlap there.Imported from boykopovar/AnyPS5. Originally posted by darklinkworker on 2026-10-13T18:38:15Z.
Applied #5309 on current
main(18c438b10). A clean launch still stops first on many small ranges (72 MiB across 1151 ranges, each outside the write-watched arena). Those are not one shared run larger than 64 MiB, so the sparse chunk path does not cover them. With the #4449 run list ported as well, boot reached the title.size_limit_mbwas still 2048 from the earlier workaround, so this run does not show whether the 147.6 MiB range imports at the default of 64.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by darklinkworker on 2026-10-13T19:19:43Z.
Direct answer to the request for a #5309 log of
0x2041fd0000+0x93a0000: I do not have that log.size_limit_mbwas still 2048 during the boot that had #5309 applied, so that run does not show whether the 147.6 MiB range imports at the default of 64.The other stop I mentioned is a different case. On clean
main, before #5309, boot aborted with 72 MiB across 1151 ranges, each marked outside the write-watched arena. Those are small ranges, not the one 147.6 MiB run in this issue, so they do not test the sparse 64 MiB chunk path.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T19:28:59Z.
I checked the range values in the report: both the guest start (
0x2041fd0000) and length (0x93a0000) are 64 KiB aligned. Current PR #5309 has independent RADV validation on its exact head withsize_limit_mb=64unchanged, including an oversized sparse-import test and a production-only negative control. That supports the fix for the reported shape, but it does not prove this title’s backing-file offset or that Dragon Quest III took the path; the PR author noted the backing offset must also be 64 KiB aligned. A run of #5309 on this title with the limit reset to 64 would close that remaining evidence gap.Imported from boykopovar/AnyPS5. Originally posted by David-cmrg on 2026-10-13T20:02:03Z.
Thanks, both. #5309 removes the cause, and its USAGE.md line covers what I meant to document, so I'm dropping my change for this issue to avoid overlapping with it.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T21:30:34Z.
The 72 MiB / 1,151-range stop is distinct from the oversized single dma-buf range. In current
GuestBufferMemory::AcquireRegistered, each readable GPU range can take a host import, an image mirror, or the copy fallback; only the copy bytes feedAddressCopyOverflow(default 64 MiB). Could you share the exactFATAL: ...overflow line and a short summary of those 1,151 ranges split bygpu,writable,releasable, and whetherAPS5_NO_LEASE_MIRROR=1was set? If available, one representative range plus its allocation type would help identify whether these should use imports, mirrors, or whether the 64 MiB aggregate copy cap is reached. I don’t have enough evidence yet to make a safe fix for this second case.Imported from boykopovar/AnyPS5. Originally posted by darklinkworker on 2026-10-14T02:08:34Z.
Retried on current
main(016db923a), libraries rebuilt from that commit, no local patches.APS5_NO_LEASE_MIRRORwas not set. Boot still aborts on the same line:Those 1151 are the ranges that reached the copy fallback. Ranges that are not both
gpuand readable are not in the count. Of the 1151:outside the write-watched arena1151image mirror refused0,unreadable pages0,mirrors disabled0The largest is
0x2015c50000+0x20000(128 KiB), writable, releasable, gpu. Its parent allocation is0x1000000000,0x8000000000bytes. The range record has no separate allocation-type field, so that address and size is what the registry stores. The eight ranges in the FATAL line are the largest by committed bytes, and each is 0.1 MiB.This boot does not reach the single 147.6 MiB import. That one still shows up only after the run-list import from #4449, and it has not been retried with
size_limit_mbput back to 64.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T09:23:44Z.
#5309 is on main: a run past the udmabuf limit is now imported as a sparse buffer, which is the case this issue covers. The 72 MiB / 1,151-range copy stop is a separate one (see the note above); please open it as its own issue with that FATAL line if it still happens on current main.