Skip to content

G14X compute preemption: qualify merged M2 Max default and broader hardware #25

Open

Description

@chriskearney

Joshua Warren’s candidate allows firmware preemption by default on G14X and adds compute_preempt. He reports correct concurrent animation/compute on M2 Max, with roughly1% decode difference inside run-to-run spread. Forcing the same path on M1 MoE workloads costs about12–20%, so M1 defaults must stay unchanged. The original .13 release predates automatic M2 Max selection; .14 includes the author-preserving implementation in #68.

Priority: P1 · Readiness: needs-retest · Implementation owner: kernel

Baseline: Aurora 2026.10.11.14, kernel source 7cae5a72ccc6690a710e199c853f8e1c97a3d86c. Earlier reproductions retain the exact versions above.

Code: drivers/gpu/drm/asahi/asahi.rs · drivers/gpu/drm/asahi/workqueue.rs

Completion criteria: Review exact generation/default/module-parameter dispatch and firmware priority fields. Compile the affected ARM64 Rust driver and test concurrent compute plus compositor correctness, cancellation and teardown. Preserve G13 and M3/HAL200 defaults. Complete repeated output-digest, throughput, cancellation and teardown qualification on named hardware before broadening automatic selection beyond M2 Max.

Original reports/candidate: original #137

This ticket carries forward the remaining work; source inclusion, release delivery and hardware acceptance are recorded separately.

Original PR #16 is closed as superseded by the author-preserving #68. M2 Max (0x6021/G14X) is selected automatically; M2 Pro/Ultra retain explicit opt-in pending qualification. M1 and M3/HAL200 defaults remain unchanged.

Implementation progress: Merged author-preserving M2 Max automatic preemption in #68, retaining Debug0 and explicit overrides. Focused ARM64 build and independent policy controls pass; Pro/Ultra and longer hardware qualification remain open. Delivered in Aurora 2026.10.11.14. Named hardware acceptance below remains open.

Launch placement: Focused launch qualification in #72. Reuse unchanged passing evidence; check only the missing profile or newly changed path. Broader board/accessory permutations remain follow-ups. Roadmap: #56.

Activity

  1. added
    priority:P1
    status:candidate
    owner:kernel
    area:gpu
    on Oct 11, 2026
  2. chriskearney commented on Oct 11, 2026

    @chriskearney
    Author

    Merged Joshua’s candidate through #68. Automatic compute preemption is enabled on M2 Max; the existing Debug0 opt-in is retained, and explicit compute_preempt=0/1 wins. Pro/Ultra remain explicit opt-in targets. M1 defaults and M3 HAL200 queues are preserved.

    The ARM64 Asahi object compiles, 12,960 compiled policy/priority combinations pass, and independent review accepts the source. Joshua’s M2 Max hardware evidence remains in #16; no new Pro/Ultra or teardown qualification is claimed. Queued for the next release; .13 is unchanged. Keeping this tracker open for the remaining hardware qualification.

  3. added
    status:needs-retest
    and removed
    status:candidate
    on Oct 11, 2026
  4. changed the title [-]G14X compute preemption: review candidate while preserving M1 throughput and M3 queues[/-] [+]G14X compute preemption: qualify merged M2 Max default and broader hardware[/+] on Oct 11, 2026
  5. added
    launch:qualification
    on Oct 11, 2026
  6. joshuaswarren commented on Oct 11, 2026

    @joshuaswarren

    M2 Max verification of the release aurora-2026.10.11.14, for the GPU part of this ticket.

    Machine and boot. A 14-inch MacBook Pro with the M2 Max (G14C B1). One boot of the release kernel 7.1.12-2-20261011.14-sep-ARCH (vmlinuz sha256 f3e39a3fc581a00658d837332dfbe0ca442df74e4b2cedbff60016dc6bb03ecf, from the release package, sha256 ea2dd7b92f90ddc4411932b5fff25ac1209509ddfb2986222ee5ee3bfe15d9be). The command line has no asahi. word at all, checked before and after the tests. Mesa 26.3.0-devel (Honeykrisp). Not a full user update: our m1n1 stayed at aurora14, and the initramfs and boot image were built by hand from the release kernel. The release kernel has no compute-preempt log line, so the proof below is behavioural.

    Animated-window test. One animating Chromium page beside one compute dispatch at a time, 4 animated runs per arm, each compared with the hash of a run without the page.

    Dispatch Animated runs that match Page frame rate (120 alone)
    about 152 ms 4 of 4 86.6 fps
    about 87 ms 4 of 4 88.0 fps
    about 690 ms 4 of 4 83.6 fps

    There were 0 GPU timeouts, 0 display fence waits, 0 hung tasks and 0 "GPU is crashed" lines, counted with journalctl -k for the whole boot. The earlier stock kernel gave wrong results and 39 to 120 GPU timeouts per minute on the same test. These numbers equal the ones from our boots with asahi.debug_flags=281474976710656 (86.6, 87.0 and 83.3 fps).

    Decode cost. gemma-4-26B-A4B on MLX, same build and driver, with the ANE idle, package and v3 Vulkan drivers interleaved 3 times:

    Decode tok/s (3 rows) Median Prefill tok/s
    v3 driver 10.49, 10.58, 10.61 10.58 147.6 to 148.0
    package driver 11.66, 11.90, 11.89 11.89 149.4 to 149.7

    The package over v3 ratio is 1.124. On the earlier flag boot it was 1.119. The v3 median is 2.9 percent below the 10.90 of the earlier flag block (the mean is 3.1 percent below), 1.1 percent above the stock kernel's 10.47, and inside the 7.4 percent range of our v3 control rows that day (10.13 to 10.91). So the cost is not separable from run-to-run drift.

    ANE. The release kernel's own ane_t6021 module loaded and ran one 60 s iteration of a 449 MB encoder program: 237 calls, median 253.4 ms, output bit-exact against the reference, no new ANE or DART lines in the kernel log.

    Not tested. M2 Pro and M2 Ultra (no hardware), a repeat boot or a second harness run, a negative control with compute_preempt=0 (it wedges this machine), and the M1 and M3 defaults, which this check does not touch.

  7. scottjones commented on Oct 11, 2026

    @scottjones
    Collaborator

    Second M2 Max check of aurora-2026.10.11.14, this time on a full user install. Compute beside the compositor passed: 191 of 191 runs correct, no GPU timeouts or faults. Killing a client mid-dispatch caused one GPU timeout, which recovered.

    Thanks Josh for the change. The concurrent results match yours above, now with the packaged m1n1 and Mesa.

    Setup. 14-inch MacBook Pro, M2 Max (J414c, G14C B1), system firmware 26.6.2. Installed with the release one-liner: linux-aurora 7.1.12.aurora2-20261011.14 (vmlinuz sha256 f3e39a3fc581a00658d837332dfbe0ca442df74e4b2cedbff60016dc6bb03ecf, same as yours), m1n1-aurora 1.6.1.aurora17-5, Mesa 26.2.4 from the package. No asahi. word on the command line, so compute_preempt is at its default (auto, on for t6021).

    Probe. One vkCmdDispatch over 4,194,304 invocations, each an integer LCG + xorshift chain, calibrated to a target length. Each run zeroes the buffer, then checks 4096 CPU-computed elements and an FNV-1a hash of the whole buffer against the alone runs. Load is vkcube on the 120 Hz internal display (113.4 fps alone).

    Compute beside the compositor

    Dispatch Alone: correct, median ms Beside vkcube: correct and hash matches, median ms vkcube fps beside
    50 ms 4/4, 50 120/120, 49 111.6
    150 ms 4/4, 151 55/55, 149 112.3
    700 ms 4/4, 689 16/16, 714 98.8

    0 GPU timeouts, 0 GPU faults and 0 hung tasks in every arm, alone and beside.

    Kill mid-dispatch

    The plan was 10 SIGKILLs mid-dispatch, 3 during readback and 3 normal exits with work in flight, all with vkcube running. The script stops at the first GPU timeout, so only the first kill ran: SIGKILL 260 ms after submit, into a 700 ms dispatch.

    Result: 1 GPU timeout, recovered. 0 separate faults, 0 hung tasks, 0 failed recoveries. The unmapped-page fault below is part of the timeout report, not a separate event.

    17:39:32.786 QueueJob 799852: Job canceled on DRM scheduler teardown
    17:39:32.798 ** GPU timeout nya~!!!!! **
                   Event slot: 119
                   Timeout count: 0
                   Fault info: { address: 0x11fff88100, vm_slot: 0x31, unit: UL1C, read: true, reason: Unmapped, ... }
                   Pending events: [0:119] flags=7 value=0x7700a800
                   Halt count: 1
                   Halted: 1
                   Attempting recovery...
    

    After that: no Cannot recover, GPU is crashed, scheduler timeout or hung task, and no further asahi lines in the kernel log. The killed process was reaped (nothing left in D state), the next client's 50 ms run matched the reference hash, and vkcube kept running.

    My reading of the source, not confirmed on hardware. This looks like the existing teardown path rather than the priority change. QueueJob::cancel only logs, so the dispatch keeps running in firmware after the client's VM is unbound. Its read of an unmapped page faults the GPU, handle_timeout marks the pending event failed, and recover() clears halted and sets resume, so the firmware is resumed with no GPU reset. cancel is byte-identical in the 11.31 build I ran before (iconidentify/aurora-linux sep-7.1.12.aurora2-11.31, 87e165c), and #68 doesn't touch the teardown code. One caveat: on t6021 the queue being torn down now has preemption on, so the firmware state teardown leaves behind isn't the same as before, even though the code is. I haven't run the same kill on 11.31 or with compute preemption off, so I can't say whether preemption changes whether or how often this happens.

    Not tested. The other 9 mid-dispatch kills, the readback kills and the in-flight exits; repeated teardown; a compute_preempt=0 comparison; M2 Pro and Ultra.

  8. joshuaswarren commented on Oct 12, 2026

    @joshuaswarren

    Kill-mid-dispatch arm on our 14-inch M2 Max, release kernel 7.1.12-2-20261011.15-sep-ARCH (vmlinuz sha256 ba10ef1e112fbf664e6b41615ba7c289dee3fd64ed2167757356f93b7ab30811, same as the release asset). The command line has no GPU driver parameter, so compute_preempt is at its default (auto, on for t6021). The animated Chromium page ran the whole time.

    Result: no wedge. 16 of 16 clients ran and every next client matched the reference hash (2768e4ce034a). The page's frame counter advanced after every client.

    Arm Count GPU timeouts Reaped Next client
    SIGKILL 260 ms into a ~700 ms dispatch 10 10 (one each) 0.06 s each 10/10 match
    SIGKILL right after the dispatch returned 3 0 0.06 s each 3/3 match
    Normal exit with an async dispatch in flight 3 0 0.8 s 3/3 match

    Kernel log counters for the boot went from 0 to 10 GPU timeout, with 0 Cannot recover, 0 GPU is crashed and 0 hung tasks. Each timeout shows Fault info: ... read, reason: Unmapped, as in the earlier M2 Max kill result in this thread. That is the existing teardown path: the client's VM is unbound while the dispatch still runs. The kernel recovers without a reset. We did not use our reset.

    Not covered.

    • The 3 "after dispatch" kills landed 719 to 728 ms after submit, when the worker had already printed its result. They are kills right after completion, not kills inside the readback copy.
    • A compute_preempt=0 run on the same kernel needs a second boot.
    • Repeated teardown beyond these 10.

    Files: kill-arm JSON per client, kernel log at the end of the run, launch log, with SHA256 sums. I can attach them if useful.

  9. DanteCpp commented on Dec 1, 2026

    @DanteCpp

    On my 16-inch M1 Max (J316c), the desktop stays responsive during heavy Qwen3.8-Flash-Next prefills in DS4 with aurora.compute_preempt=1. DS4 requests a low-priority Vulkan compute queue. I haven’t noticed a loss in prompt or generation speed in normal use.

    That’s a different workload from the Gemma MoE run that lost 20% in decode. I’m comparing both settings on the same DS4 kernel, with the same Mesa build, model and prompt, so I can post prefill and generation rates separately.

    I opened a draft for the M1 Max default. aurora-silicon/linux#3779

  10. DanteCpp commented on Dec 1, 2026

    @DanteCpp

    I ran Qwen3.8-Flash-Next Q2 in DS4 on the same 32-core M1 Max (J316c) with GPU compute preemption off and on. Both boots used the same DS4 kernel and Mesa driver.

    Metric Off On Change
    Prompt prefill (tokens/s) 352.79 (352.44–353.09) 344.92 (344.79–345.05) -2.2%
    Generation (tokens/s) 33.65 (33.61–33.66) 33.19 (32.90–33.20) -1.4%
    Wayland sync p95 during prefill (ms) 0.06 0.09 +45.2%

    Each column gives the median of five warm runs after one warm-up, with throughput ranges in parentheses. I used one boot per setting, an 8,192-token prompt, 1,024-token prefill chunks and 128 teacher-forced generation steps. The saved prefill logits matched across both arms. Wayland sync measures compositor event-loop response. Frame presentation and input-to-display latency require separate measurements.

    Kernel 7.3.0-ds4-ARCH (build ID 52eb45b3fbc37e119797d524f0ba8eb50a2585eb), Mesa 19c3abf8d9f, DS4 099bf8b943bf, low-priority Vulkan compute queue, power 100%.

    During the timed prefills, the kernel display driver waited one second for a GPU fence in 3 of 5 warm runs with preemption off and 0 of 5 with it on. That matches my experience of the desktop staying responsive. These measurements also show a small throughput cost in DS4.

    I had btop open during part of testing. Desktop redraw activity was uncontrolled on these boots, so these deltas can include contention with the compositor. I’m repeating the comparison with a monitored static desktop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:gpulaunch:qualificationowner:kernelpriority:P1status:needs-retest

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions