Skip to content

drm/asahi: g17: avoid redundant J716C render notifications - #1958

Open
satchlj wants to merge 3 commits into
aurora-silicon:integration/aurorafrom
satchlj:m5-g17-tiling-kick-inner-notify-20261115
Open

satchlj wants to merge 3 commits into
aurora-silicon:integration/aurorafrom
satchlj:m5-g17-tiling-kick-inner-notify-20261115

Conversation

@satchlj

@satchlj satchlj commented Nov 15, 2026

Copy link
Copy Markdown
Member

Claude Fable 5.2 on @satchlj's behalf.

Summary

This is a two-commit J716C render-path series:

  1. Run J716C tiling kicks without the redundant entry-signal event. Other M5 variants retain the event.
  2. When a J716C render pair is already installed and another pass is in flight, omit the redundant inner item-ring notification and keep the previous item targets. The ordinary item windows remain in place for first use, drained restart, rebind, priority or configuration changes, identity/context updates, and lead commands. Zero-length windows retain the pass stamps, pool accounting, job-list state, and the other retirement witnesses.

The source guard is deliberately narrow: the path must be M5, not J813, and the selected board must have four clusters. In the current T6050 table that is the J716C M5 Max/G17C configuration; J714 M5 Pro, J775D M5 Ultra, and J813 M5 do not satisfy it.

Performance

Each benchmark cell was a fresh boot and used 15 independent processes per workload, pinned to CPU 12, with timestamps disabled, 200 ms warm-up, a 3 s measurement window, and alternating test order. Userspace was a private per-process Mesa/ICD selection with no system installation. The upstream Mesa B base was b6c070c5d611; the final two-commit row used a7e10e986ed, whose unrelated compute-tail declaration remains RFC and is not part of this PR.

Kernel Opaque fill (us/submit) Blended fill (us/submit) Render (us/submit) Queue hop (us/hop)
upstream baseline 79.7851 306.9054 257.7541 207.0393
+ ungated J716C tiling 79.7787 306.9054 244.7980 214.8382
final two-commit composition 79.7915 306.9054 242.0331 211.0892

The tiling commit alone reduced render time from 257.7541 to 244.7980 us/submit (-5.03%); the final composition measured 242.0331 us/submit. Opaque and blended fill were unchanged. Queue hop has no intended path change and no supported improvement here; the final 211.0892 versus 207.0393 us/hop movement is +1.96%. All 60 final benchmark processes succeeded.

Exact hardware-tested composition

The hardware run was on one J775c Mac Studio with an M5 Max (G17C), using fresh boots. Its kernel composition was:

PR #1618, PR #1619, and the name shim are not in this pull request.

The current integration tip is still fc050503ffcd. Cherry-picking the two review commits produced a1efa1537025 and 000b48471371; git range-diff reports both commits as identical, and the affected G17 parent files matched byte-for-byte. There were no conflict resolutions or semantic/context edits. The PR branch itself was not booted; the hardware evidence above applies to the exact tested composition.

Stability

The final fresh-boot, no-retry gate produced:

Selection Pass NotSupported Fail DeviceLost Crash ResourceError
six-client reproducer 90 0 0 0 0 0
synchronization 2,880 0 0 0 0 0
synchronization2, final 49,144 32,467 0 3 3 0
synchronization2, baseline 49,109 32,467 31 6 3 1

The aggregate final gate had 35 more Pass rows and 35 fewer loss rows, but case identity was not monotone: one baseline aggregate run had five cases pass that became three DeviceLost and two Crash rows in the final run, while 40 baseline loss rows recovered. These commits are not claimed to fix those cases.

Each moved case was then rerun ten times alone on each kernel and ten times in its original 200-case shard alongside five concurrent 200-case shards:

Case (original position/shard) Baseline alone Two-commit alone Baseline in six-shard load Two-commit in six-shard load
multi-queue binary, tess-eval -> copy image (36287/181) 10 DeviceLost 10 DeviceLost 10 Pass 10 Pass
single-queue timeline, draw-indexed -> tess-eval (69340/346) 10 DeviceLost 10 DeviceLost 10 Pass 10 Pass
single-queue timeline, draw-indirect -> tess-eval, specialized (69426/347) 10 DeviceLost 10 DeviceLost 9 Pass / 1 DeviceLost 10 Pass
signal-order timeline, tess-control -> tess-eval (78394/391) 10 Crash 10 Crash 10 Crash 10 Crash
signal-order timeline, vertex -> tess-eval (78534/392) 10 Crash 10 Crash 10 Crash 7 Crash / 3 Pass

The isolated outcomes were identical between kernels. Under repeated six-shard load the two-commit tree was no worse in any case and better in two observed cells. This supports treating the five aggregate movements as pre-existing context/load-sensitive instability, not a regression or repair attributable to this series.

Scope and checks

Only J775c hardware was run. No J714/M5 Pro, J775D/M5 Ultra, J813/M5, or other J716C/M5 Max machine was tested. The source gate affects every current T6050 configuration that selects the four-cluster J716C board, even though the hardware evidence is from J775c only.

  • strict checkpatch: 0 errors, 0 warnings on each commit;
  • G17 host tests: 32/32 passed;
  • exact J775c test config used as input, retaining CONFIG_DRM_ASAHI=y and CONFIG_DRM_ASAHI_M5=y after olddefconfig under the builder toolchain;
  • W=1 build: drivers/gpu/drm/asahi/asahi_core.o and the full drivers/gpu/drm/asahi/ directory aggregate built successfully.

🤖 Generated with Claude Code

J716C does not require an entry-signal event on a tiling kick.  Avoid the
redundant firmware round trip, matching the already-qualified zero-event
form used by candidate 44 on this board.

Keep the event on other M5 variants.  A fresh J775c boot with upstream
Mesa B reduced render submit time from 257.754 to 244.798 us (-5.03%);
opaque and blended fill were unchanged.  In the final two-patch series,
render measured 242.033 us/submit.

The final J775c no-retry gate passed alone6 90/90 and synchronization
2880/2880.  Synchronization2 recorded 49144 Pass, 32467 NotSupported,
3 DeviceLost and 3 Crash, improving the upstream baseline of 49109 Pass,
31 Fail, 6 DeviceLost, 3 Crash and 1 ResourceError.

Signed-off-by: Satya Benson <satya@benson.earth>
An installed J716C render pair with another pass in flight needs no new
queue configuration, lead command, or item-ring notification.  Keep the
previous item targets and publish only the new kick through the existing
host-port transaction in that steady state.

Retain the ordinary item windows for first use, drained restarts, rebinds,
priority changes, configuration updates, and lead commands.  Zero-length
retirement windows still retain pass stamps, pool accounting, job-list
state, and every other completion witness.

On a fresh J775c boot with upstream Mesa B, the two-patch series measured
79.792 us opaque fill, 306.905 us blended fill, 242.033 us render, and
211.089 us/queue hop.  A separate fresh boot of this stage measured
230.645 us render; both runs improve on the 244.798 us tiling-only result.

The no-retry gate passed alone6 90/90 and synchronization 2880/2880.
Synchronization2 recorded 49144 Pass, 32467 NotSupported, 3 DeviceLost
and 3 Crash, improving the upstream baseline of 49109 Pass, 31 Fail,
6 DeviceLost, 3 Crash and 1 ResourceError.

Signed-off-by: Satya Benson <satya@benson.earth>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the careful measurements and the exact tested composition.

We usually enable an improvement wherever the hardware supports it, rather than on the board it was qualified on. Here both changes are limited to M5 parts with four clusters:

  • drivers/gpu/drm/asahi/g17/queue/render.rs:1038-1039 (&& !self.board.is_some_and(|board| board.clusters == 4))
  • drivers/gpu/drm/asahi/g17/queue/render.rs:1101-1102 (sparse_inner = m5 && !j813 && ... clusters == 4)

The comments justify this with "qualified on this board", not with a hardware difference. The redundant entry-signal event and the extra inner notification look like firmware protocol behaviour that the M5 Pro, the M5 Ultra and possibly the A18 Pro share.

Could you either make both the default for every G17 configuration that uses this kick format, or explain in a comment what in the hardware or firmware differs on the other configurations? If you widen it, we can run render rows on our A18 Pro and M4 Pro.

Use the GPU ID-selected firmware configuration to opt into ungated
tiling kicks and host-port-only publication for retained render pairs.
The G17C image supports both forms. Keep the established publication
for G17S, G17D and the common 26A428 interface pending qualification.

Signed-off-by: Satya Benson <satya@benson.earth>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@satchlj

satchlj commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

Claude Fable 5.2 on @satchlj's behalf

c857ff49e74d replaces both cluster-count gates in g17/queue/render.rs with a capability in the GPU ID-selected firmware table. It stays enabled for G17C 26A428. G17S uses completion-class inputs, G17D has distinct kick encodings, and common 26A428 publishes item-ring descriptors, so those paths keep their current publication. The arm64 DRM object and four Apple DTBs built, and all 32 G17 host runs passed. Checkpatch only flagged the co-author trailer casing. This has not been re-tested on hardware since the change. A J613 row will follow separately. This G17C path still needs its own render row.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for c857ff4. Selecting the host-only kicks from the firmware table, with the comment naming the interface differences on the other configurations, covers the point we raised. The G17C render row on this head is the remaining item; the red host-tests job failed in apt (network), so a re-run should clear it.

@satchlj

satchlj commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf. J775c (Mac Studio M5 Max, G17C) render row for this head, as asked. Firmware 27.0 / 26A428.

Result: this PR does not slow rendering, and does not regress anything we measured. Raster submissions are equal or 3–23% faster than its base.

Method: base fc050503 and head c857ff49 (base plus this PR's three commits), built from one worktree and one .config, same toolchain, same J775c DTB and command line, booted alternately (base, head, base, head) as one-shot trials, three repeats per boot. Same Mesa on every boot (our 594d736efc plus aurora-wip 6edf62bcfd0, which accepts both the asahi and aurora driver names; the head registers as aurora 1.0.0). The SD-card-reader PCI probe was blacklisted on the command line to get past a separate early boot failure in that path that also occurs on the current integration tip.

Case (µs per submission) Base fc050503 (2 boots × 3) Head c857ff49 (2 boots × 3) GPU execution per submission, base / head
render.light QD1 250.4–255.1 231.3–245.8 23.2–23.4 / 23.2–23.4
render.light QD4 40.1–42.4 32.0–33.2 22.4–22.5 / 22.3–22.5
render.heavy QD1 602.4–613.5 584.1–594.5 389.6–389.8 / 389.6–389.8
render.heavy QD8 306.6 306.6–309.0 306.5 / 306.5
  • GPU execution time per submission is identical within 0.2 µs on base and head in every case; the head's lower time per submission fits the PR's stated aim of omitting redundant render notifications.
  • No GPU fault, timeout or error in any kernel log. All four return reboots were clean.
  • Not measured: ray tracing. All three RT scenes failed on both base and head (36 of 36) with Mesa's M5 compute launch exceeds the current resource profile; setting ASAHI_M5_LAUNCH_DEBUG=1, which only adds printing, makes them pass, so it is timing-dependent. The same Mesa passes them every time on our older default kernel. It affects base and head equally, so it is not this PR.

Separate from this PR, and reported here because it showed up in this row: on both base and head the GPU executes the same workloads much more slowly than on our older default kernel on this machine (for example 389.7 against 165.5 µs per submission at render.heavy QD1, and GPU time barely falls with queue depth where it falls sharply on the old kernel). That fits a GPU performance state that does not rise under load on current trees, but we could not read the clock during the runs (agx_stats reports pstate_status unavailable while busy). We are bisecting it on the J775c now and will report what we find.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the J775c row on c857ff4. Equal GPU time with 3-23% lower time per submission and no faults is what we hoped to see; once the queued check finishes this is ready for the next step.

@satchlj

satchlj commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: follow-up to the J775c (lobata) row. The slowdown in the base is fixed by #2080 (a250d9c), which landed after this PR's base. J775c confirms it: with the controller defaults applied, render.heavy GPU time goes from 389.7 to 83.5 µs at QD1 and from 306.5 to 64.8 µs at QD8. This PR itself showed no slowdown relative to its base.

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.

2 participants