Repository navigation
drm/asahi: g16: fail unfinished renders on a failed render's pair - #4032
Conversation
At the phase-1 halt of a firmware recovery, g16 fails every flight the firmware's affected-work snapshot names, and every unfinished flight of the VM whose fault is latched. Any other unfinished render is only suspect: it still retires on its ordinary receipt after the resume. That receipt does not prove the render ran. On the J773g under macOS 26B123, a render command buffer queued behind one that hung never ran (no GPU time, no fragments), yet after the one recovery its notifier record had counted all of its works, held its last FS work and was unlinked, and the FS service stamp had moved to its target: what a normal completion writes. Metal fails such a buffer as an innocent victim. A hang latches no fault, and a render of another VM on the same TA and FS queues is not of the faulting VM, so g16 can report success for render work that never ran. Fail every render flight that is unfinished at the halt on the TA and FS queue pair of a failed render, whatever its VM. Renders on other pairs and compute keep their rule. The publication selftest covers a render of another VM unfinished at the halt on the failed render's pair, with and without a latched fault, on another pair, a recovery that fails no render, and renders that finished before the halt. 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. |
RyanTheTide
left a comment
There was a problem hiding this comment.
Reviewed a4e1852. The recovery snapshot limits collateral failure to unfinished renders on a pair with a failed render. The second pass leaves completed renders, compute and other pairs out of the new rule. The reported host regression distinguishes false success. Hardware rows are pending.
|
J516s (M3 Pro) g16batch row: FAIL (judge exit 1). Except for one CPU-time flag that looks like noise, every failure also happens on base. For this PR (hang step): case 1 is clean in every round on both arms. In case 2, the other client still gets a lost device in 2 of 3 rounds, the same as base. Kernel Same on both arms:
Why the judge says FAIL:
The J516s is back on its stock kernel ( |
|
J516s |
|
The J516s run lost the different-pair client on both arms, so it did not prove isolation. The remaining row at |
J773g (Mac mini M4, T8132, G16G B0)
|
|
Follow-up to the J773g g16batch row above. The case-2 ECANCELED is not caused by this PR. It happens on base
It only happens when the hung render took the innocent's second slot, which explains 2 of 3 rounds. The event code doesn't matter. With 9 clients (case 1), other clients' renders free the slot, so case 1 never hit it. The fix is not small: a queued render must be able to use a spare that is added after it was submitted. It needs its own PR and row. This PR's case can't be built across processes. A new J773g proof kit runs that case. It uses one VkDevice with two queues: a hang on queue A and 3 checked renders on queue B behind it. It reads each fence's result from the kernel through a sync_file, because Mesa reports every wait as device lost once the VM fails, which would hide a false success. A control client renders on another pair during each round. Pass for this PR: 0 false successes on the 4032 or batch arm, and the control keeps rendering. It reuses the |
|
Hardware row at head Kit: Findings:
|
|
J773g (Mac mini M4, 27.2) row at head 8e659f9: PASS.
|
|
Merged as 8ae72dc at head 8e659f9. Merge-tree check before the merge: main be72f78 + 8e659f9, tree fb26bc113f09, clean merge on the GitHub compare base c042c5f.
Hardware gate: the J773g row PASS at this head, posted above at 05:15Z (kit work/j773g-g16-4034-4032-main-v4-20261204). |
What: After a GPU recovery, g16 could report success for a render that never ran: a render of another process queued on the same TA/FS queue pair as the one that hung or faulted. Fail those renders.
Tested: No hardware run at the head of this PR. Local checks at
a4e1852dc19d: arm64 W=1 build ofdrivers/gpu/drm/asahi(clang) with the same warnings as main,run-host-tests.py --only asahi-m41/1 and--only g162/2, checkpatch --strict clean; the new selftest fails without the driver change.Risk: two-way · M4 (T8132) and M3 (T8122, T6030), which share the g16 backend. After a hang or a fault, a render of another VM that shares the failed render's queue pair now ends with an error instead of a possible false success. Other pairs and compute keep their behaviour.
Not yet: J773g and J516s rows at the head of this PR: (1) one process hangs a render while a second process shares its queue pair (more rendering processes than pairs) and reads its image back: an error is right, success with a missing image is wrong; (2) the same with the second process on its own pair: it must keep running; (3) VK-CTS robustness and GPU-fault groups, base against head.
Details
At the phase-1 halt of a firmware recovery, g16 fails every flight the firmware's affected-work snapshot names, and every unfinished flight of the VM whose fault is latched. Any other unfinished render is only suspect, and it still retires on its ordinary receipt after the resume.
That receipt does not prove the render ran. On the J773g under macOS 26B123, a render command buffer queued behind one that hung never ran (no GPU time, no fragments). After the recovery its notifier record had still counted all of its works, held its last FS work and was unlinked, and the FS service stamp had moved to its target, which is what a normal completion writes. Metal fails such a buffer as an innocent victim.
recovery_prepare_suspects()now collects the queue pairs of the renders the recovery fails, named by the snapshot or owned by the faulting VM, and also fails every render flight on those pairs that was unfinished at the halt. The macOS measurement covers one TA/FS queue pair, so renders on other pairs stay suspect as before.Evidence
The publication selftest runs the production function for: a render of another VM unfinished on the failed render's pair, with and without a latched fault; the same on another pair; a recovery that fails no render; renders that finished before the halt.
Checks ran on main
d1ae4f292b93plus this branch.