Repository navigation
agx: keep the plain render-start barrier word on G15S, G15C and G16G - #563
Conversation
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>
|
Thanks for tracking this down. We checked the kernel side: On aurora-wip e7e9ef3 + this head (44f2692) + #562, an x86 clang build with the drm-shim tools gives 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. |
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 exactly0x21000960, so every graphics submission on those machines fails with EINVAL and Vulkan reports a lost device: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,t6031andt8132backends). The comment onagx_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:
glsl.loops.*: 624 lost devices before, 624 passes with this change.asahi-agx3-packing, which now checks the word per chip.🤖 Generated with Claude Code