Repository navigation
Conversation
RyanTheTide
left a comment
There was a problem hiding this comment.
@aeries0x Two things before we take this. Pools now keeps an Arc of the last bound epoch per slot even with the parameter at 0, which keeps that VM's state and admission permit alive until another render uses the slot; please drop those references when the VM goes away or when the submit fails before publication. And if the stress results hold, we would rather have the reuse on by default than behind a parameter; is there a case you know of where it must stay off? We will run the default and =1 cases on an M4 Pro.
|
Results with the parameter at its default (0), on our J616s (M4 Pro, G16S), merged on integration e661192 as a one-shot test kernel:
We haven't run the |
Every G16 render gets a fresh parameter buffer epoch at SUBMIT and an InitBM ahead of its TA work, so the firmware rebuilds the allocator state for each render. Reusing the epoch instead cuts a small triangle render at queue depth 1 on a base M4 MacBook Pro (J604) from 1121 to 492 us. With this change, the next render of the same VM on a pass slot gets the slot's owner epoch, without a reseed or InitBM, if that epoch's render retired normally and was exposed. InitBM binds the device-wide slot to one epoch and VM, so this happens only while no other epoch was handed to the slot since; after another VM's render on the slot, after a failed or aborted render, or after any firmware recovery, the next render starts fresh. SUBMIT still allocates a fresh epoch for every render, so one is always at hand. Renders are bound, published and retired one at a time, so the slot's owner is the epoch it is bound to whenever reuse is allowed. The reused epoch is the slot's existing owner lease, so this holds no epoch, VM or admission permit beyond what the lease already holds: a slot binding is tracked by a counter, not by a reference. A host test covers when an epoch may be reused and that nothing else holds it. aurora.g16_pb_reuse=0 restores a fresh epoch and InitBM per render. The stats line counts reused and fresh bindings. Assisted-by: LLM Signed-off-by: Friedrich <261542475+aeries0x@users.noreply.github.com>
63a115b to
cdb7d9c
Compare
|
Thanks for testing on the J616s. Pushed a new revision for both points. References: the change adds no reference to Default: now on, with Also new: any firmware recovery, also one that resumes, makes the next render on each slot start fresh, and a host test in The numbers in the description are from this change on top of 673f618 (the tested build differs from the pushed commit only in comments and the commit message). I have not tested suspend with reuse on; if your M4 Pro run includes s2idle again, that would be the first one with the default. |
|
A correction to the desktop line in the description: "also with blur at 2 passes" measured nothing extra. Omarchy ships blur off and blurs only behind see-through surfaces, and the test window was opaque. Measured again with Omarchy's Glassy look (every window 75 % + blur 2 passes), same kernel (673f618 + this change), a 900x600 client pinned in front, 15 s per row,
Hyprland does ~19-27 renders per frame there. With the default look (no blur) it is 120 fps with both settings. |
|
Tested on a J604 (MacBook Pro 14", M4, Mac16,1; os-fw 26.6.2, system-fw 27.0; aura 1.0.0b13). The kernel was alarm-aurora's pkgrel 38 recipe on
No GPU fault or recovery line in the log. This is not a same-boot A/B: Disclosure: an LLM (Claude) ran these tests on my Mac and drafted this. I did the listening and looking, reviewed it, and am responsible for it. Assisted-by: LLM |
|
Re-ran our J616s row on head cdb7d9c, now with the parameter at its new default (1): cherry-picked onto integration/aurora fc05050, one-shot test kernel, SELinux enforcing. The J616s (T6040) binds the G17 backend (
0 GPU faults, firmware crashes or recoveries, 0 DART faults, 0 AVC. One s2idle cycle completed, and render.light afterwards was 117.5 us at depth 1. The production queue.exhaust failure was one run on a kernel without this change, not something this branch fixes. |
|
J604 (M4, G16G) results for cdb7d9c, GPU firmware 25G83. I cherry-picked it unchanged onto integration/aurora
compute.light does not use a PB, so its difference is boot-to-boot spread. queue.exhaust ends in the driver's ENOMEM No GPU faults, firmware crashes, recoveries or DART faults with either setting. I also ran 6 s2idle cycles with |
|
Tested on J773g (Mac mini M4, 24 GB): a large win, and no regressions in what I ran. Kernel gpubench c36cbbe (Vulkan, KWin running, headless), median µs per submit, best of the passes:
Correctness:
Open, not attributed: gpubench 🤖 Generated with Claude Code |
|
Correction to my J773g report above: the My benchmark ran in a systemd unit with Run without the cap, or under 20 GB, the case passes, with stock and with this PR. Nothing is open against #1543 from my side. 🤖 Generated with Claude Code |
|
Tested on the J773g Mac mini (M4, G16G B0) as the base of #2419, which stacks on this commit: with it, almost every render reuses its slot's retired epoch (30,582 reused / 114 fresh over a gpubench round), and Vulkan CTS 1/16 (84,219 Pass, 0 Fail) and the public GLES/EGL plan (0 Fail) are clean on the stack. #2419 also keeps never-exposed epochs for the next render, which takes render submit CPU from ~190-435 µs to 35-46 µs. 🤖 Generated with Claude Code |
Summary
Every G16 render gets a fresh parameter buffer (PB) epoch at SUBMIT and an InitBM ahead of its TA work, so the firmware
rebuilds the allocator state for every render. Reusing the epoch instead cuts a small triangle render at queue depth 1
on a base M4 MacBook Pro (J604) from 1121 to 492 us (table below).
With this change, the next render of the same VM on a pass slot gets the slot's owner epoch (the lease
Poolsalreadykeeps until a replacement retires) without a reseed or InitBM, if that epoch's render retired normally and was exposed.
InitBM binds the device-wide pass slot to one epoch and VM, so the epoch is reused only while no other epoch was handed
to the slot since. Reusing it after another VM's render on the slot leads to a firmware recovery and a wedged GPU under
gpubench-stress
queue.exhaust(tested). After a failed or aborted render, and after any firmware recovery (also onethat resumes and did not affect the render), the next render on each slot starts fresh too. SUBMIT still allocates a
fresh epoch for every render, so one is always at hand. Renders are bound, published and retired one at a time, so
whenever reuse is allowed the slot's owner is the epoch the slot is bound to.
Apart from the in-flight render's handle (dropped when it retires or fails), nothing here holds a reference of its
own: a slot's binding is tracked by a counter, and the reused epoch is the owner lease itself, so no epoch, VM or
admission permit lives longer than it does without the change. A host test in
test-resources.pycovers when an epochmay be reused and that nothing but the owner lease holds it.
Reuse is on by default;
aurora.g16_pb_reuse=0restores a fresh epoch and InitBM per render.Poolsgets the flag fromits callers, so
pools.rskeeps building in the asahi-m4 host harness, whoseArcmock gainsptr_eq.Testing
J604 (Mac16,1), GPU firmware 25G83, the installed Aurora userland (Mesa
vulkan-aurora26.3.0 devel), unattended trialboots of
integration/aurora673f618 + this change (the tested build differs from this commit only in comments andthe commit message). Same kernel,
g16_pb_reuse=0vs the default (1).gpubench core-a (Vulkan), no desktop session, power-profiles-daemon's
performanceprofile (Omarchy's choice onAC), median us per submit, two boots per setting (the second one is the error-path boot below):
g16_pb_reuse=0=1(default)render.light clear at depth 1 varies between boots by up to ~70 us with either setting; compute.light does not use a
PB.
--kernel-log): the same with 0 and 1: 11 pass, 5 skip (one queue, no sparseresidency, no ray query), and
queue.exhaustends in the graceful ENOMEM on submit (gpubench counts it as failedfor that kernel-log line). No firmware recovery or GPU fault.
life.churnand core-a withevery 97th completed render reported as failed to the reuse bookkeeping only (the job itself completes) and every
89th render deferred with EAGAIN after its slot was bound): 1699 injected failures and 86 deferred fresh bindings
were each followed by a fresh epoch with InitBM on that slot, never by a reuse; 1786 deferred reuses were retried.
No firmware recovery or GPU fault, stress results as without injection, the same with 0. A render held past the
5 s deadline is aborted the same way with 0 and 1 (firmware recovery, the render class stays unavailable until
reboot).
render class is marked failed);
recover()now also resets reuse on both slots there, but the render class staysunavailable afterwards, so no later render shows the effect. I found no recovery after which renders continue: a
compute dispatch past its deadline (with another client rendering) fail-stops the device without a firmware
recovery, the same on the previous revision. The reset itself (
Pools::invalidate) is covered by the host test.vm_bindingsin the debugfs stats around 20 short-livedlife.churnclients, measured the same way onthis commit with 0, with 1 and on the base: with the desktop session running it goes from 5 to 6 live (the slot's
owner lease) and stays there; without it, 1 is left afterwards. The same on all three.
wp_presentationframe pacing holds 120 fps in a window andfullscreen with both settings, also with blur at 2 passes. glmark2-es2-wayland scores 485 with 0 and 983 with 1,
with no faults.
tools/asahi/run-host-tests.pyin an Ubuntu 24.04 container with CI's toolchains: 260/302 on this head and on thebase, no test failing only with this change.
Assisted-by: LLM