Skip to content

drm/asahi: G14 firmware 27.2: run every performance state, and set the compute start word the 13.5 path sets - #2896

Closed
RyanTheTide wants to merge 3 commits into
satchlj/g14-v27-2-compute-onlyfrom
m2mini-gpu/g14-272-all-states
Closed

RyanTheTide wants to merge 3 commits into
satchlj/g14-v27-2-compute-onlyfrom
m2mini-gpu/g14-272-all-states

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown

Problem. On G14 firmware 27.2 the compute runtime from #2544 holds the GPU at its first performance state (globals +0x98 = 100). Lifting that cap alone hangs the upper states (no MMU fault, the firmware just stops retiring work). Separately, at any state an integer dot-product kernel and a maximum-threadgroup-memory dispatch never retire, and the GPU stays unusable until reboot.

Change. One commit on top of #2610, gpu/v27_2.rs only:

  • write the DT performance-state count into the word right before the temperature alarm's per-state table (where 13.5 HwDataShared3 keeps it). Nothing on the machine describes the alarm's hysteresis or retry, so the alarm stays off. With that, the state cap at +0x98 becomes the DT ceiling, like +0x88/+0x8c already are;
  • set the compute start operation's +0x28 word to 1. That operation keeps the 13.5 G14 StartCompute layout field for field, and +0x28 is unk_28, which the 13.5 path sets to 1.

Everything comes from the DT; there are no chip gates or parameters.

Testing. Mac mini M2 (J473, T8112 G14G), firmware 27.2, distribution command line, no module options, one-boot trials of integration/aurora + #2543 → #2544 → #2545 → #2610 + this commit:

  • clpeak (Vulkan): fp32 3504 GFLOPS (float4), up from 1035 on the stack as is. fp16 3509, int32 891 GOPS, int8 dot product 324 GOPS (this one hangs without the change);
  • dEQP-VK.compute.pipeline.zero_initialize_workgroup_memory.max_workgroup_memory.1 passes (hangs without the change);
  • dEQP-VK compute subset 738/776 pass, 0 fail, the same as the stack as is;
  • 5-minute clpeak soak: 127 iterations, 0 failures. A 10-minute soak with the two state words alone ran 254/254. Die max 41.5 °C. 0 faults, crashes, timeouts or AVCs.

Still to run. max_workgroup_memory.128 still hangs, with or without this change. There is no hung-command recovery on 27.2 yet. No row is needed on 13.5 machines (M2 Air): the driver only enters the 27.2 runtime when the GPU node's apple,firmware-version is 27.2.0, so this file never runs there.

Rows and evidence detail

Bisection before the fix (cap in hundredths of the state index): states 1-5 stable (state 5 = 1110 MHz, fp32 2788 GFLOPS, 10-minute soak clean); states 6, 7 and 8 hang on the first heavy dispatch. With the floor word set, all 8 states run (fp32 float/float2/float4 3059/3244/3504 GFLOPS). We tried full 13.5 parity for the alarm (hysteresis 500, floor = the 13.5 value, retry 1) too. It still hangs max_workgroup_memory.1 at the top states, so the alarm stays off.

Earlier row on the stack as is: #2544 (comment). Proposal comment with the inline patch: #2544 (comment). This PR is that patch as a branch (commit message corrected: the 10-minute soak was the state words alone, the full change soaked 5 minutes).

Satya, take it into the series in whatever form you prefer. If you fold it in, close this PR.

Assisted-by: LLM (Claude:Opus 5.5)

satchlj and others added 3 commits November 22, 2026 05:33
The G14 firmware-27.2 runtime reuses the 26.x submission front end
(m3_submit, agx_uapi and their helpers), so it was built only with
CONFIG_DRM_ASAHI_M3_T8122. Give it its own option, DRM_ASAHI_G14_V27_2
(default y), and build the shared front end when either user is enabled:

- m3/mod.rs: agx_uapi, agx_compute, agx_attachments, agx_memory and
  m3_submit build with DRM_ASAHI_M3_T8122 or DRM_ASAHI_G14_V27_2.
- m3_submit.rs: the M3 sink, queue constructor, render validation, CDM
  launch check, timeout handling and fence-timing profile build only
  with the M3 runtime; without it a render command gets EINVAL.
  task_comm() moves here from m3_client.rs, which now calls it here.
- The G14 path's own code is gated on the new option.

Like the M3 runtime, the option depends on DRM_ASAHI_G15: the firmware's
UAT is adopted through that backend's handoff helpers (Uat::new_adopted,
the G15 UAT table cleaning).

Signed-off-by: Satya Benson <satya@benson.earth>
The G14 firmware-27.2 runtime refuses render commands, but nothing in
GET_PARAMS says so. Graphics userspace therefore takes the device for
GL: on phellos (J413) with the GPU published, kmsro picked the aurora
render node for the internal panel, and the greeter's Hyprland and
sddm-greeter-qt aborted after their first renders failed with EINVAL.

Add DRM_ASAHI_FEATURE_COMPUTE_ONLY (bit 41; bits 39 and 40 are claimed by
open PRs #2059 and #2523) and set it on that runtime. It is a property
of the device, not of a board or chip list: Mesa can decline to create
a graphics screen or a graphics queue on a device that reports it, and
fall back to software rendering, while compute keeps working. Kernels
without the bit keep their current behaviour.

Signed-off-by: Satya Benson <satya@benson.earth>
…e compute start word the 13.5 path sets

The 27.2 G14 runtime kept the GPU at its first performance state
(globals +0x98 = 100). Two things kept the other states and some
dispatches from working:

- The temperature alarm's per-state table is copied from the 13.5
  configuration, but the word before it (the 13.5 HwDataShared3
  position of unk_8) stayed 0. The alarm then runs in every state, and
  at the upper states the firmware stops retiring work (no fault). No
  machine property describes the alarm's hysteresis or retry interval,
  so keep it off: a floor of the DT state count lies above every state.
  The state cap is then the DT ceiling, like +0x88/+0x8c.
- The compute start operation keeps the 13.5 G14 StartCompute layout
  (unk_pointer +0x04, job parameters +0x0c, stats +0x14, queue +0x1c,
  VM slot +0x24). Its +0x28 word is 13.5's unk_28, which the 13.5 path
  sets to 1; with 0, an integer dot-product kernel and a maximum
  threadgroup-memory dispatch never retire.

On a J473 (Mac mini M2) with firmware 27.2: all eight DT states run,
fp32 3.5 TFLOPS instead of 1.0, the int8 dot-product and
max_workgroup_memory.1 dispatches complete, the dEQP-VK compute subset
is unchanged (738/776, 0 failures) and a 5-minute soak is clean
(10 minutes with the two state words alone).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Author

Review at 1bcdd7c.

  1. gpu/v27_2.rs:944-948: this turns off a thermal protection that the 13.5 path keeps on. For T8112, 13.5 writes HwDataShared3.unk_8 = 5 (hw/t8112.rs:63) with per-state thresholds 10700 for states 0-4 and 6000/1000/1000/1000 for states 5-8. So 13.5 arms the alarm in exactly the states this PR unlocks. Setting the word to perf_states.len() disarms it, and lifts the +0x98 cap (line 812) to the top state in the same commit. The fact that the alarm stalls the firmware in states 6-8, even with full 13.5 values, points to an alarm the 27.2 host side does not service yet, not to an alarm that should stay off. Please do one of these: (a) find and service what the firmware waits on when the alarm fires; (b) until then, keep +0x98 at the highest state that runs with the alarm armed with the 13.5 values; or (c) if it does stay off, name in the code which controls still limit the top states (fast-die PI from hwdata_a, the SoC-hot alarm at 0x2f30, the PPM loop on the DT max_power_mw), and show they act.
  2. The thermal evidence does not test that. The die peaked at 41.5 °C on a fan-cooled J473, so no thermal path ran. This backend also reaches the fanless J413 (and J415/J493). Owed rows, once the alarm is answered (or the cap kept) so the run itself is protected: a sustained top-state load on J413 at 27.2 that reaches the throttle temperature, logging frequency, temperature and power and showing the clock comes down with no hang. Also a short clpeak/soak row on one more M2 (J493 or J415).
  3. gpu/v27_2.rs:941-943: with the alarm disarmed, the per-state threshold copy is dead configuration. Keep it only if (1) re-arms the alarm. Otherwise say in the comment that it is inert.
  4. gpu/v27_2.rs:119-120: unk_28 = 1 matches 13.5 (queue/compute.rs:145, unconditional), so it is fine as parity. One small point: "keeps the 13.5 layout field for field" in the message overstates it, because +0x2c/+0x30 (13.5 event_generation/event_seq) are not written the 13.5 way here (+0x34 = slot). Drop the claim or qualify it.
  5. Selecting the backend by the firmware-reported 27.2.0 (driver.rs:398) is pre-existing, and this PR adds no new gate. Not needed for this PR: a 13.5 row, since the file is not built into the 13.5 path.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formal §1–§6 pre-PR checklist review at live head 1bcdd7c0498ff7c7eab491542fef1357d4af5972 (base: satchlj/g14-v27-2-compute-only / #2610; 0 CI check runs because base is a feature branch rather than integration/aurora).

Code Verification

  • drivers/gpu/drm/asahi/gpu/v27_2.rs:119-120: Setting stream +0x28 to 1 matches 13.5 microseq::StartCompute::unk_28 (drivers/gpu/drm/asahi/fw/microseq.rs:347, populated as 0x1 in queue/compute.rs:145) for G14G (G < G14X).
  • drivers/gpu/drm/asahi/gpu/v27_2.rs:811-814: Removing the hardcoded STATE_CAP = 100 and passing DT ceiling = pwr.perf_max_pstate * 100 to globals +0x98 aligns with +0x88/+0x8c and removes an artificial cap.
  • drivers/gpu/drm/asahi/gpu/v27_2.rs:941-948: Offset 0x62b4 is indeed the word immediately before the HwDataShared3 table at 0x62b8..0x62f8 (corresponding to HwDataShared3.unk_8, which 13.5 sets to cfg.shared3_unk = 5 on T8112).

Checklist Summary & Blockers

  1. §3 Safety / §1 Cross-machine thermal protection (drivers/gpu/drm/asahi/gpu/v27_2.rs:944-948): This change unlocks all 8 DT performance states (lifting peak compute from ~1.0 to ~3.5 TFLOPS) while explicitly disabling the firmware's per-state temperature alarm (put32(policy, 0x62b4, pwr.perf_states.len() as u32) places its floor above every state). Although the fast_die0 PID (0x2270/0x22d4), SoC-hot (0x2f30), and max_power_mw power-budget controls remain populated, the only soak reported is 5 minutes on an actively cooled Mac mini (J473) reaching 41.5 °C — well below thermal throttling. Because driver.rs:395 routes all (G14, G) T8112 Macs — including fanless M2 MacBook Airs (J413/J415) — through gpu/v27_2.rs, please either:
    • prove on hardware that the remaining thermal/power controllers (fast_die0 / ppm) safely throttle sustained full-load compute at thermal equilibrium (especially on a passively cooled J413/J415 or thermal-stressed J473), or
    • clarify whether full 13.5 HwDataShared3 parity (unk_0=1, unk_4=500, unk_8=5, unk_4c=1) still hangs with stream +0x28 = 1 in place, and if 0x62b4 stays disabled, note why policy[0x62b8..0x62f8] still copies cfg.shared3_tab.
  2. §5 Evidence completeness: The J473 trial does not record the exact base integration/aurora commit / kernel build identifier or 0 failed units in the regression check, and the M2 Air 13.5 regression row is still listed under Still to run.
  3. CI / Stack dependency: 0 CI checks ran on 1bcdd7c049 (stacked on unmerged #2543 → #2544 → #2545 → #2610). Cannot be approved or added to MERGETRAIN-LINUX4 independently until CI runs green against the merged/target base (or folded into the parent series).

Checked & Clean

  • §2 Production-ready: Works on default kernel command line with no new module parameters.
  • §4 Clean-room & attribution: Single human commit (Ryan Murray <ryan@aurorasilicon.org>), human Signed-off-by only, zero AI trailers in commit; PR body includes Assisted-by.
  • §6 Naming: Clean (Aurora/Borealis naming; no forbidden terms).

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Author

Thanks, both. Point 1 is right. Unlocking the top states while the alarm is off isn't acceptable when the same backend reaches the fanless J413/J415. Plan:

  • The +0x28 word gets its own PR. It is plain 13.5 parity (point 4; I'll drop the "field for field" claim). It fixes the int8 dot-product and max_workgroup_memory.1 hangs independently of DVFS, so it can land at the stack's own cap of 100. Rows at cap 100 come with that PR.
  • This PR goes to draft. On Dj's question: the "13.5 parity" run did include +0x28 = 1, and it still hung at the top states. But it only wrote unk_4/unk_8/unk_4c next to the controller's table. It did not set unk_0, and it did not fill the second copy of HwDataShared3 that 13.5 also writes (hw_shared3 is used in two places). So the full 13.5 configuration hasn't actually been tested. The next row is exactly that: both copies, unk_0 = 1, cap at the DT ceiling. If it runs, the alarm stays armed with the 13.5 values and this PR becomes that change, so point 3 goes away. If it doesn't, I'll go with option (b): cap +0x98 at the highest state that runs with the alarm armed, and say which state that is.
  • Point 2. Agreed that the thermal path never ran on the J473. A J413 at 27.2 that reaches the throttle temperature, plus one more M2, are owed before the cap moves above what the alarm covers. We don't have a fanless M2 on 27.2 in our lab, so I'll ask for that row once the configuration is settled.
  • Dj's point 2. Base integration/aurora a463112, kernel 7.3.0-aurora-m2gpu1+ (base + drm/asahi: share the 26.x wire helpers and clean bound TTBAT slots #2543 → drm/asahi: report the G14 firmware-27.2 device as compute-only #2610 + this commit's content as module I2). The only failed unit in the trial boots was aurora-sep, which fails the same way on that day's production boot (SEP not admitted there). The 13.5 row isn't needed (point 5): the file is only reached on firmware 27.2.0.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide
RyanTheTide marked this pull request as draft November 23, 2026 02:50

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent source review at 1bcdd7c0498f. The current head still changes the alarm floor alongside the performance cap. The fan-cooled throughput row does not establish that the alarm remains active above the original cap. Keep this head draft. The compute start change can be reviewed independently at the existing limit, with the formerly hanging compute cases run again and no change to thermal handling.

@RyanTheTide

Copy link
Copy Markdown
Author

MERGETRAIN6 source review at 1bcdd7c0498f. Blocking: this change raises the performance ceiling and disables the corresponding hardware temperature alarm. Please keep this head in draft. The independent compute-start fix is already split out in #3031 at the previous ceiling. The widened range needs a machine-supplied, active protection policy and a row that verifies it.

Assisted-by: LLM (Codex)

@satchlj
satchlj force-pushed the satchlj/g14-v27-2-compute-only branch from 3515e7d to 6a15a79 Compare November 24, 2026 04:33
@RyanTheTide

Copy link
Copy Markdown
Author

Closing this experimental draft. The reviewed G14 firmware-27.2 series carries the production path and excludes these alarm and performance-state changes.

Assisted-by: LLM (Codex)

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.

3 participants