Repository navigation
drm/asahi: g16: drain the engine before a render of another VM - #3353
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 <hey@djdev.me>
|
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).
Bring in main up to 1b2c361. engine.rs: keep main's compute UMA slot conflict (compute_uma_conflict and Flight::compute_uma_mask) in needs_engine_drain(). Keep the TA and FS ring order of #3483 and #3499: same-VM TA->TA and FS->FS barriers are still left to the rings and counted. With every render of another VM drained first, the predecessor on the rings is always of the same VM, so the cross_vm_prev input of ta_ring_orders_prev() and fs_ring_orders_prev() goes away. Main's multisampling rule stays covered: this branch already replaces it with the wider cross-VM drain. test-publication.py: keep main's compute UMA, ring-order and TA producer stats tests on the new signatures. Drop the multisampling fold and VM-mark tests, whose code this branch removes. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
Forward-merged main: new head Conflicts (
Checks (pc, x86_64 → arm64, LLVM, rustc 1.100.1):
Rows: the J516s and J713 rows above are at |
…ompute-service-stamp Bring in #3353's branch, which now carries main up to 1b2c361. Main moved the TA, FS and compute service stamps out of the notifier pages, which it maps ASC-cached, into each queue's own uncached user_stamp cell, and dropped the notifier context checks from retirement. The StampCell accessors of this branch now name those cells: ComputeGraph::service_stamp() is user_stamp, and RenderGraph::{ta,fs}_service_stamp() are user_stamp[0] and [1]. Work items, retirement and the cross-engine barriers all go through them, so the barriers still wait on the cell the firmware stores after servicing the record. Retirement keeps main's logic and reads through the accessors. The selftests check the accessors against the user_stamp cells, and that no work item or barrier names a user_stamp VA directly. Signed-off-by: DjDeveloperr <hey@djdev.me>
…r-pairs-on-3201 Bring in #3370's branch, which now carries #3353's branch and main up to 1b2c361. Main changed the one render graph that this series splits into pairs. Each pair now takes main's layout: its FS fw_stamp comes from the firmware-cached ring allocator, it has its own ASC-cached FS notifier page, and the shared scheduling context, now allocated in Graphs::finish(), is handed to every pair there. Pair 0 keeps the allocation order, and later pairs share its legacy_empty and registration barrier as before. Retirement keeps main's model per pair: the uncached TA and FS service stamps gate it, the recovery-suspect path falls back to the stage fw_stamps, and the notifier records are never read. The pair's own targets and the latched per-flight TA/FS channel receipts of this series take the place of main's single-pair queue_passed() and queue_receipt(). Progress, the recovery snapshot and the report read each pair's FS user_stamp[1], as main does for its one pair. Render barriers: behind a render on another pair, the stage-order waits on that pair's fw_stamps are always posted. Behind a render on this pair, which is always of the same VM, the TA->TA and FS->FS barriers are left to the ring's order as in #3483 and #3499, and counted. The counters still commit only on TA producer publication, now on the pair's queues. needs_engine_drain() keeps main's compute UMA slot conflict. Selftests: the mocks index render pairs and read the service stamps. This series' pair tests now set the service stamps instead of the notifier, and main's tests carry the pair fields. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
J773g (M4 Mac mini, T8132, G16G B0) hardware row PASS for the
|
|
J516s (MacBook Pro 16" M3 Pro, T6030, G15S B1) second-generation row at
|
|
Verdict at Blockers: none. Checked
Evidence
|
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: