Repository navigation
drm/asahi: admit the USC cache invalidate in the G15/G16 VDM root barrier - #2523
Conversation
d273ece to
e48f401
Compare
|
Independent check at e48f401:
|
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 <[email protected]>
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 <[email protected]>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial review of e48f4014 against the pre-PR checklist.
Checklist summary
- Code / UAPI / CI: 0 code blockers.
drivers/gpu/drm/asahi/g15/gate.rs:164anddrivers/gpu/drm/asahi/g16/gate.rs:117both mask strictly bit 3 (word & !VDM_ROOT_USC_INVAL != VDM_ROOT), admitting only0x21000960and0x21000968.drivers/gpu/drm/asahi/file.rs:589ORsDRM_ASAHI_FEATURE_VDM_USC_INVALIDATE(1ULL << 40) aftergpu.feature_flags(), clear of both canonical bits (0..38, plus39in#2059) and G15 native wire bits (0..8, legacy mask0xfc00).tools/testing/selftests/drivers/gpu/asahi-m4/test-stream-gate.pycovers both admitted words and rejections;host-testsis green.
- §1–§3, §6: Pass.
- §4 (Attribution): 1 blocker below.
Blocker
- §4 Attribution in commit message: Commit
e48f401422e4containsDeveloped with Claude Code.in the commit body. Per §4 of the pre-PR checklist, commits must carry human identity and a humanSigned-off-by:only (no AI attribution lines or trailers in commits). Please amend the commit to removeDeveloped with Claude Code.and replace the PR body footer (🤖 Generated with [Claude Code]...) with a plainAssisted-by:line at the end of the PR body.
§5 Evidence notes
- The J713 (M4) dEQP-VK results look solid; please also record the exact kernel commit/build tested and confirm the §5 regression check (0 SELinux denials, 0 failed units, 0 new kernel errors).
- G15 (
drivers/gpu/drm/asahi/g15/gate.rs) has not yet been tested on M3 Pro/Max hardware (noted in the PR body); a G15 hardware confirmation from someone with an M3 Pro/Max is still needed for full cross-generation §1/§5 coverage.
Assisted-by: LLM (Gemini 4 Neon)
e48f401 to
bf94abb
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Fixed the §4 attribution blocker in
|
|
Live hardware verification on M4 Mac mini (
We will follow up next with exact-head Assisted-by: LLM (Gemini:4 Neon) |
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 <[email protected]>
|
bf94abb only changes the commit message (same tree, 9439de11, and parent as e48f401), so our earlier check still holds. Thanks for the J773g row at bf94abb. It shows bit 40 exposed and no regressions on G16 (87/87 short mustpass, 3,710 indirect-draw passes, 0 EINVAL and no faults over the sustained run). It doesn't say whether that Mesa submits Assisted-by: LLM (Claude:Opus 5.5) |
…rier The G15 (M3 Pro/Max) and G16 (M4) VDM stream gates admit a render only when its VDM stream starts with exactly 0x21000960. Mesa's AGX3 render-start barrier sets bit 3, the USC cache invalidate (0x21000968), so that the USC sees memory written since the previous render; on those GPUs it has to leave the bit out, or the render is refused with EINVAL. Admit the root barrier with or without the invalidate in both gates. The other backends do not check the root word, so every GPU now admits it: report that on every GPU with DRM_ASAHI_FEATURE_VDM_USC_INVALIDATE, so userspace can set the bit whenever the kernel reports it and keep the plain word on older kernels. Bit 40 is unused in both the canonical and the G15 feature numbering. Signed-off-by: Erik Bourget <[email protected]>
bf94abb to
a59a31a
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Rebased cleanly onto
Remaining runs are the live Borealis |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist re-review at live head a59a31a085ad: APPROVE.
Checklist verification
- §1 (No model gating): Reports
DRM_ASAHI_FEATURE_VDM_USC_INVALIDATE((1ULL) << 40) unconditionally on every GPU via sharedGET_PARAMS(drivers/gpu/drm/asahi/file.rs:589), cleanly following bit 39 (DRM_ASAHI_FEATURE_ASYNC_SUBMIT) after rebase ontointegration/auroraand clear of G15's wire numbering (0..8). Zero model or SoC gating. - §2 (Production-ready, no hacks): Works on the default kernel command line with zero hacks or parameters.
- §3 (Safety): Both
drivers/gpu/drm/asahi/g15/gate.rs:199anddrivers/gpu/drm/asahi/g16/gate.rs:249strictly mask only bit 3 (word & !VDM_ROOT_USC_INVAL != VDM_ROOT), admitting only0x21000960and0x21000968. - §4 (Clean-room & attribution): Prior blocker resolved. Single commit
a59a31a085adcarries human author/committer and humanSigned-off-by:only (zero AI lines/trailers in commit message), and the PR body ends with a plainAssisted-by:line. Not superseded onintegration/aurora. - §5 (Evidence) & CI:
host-testsCI is green;test-stream-gate.pypasses 10/10,ARCH=arm64 LLVM=1build andcheckpatch.plare clean. Live hardware verified on J773g (Apple M4 (G16G B0), identical logic atbf94abb36db0: bit 40 exposed viaGET_PARAMS, 87/87vk-mustpass-short, 3,710/0dEQP-VK.draw.*indirect*, 452,293 sustained jobs with 0EINVALand 0 GPU faults/dmesg errors) plus prior J713 M4 A/B with Borealis submitting0x21000968(fixing 624glsl.loops.*and 2,970 fp16 graphics lost-device failures). (M3 Pro/Max G15 and live J773gmesa#691runs remain tracked as follow-up rows.) - §6 (Naming): Clean (uses Borealis).
Assisted-by: LLM (Gemini 4 Neon)
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 <[email protected]>
Problem
Fixes #2513.
The G15 (M3 Pro/Max) and G16 (M4) VDM stream gates admit a render only when its VDM stream starts with exactly
0x21000960. Borealis's AGX3 render-start barrier sets bit 3, the USC cache invalidate (0x21000968), so the USC sees memory written since the previous render. On those GPUs that word is refused withEINVAL, so Borealis has to leave the bit out there (aurora-silicon/mesa#563).Change
Implements what #2513 proposes:
drivers/gpu/drm/asahi/g15/gate.rsanddrivers/gpu/drm/asahi/g16/gate.rs) admit the root barrier with or without the invalidate (word & !VDM_ROOT_USC_INVAL == VDM_ROOT).DRM_ASAHI_FEATURE_VDM_USC_INVALIDATE(1ULL << 40) ininclude/uapi/drm/asahi_drm.hto tell userspace that the kernel admits it. The other backends never check the root word, so every GPU admits the invalidate once both gates do, and the bit is reported for every GPU from the sharedGET_PARAMSpath (drivers/gpu/drm/asahi/file.rs).Bit 40 follows
DRM_ASAHI_FEATURE_ASYNC_SUBMIT(bit 39). G15 numbers its own feature bits differently (g15/wire.rs), but those stop at bit 8, so bit 40 is unambiguous there.The Mesa side is aurora-silicon/mesa#567 (and aurora-silicon/mesa#691): Borealis sets the invalidate on every chip when this bit is reported, and keeps #563's plain word on G15S, G15C, and G16G for kernels without it.
Testing
At head
a59a31a085ad(rebased cleanly ontointegration/auroraa9626a1487ad, resolvinginclude/uapi/drm/asahi_drm.hcontext after bit 39; identical logic tobf94abb36db0):ARCH=arm64 LLVM=1, Rust 1.99.0,CONFIG_DRM_ASAHI=y,CONFIG_DRM_ASAHI_G15=y,CONFIG_DRM_ASAHI_G16=y):drivers/gpu/drm/asahi/(asahi_core.o,built-in.a) compiled cleanly with 0 errors and 0 new warnings.python3 tools/testing/selftests/drivers/gpu/asahi-m4/test-stream-gate.pypassed 10/10 (verifying0x21000960and0x21000968are admitted and other root words are rejected).scripts/checkpatch.pl --git origin/integration/aurora..HEAD: 0 errors, 0 warnings.Hardware runs:
Apple M4 (G16G B0),0x8132,rev=0x10, tested by @DjDeveloperr at exact headbf94abb36db0, identical code diff):7.3.0-ARCH-m4prod12foldingbf94abb36db0:DRM_IOCTL_ASAHI_GET_PARAMS(/dev/dri/renderD128):features = 0x0000010240005c06—bit 40(DRM_ASAHI_FEATURE_VDM_USC_INVALIDATE) =True,bit 33(RENDER_STAGE_PREFIXES_V2) =True./opt/mesa-v7-tc):vk-mustpass-short87/87 PASS, fulldEQP-VK.draw.*indirect*3,710/0 PASS (3,898total,188NotSupported).dcp73a): 57/57 Wave-1gpubench+ 10/10concurrent.sram(452,293 jobs / 835,500job_cmds): 0EINVAL, 0 GPU faults/recoveries/hangs, 0 kernel GPUdmesgerrors.f394860d69ffonrelease/7.3.0-409125b3147583, identicalg16/gate.rs,g16/params.rs,file.rs, and UAPI bit 40 change), compared against unpatchedrelease/7.3.0-40with both Mesa builds:glsl.loops.*(624) and an fp16 graphics set (2,970) pass. Before this change, every case in both was a lost device.spirv_assembly.instruction.graphics.float16.logical_nan.opfunordequal_vector_geom) hangs the GPU with the plain word on the unpatched kernel too, so that hang is not from this change.Tested-by: @DjDeveloperr
Still to run
aurora-silicon/mesa#691) submitting0x21000968on this kernel.Assisted-by: LLM (Anthropic:Claude, Google:Gemini 4 Neon)