Skip to content

agx: keep the plain render-start barrier word on G15S, G15C and G16G - #563

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
ewb/g16-graphics-submit
Nov 20, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
ewb/g16-graphics-submit

Conversation

@erikwb

@erikwb erikwb commented Nov 20, 2026

Copy link
Copy Markdown

Since #434, every AGX3 render-start VDM barrier is 0x21000968 (the USC cache invalidate set). The kernel's G15 (M3 Pro/Max) and G16 (M4) backends admit a render only when its VDM stream starts with exactly 0x21000960, so every graphics submission on those machines fails with EINVAL and Vulkan reports a lost device:

aurora: G16: rejecting VDM root record at 0x5bfdd68000: 21000968 00000000 00000000 00000000

This puts G15S, G15C and G16G back on the plain word, in both the barrier packer and the shared VDM barrier emitter (agx_vdm_barrier). Every other chip keeps the invalidate that #434 added. It also restores the G15S drm-shim gate to the kernel's strict check; the looser shim check is why the packing tests did not catch this.

cc @term-guy, since this partly reverts #434 on these three GPUs.

Trade-offs

This selects by chip ID, not by a hardware property. The property that actually matters is "this kernel backend admits only the plain word", and the kernel does not report it, so the chip list mirrors the kernel's G15/G16 admission rule (the apple,agx-t6030, t6031 and t8132 backends). The comment on agx_vdm_barrier_core_word() says so.

The cleaner fix is in the kernel: let the G15/G16 gate accept the word with or without the invalidate, advertise that with a feature bit, and have Mesa set the invalidate when the bit is present. That needs testing on an M4 first, and older kernels would still need this fallback, so it can follow this PR.

Testing

Tested on an M4 (G16G) under Linux:

  • dEQP-VK glsl.loops.*: 624 lost devices before, 624 passes with this change.
  • An fp16 graphics set: 2,970 lost devices before, 2,970 passes.
  • The full fragment-shader set (47,630 cases) gives the same results as the base before agx: invalidate the USC cache in the G17G render-start VDM barrier #434; compute results are unchanged and dmesg is clean.
  • Mesa's tests pass, including asahi-agx3-packing, which now checks the word per chip.

🤖 Generated with Claude Code

Since e86c385 every AGX3 render-start VDM barrier carries the USC
cache invalidate (0x21000968). The G15 (M3 Pro/Max) and G16 (M4) kernel
backends admit a render only when its VDM stream starts with exactly
0x21000960, so every graphics submission on those chips failed with
EINVAL and the device was lost; compute was unaffected.

Pick the word per chip: G15S, G15C and G16G keep 0x21000960, the other
chips keep the invalidate. The barrier packer and the shared VDM barrier
emitter (agx_vdm_barrier) both use agx_vdm_barrier_core_word(). The G15S
drm-shim stream gate again refuses any other root word, as the kernel
does.

Developed with Claude Code.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb
erikwb marked this pull request as draft November 20, 2026 04:14
@RyanTheTide

Copy link
Copy Markdown

Thanks for tracking this down. We checked the kernel side: drivers/gpu/drm/asahi/g15/gate.rs:159 and g16/gate.rs:114 (integration/aurora 449c6a19e88d) do compare the VDM root word against exactly 0x21000960. That matches your M4 EINVAL, and it explains why our #434 rows were clean: our M4 Pro runs on the G17 backend, which has no such gate.

On aurora-wip e7e9ef3 + this head (44f2692) + #562, an x86 clang build with the drm-shim tools gives meson test --suite asahi 204/204. That includes asahi-agx3-packing (the per-chip word) and the G15S shim tests with the strict gate. The other chips still get the invalidate, so our lab GPUs see no change.

We'll merge as soon as you take it out of draft. For the kernel follow-up (gates accept the word with or without bit 3, plus a feature bit so Mesa can drop the list), we've opened a tracking issue on the kernel repo; it links back here.

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