Repository navigation
drm/asahi: g16: drain the engine before a render of another VM - #3353
DjDeveloperr wants to merge 1 commit into
Conversation
69d102932933 ("drm/asahi: g16: pipeline warm cross-VM renders and
eliminate hold[0] drains") let a warm render of one VM queue on the
shared firmware TA/FS queue pair behind another VM's render. Every
VM's render passes go through that one queue pair.
With several clients at once this faults the GPU (linux#3201). On the
J773g, three deqp-vk processes over dEQP-VK.synchronization*multi_queue*
hit firmware recovery within seconds and fail-stop after a few
recoveries. The faults are in live VMs with work in flight: the VDM
reads the kernel prefix in its pass slot and the user control stream,
and the shader cores read from a null base, at addresses that are not
mapped in the context they run in. One client at a time never faults.
"keep renders of a multisampling VM apart from other VMs" covered the
multisampled case of the same thing: there, the two passes only had to
be published together, and only publishing one after the other retired
helped. Its MSAA-only rule does not cover linux#3201, whose passes are
single-sampled.
Use one rule instead: a render waits for every flight of another VM to
retire, as before 69d102932933. This replaces the multisampling VM mark,
its per-flight flag and the fold checks. Compute keeps running beside
another VM's compute on its own workqueue (62e450e), and renders of
one VM still pipeline. The cross-VM FS barrier that only served the
overlap goes away with it.
Closes: #3201
Signed-off-by: DjDeveloperr <[email protected]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
J516s (MacBook Pro 16" M3 Pro, G15S) row at
|
|
J713 (MacBook Air 13" M4, G16G) row with Symptom on main: two Kernels: three one-shot boots on the default cmdline, with this Mac's kernel config. The base is #3273
Borealis at aurora-wip
What sets it off, on the Mac's default kernel (main as of 2026-11-27 + display and power PRs) with the same Mesa:
Also: main The same parallel-only pattern on G15S (aurora-silicon/mesa#1152, blits with four processes) may have this cause too. Not tested here. |
There was a problem hiding this comment.
Superseded 12-01: not a hold under the merge bar (no shown failure). Final review deferred until #3185 lands; follow-ups: retarget, main CI (J713 PASS on file)
Verdict: HOLD at 456bce00
Blockers:
- Targets open non-
mainbase branchfix/g16-m4-no-ta-wave(#3185is stillOPEN); fullmainCI has not run.
Checked:
- Verified
#3185is stillOPENand base ref isfix/g16-m4-no-ta-wave(noteJ713M4 PASS row is recorded at456bce00). - Deferred final approval until
#3185lands and this PR is retargeted ontomainwith green CI.
Evidence
- Base ref:
fix/g16-m4-no-ta-wave(#3185state:OPEN).
Fixes #3201. Stacked on #3185.
What: on the g16 backend, a render now waits until every in-flight job of another VM has retired. This fixes linux#3201: GPU faults and fail-stops when several clients render at once.
needs_engine_drain()andcan_queue_behind()hold a render while any flight of another VM is in flight. This was the rule before 69d102932933.cross_vm_prev), which only served the overlap, is removed.vm.rsandcommand.rsare back to how they were before drm/asahi: g16: keep renders of a multisampling VM apart from other VMs #3180.Tested: J773g (M4 Mac mini, macOS 26B123 firmware).
Kits: built on the J773g. The measured fix is
8722b2e4bcf1, on baseef4979c9839a(main2094ccb2a036+ drm/asahi: g16: keep renders of a multisampling VM apart from other VMs #3180 + drm/asahi: g16: drop the M4 TA wave window #3185).This head:
456bce008249is the same patch (identicalgit patch-id) on drm/asahi: g16: drop the M4 TA wave window #3185's head068d90ee2055, which has main and the merged drm/asahi: g16: keep renders of a multisampling VM apart from other VMs #3180.Exact-head re-gate,
456bce008249built on the J773g, one boot, 0 GPU faults:timeline_semaphore.write_image_tess_control_read_blit_image.image_128x128_r8g8b8a8_unorm_exclusive, is the drm/asahi g16: timeline_semaphore write_image_tess_control_read_blit_image exclusive fails intermittently under parallel multi_queue (J773g) #3349 family. It hits a different format variant each full parallel run and passes when run alone. It's tracked in drm/asahi g16: timeline_semaphore write_image_tess_control_read_blit_image exclusive fails intermittently under parallel multi_queue (J773g) #3349 and not fixed by this PR.pipeline.monolithic.multisample.misc.multi_renderpass.r8g8b8a8_unorm_r16g16b16a16_sfloat_r16g16b16a16_sint_d32_sfloat_s8_uint.random_111alone: 5/5 pass.The drm/asahi g16: dEQP-VK.synchronization*multi_queue* faults the GPU and fail-stops it on J773g (main 61c7b88a) #3201 repro lists, full, on the fix, with system Mesa and 0 GPU faults on the whole boot:
dEQP-VK.synchronization*multi_queue*dEQP-VK.synchronization*.cross_instance.*api.copy_and_blitblit_image RGBA8/BGRA8 (recovers on stock with 8 jobs)The one multi_queue fail was
synchronization.op.multi_queue.timeline_semaphore.write_image_tess_control_read_blit_image.image_128x128_r32g32b32a32_sfloat_exclusive, "Memory contents don't match", with no GPU fault. It passed 30/30 when run alone on the fix. That case family fails once per full parallel run, on different variants, and is tracked in drm/asahi g16: timeline_semaphore write_image_tess_control_read_blit_image exclusive fails intermittently under parallel multi_queue (J773g) #3349.The same lists on the base, run on one boot after its perf rows, each stopping at its first GPU fault:
How it was isolated:
ef26a43be753, one boot, multi_queue with 3 workers:s2idle: one RTC s2idle cycle on the fix. It woke after 15 s, suspend success went up by 1, and there were no new kernel errors. Afterwards the gpubench smoke passed 7/7 rows with correct CRCs.
Cost: gpubench-vk 13, µs per submit, lower is better. Fix and base are each the median of 2 passes on one boot. Metal 4 values are native macOS 26B123 from the gpubench scoreboard.
Host: the asahi-m4 host selftests pass, 26/26 files.
test-publication.pynow expects a drain for a render of another VM, and its barrier-plan cases no longer takecross_vm_prev.Risk: two-way door.
Not yet: