The DART layer refused any mapping past a hard-coded 1.5 GiB of live
DMA bytes. Every dext page is DMA-backed, so GTT objects failed with
ENOMEM at 1439 MiB (97 MiB already mapped at start) although amdgpu
reports 64 GiB of GTT; llama.cpp's 1 GiB staging buffer and pinned host
buffers could not be allocated.
The limits that exist are the platform's: memory and wiring (the user
wire limit here is 108.8 GiB of 128 GiB, with 19.2 GiB kept for the
kernel), and the DART's IOVA window for the device, which the device
tree gives a Thunderbolt port's dart-apciec as 2047 MiB (IOVAs from
2 GiB). DriverKit enforces both: IOBufferMemoryDescriptor::Create or
PrepareForDMA fails. So:
- dart.c only accounts live-mapped bytes (used/peak); a mapping fails
when the seam fails it. linuxu_dart_budget and rt_dart_ceiling are
gone (rt_dart_peak reports the high-water mark).
- The seam logs each refusal with its size, the refusing call, its
IOReturn and what is already mapped (a run of identical refusals
logs its first and every 256th).
- The shutdown and probe holds take no ceiling. They count the bytes
mapped at their start and those mapped during them; retired mappings
keep their DART IOVA until the endpoint reset, so the DART refuses a
teardown mapping that would not fit beside them. A ceiling at the
live total would refuse every probe allocation (nothing is mapped
when the probe hold starts).
- The dext's mapping table and dart.c's streaming slots were fixed at
4096 entries, another wall: both grow in chunks that never move.
test_iokit_dma models the DART window and adds large mappings: a
1.5 GiB + 16 KiB mapping, a refused 512 MiB one (logged), 4500 live
mappings, and a teardown mapping refused beside retired ones under
the shutdown hold. test_session_shutdown closes a session with 6 GiB
mapped. test_dma_dart maps 3 GiB and 6000 live mappings.
Runs the unmodified upstream Linux amdgpu and amdkfd drivers on Apple
Silicon Macs inside a DriverKit system extension, for AMD GPUs attached
over Thunderbolt. The Linux sources come from a pinned submodule and are
compiled against linuxu, a userspace implementation of the Linux kernel
APIs they use. Includes the HSA runtime, the host installer app, the
setup and firmware fetch scripts, and the offline test suite.