Skip to content

drm/asahi: g17: fit a render pool for every queue on the A18 Pro - #1979

Merged
DjDeveloperr merged 2 commits into
integration/aurorafrom
djdev/g17-client-private-usage
Nov 16, 2026
Merged

DjDeveloperr merged 2 commits into
integration/aurorafrom
djdev/g17-client-private-usage

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Every queue that renders has a render pool, mapped in a window of the GPU address space that the pools of all clients share. On the A18 Pro that window holds about forty pools, while up to 58 queues can be open at once, one per GPU execution context. A render that finds no room first takes back the pools of idle queues; when more queues than that render at the same time, it waits for one of them to go idle, and fails if none does in time: the client sees a lost device.

The pool window and each client's private window above it share a span of the address space that is kept from userspace on every client. The private window holds only small objects (timestamp pages, generation state, register pages).

Change

  • The capacity snapshot reports how much of the private window any one client has had mapped at a time (client_private_bytes high_water=... total=...).
  • On the A18 Pro, the boundary moves: the pool window, 3264 MiB, has room for the smallest render pool of every queue, and the private window keeps 768 MiB. A compile-time check ties the pool window to the number of queues.
  • Unchanged: the M4 Pro and Max keep the previous split, through a new UAT quirk; M5 GPUs place these objects elsewhere. Userspace is not affected: the whole span stays reserved on every client, as before.

Limit

Compute pools share the pool window too. With every queue rendering, about 590 MiB remain for compute pools and the queues' small mappings; more busy compute queues than fit there still wait for room, as compute already does.

Testing

  • Builds for arm64 with the MacBook Neo kernel configuration; no new warnings in the changed files.
  • MacBook Neo, the same load on the 7.3.0-40 release and on a kit of this change with drm/asahi: g17: log capacity refusals at info level, not as warnings #1977, drm/asahi: g17: take a context's render pool identity when it is created #1981 and drm/asahi: g17: show each process's share of the queues #1982 on that release: two processes with 22 Vulkan devices each, all rendering continuously with a readback check, for 90 s; then the same beside a process holding 70 % of RAM.
    • 7.3.0-40: all 44 devices were created, but 5 of them could not get a render pool, and their submissions failed with VK_ERROR_OUT_OF_DEVICE_MEMORY (41 times each); one process exited with an error, and the desktop shell aborted during the load. Beside the memory hog, 4 devices failed 12 times each.
    • With this change: 0 failed submissions out of 761,031 (and out of 994,704 beside the memory hog), every readback correct, no GPU errors in the kernel log, no desktop crash. Up to 48 render pools were placed at once. The lowest MemAvailable beside the memory hog was 373 MiB (1257 MiB on 7.3.0-40, where fewer pools were in use).
  • MacBook Neo, dEQP-EGL multi-context cases in two and three processes at once (57 of 58 queues): 7.3.0-40 refused render pool placements 4 times and kept going only by giving idle pools back; with this change there were no refusals, up to 2334 MiB of the 3264 MiB pool window was in use, and no faults.
  • MacBook Neo, the fast CTS gate (a sample of every Vulkan CTS group plus EGL, GLES 3.0 and 3.1) on the same kit: 0 regressions and no GPU errors in the kernel log.

Rebased onto integration/aurora a163d7f (after #1977, #1981 and #1982 merged). The only conflict was in g17/capacity.rs, where #1982's queue-share line now comes right before this PR's client_private_bytes line. That region now matches the kit the busy-row result above came from, byte for byte, and every other file's diff is the same as before. The logic is unchanged. Host tests: g17 32/32, asahi-m4 1/1. Fedora compile and link check OK, with no new warnings compared with the tip.

🤖 Generated with Claude Code

The driver places a client's private firmware-visible objects (compute
timestamp pages, render generation state, register and fragment pages,
compute binding pages) in a window of that client's address space. The
capacity snapshot reports the shared window of render and compute pools
but nothing about this one, so there is no way to tell how much of it a
client uses.

Count the bytes each address space has mapped in its private window,
and report the most any one has had mapped at a time, with the window's
size:

  client_private_bytes high_water=... total=...

Signed-off-by: Diljit Singh <[email protected]>
Every queue that renders has a render pool, mapped in a window of the
GPU address space that the pools of all clients share. On the A18 Pro
that window holds about forty pools, while up to 58 queues can be open
at once, one per GPU execution context. A render that finds no room
first takes back the pools of idle queues; when more queues than that
render at the same time, it waits for one of them to go idle, and fails
if none does in time.

The pool window and each client's private window above it share a span
of the address space that is kept from userspace on every client. The
private window holds only small objects (timestamp pages, generation
state, register pages). On the A18 Pro, move the boundary: the pool
window, 3264 MiB, has room for the smallest render pool of every queue,
and the private window keeps 768 MiB. A compile-time check ties the
pool window to the number of queues.

The M4 Pro and Max keep the previous split, through a new UAT quirk; M5
GPUs place these objects elsewhere and are unaffected.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr
DjDeveloperr force-pushed the djdev/g17-client-private-usage branch from a7c1149 to 3deb91b Compare November 16, 2026 07:39
@DjDeveloperr
DjDeveloperr marked this pull request as ready for review November 16, 2026 07:39
@DjDeveloperr
DjDeveloperr merged commit 551b937 into integration/aurora Nov 16, 2026
1 check passed
@RyanTheTide
RyanTheTide deleted the djdev/g17-client-private-usage branch November 17, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant