Repository navigation
drm/asahi: g17: order task-stage tiling behind the last task-stage fragment - #2629
Conversation
|
An early read while the rows are pending:
The KUnit cases cover the selection and Assisted-by: LLM (Claude:Opus 5.5) |
|
M5 Pro (J714s, G17S) row for 796130c: fixed. Task-stage ordering on: 40 of 40 clients pass. Ordering off: 8 of 8 lose their device. Setup
Results
Before this PR: on the default kernel without it, the same 8-client run lost all 8 devices on two clean boots. The runtime then stopped for every client until reboot. Where the stalled renders stop The ordering-off run used this PR's new timeout record:
Not covered by this row
The M5 boot partition was restored byte for byte afterwards, and the GPU was live at the end of the slot. Still pending before merge: the G17P (Neo) row (mesh_shader.ext.* at 8 workers), the independent review, and the macOS multi-process mesh capture (the order changes to copy macOS if it differs). |
1722932 to
fa5833e
Compare
…agment Eight clients running one task-stage (mesh shading with an API task stage) render each on J714s never finished: every render's tiling kick started (the first four 8 to 11 ms apart), both rings were consumed (done == read == write), the fragment end word was never written and no completion stamp ever came, while other work kept retiring. One client alone finishes the same render in about 90 ms. The watchdog failed the first client after 2 s and the other seven after 18 s, and those give-ups stopped the runtime for every client until reboot. On the J813 the tiling kick of every render already waits for the last fragment kick published on any pair, as macOS 27.0 orders them there (7595d75). Order renders with an API task stage the same way everywhere else, among themselves: a task-stage render's tiling kick waits, in class 2, for the fragment kick of the last task-stage render published on another pair. Two clients' task-stage tiling then never runs at once. A pair's own earlier kicks need no such wait: its tiling ring already runs them in order. The order follows from the work, not the board; renders without a task stage are not ordered, as before, and the J813 order is unchanged. The order is released when a pair holding a task-stage group fails or is quarantined, or when the firmware drops its groups, so later task-stage renders do not wait for a fragment kick that may never complete. It only sequences tiling and carries no data, so dropping it is always safe; after such a failure the next task-stage render may overlap one still running elsewhere, once. The render timeout record now also prints the four M5 stage words (tiling start and end, fragment start and end), so a stalled render says which half stopped, and it reports up to eight timeouts per boot instead of four. Signed-off-by: Diljit Singh <hey@djdev.me> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fa5833e to
ab5c8a9
Compare
|
M5 Pro (J714s) row for the current head ab5c8a9: clean. 48/48 8-client runs pass, and the order now also contains a hung task shader instead of letting it spread. Kit: built at slot start on the running default 7.3.0-m5-sship4 (fd2587c) + #2500 (d5d966b) + this PR's exact head ab5c8a9 + the test-only order switch (not in this PR). Native warm build on the M5, packed with the default's own DTB, one boot.
The review asked whether a hung task-stage render would chain every later client behind it under this order. On hardware it's the other way round:
Not covered by this row: a non-task render hanging ahead of a task-stage render on the same pair. The release path for that is in After the slot: the default sship4 was verified, the ESP was byte-identical to the slot start, and the GPU was live at the end. |
|
Independent review: passed at ab5c8a9 (fresh read-only reviewer agent; three rounds)
Hardware rows: #2629 (comment) (796130c) and #2629 (comment) (ab5c8a9). Still outstanding, as a follow-up and not a merge gate: a macOS capture of several processes running task-stage renders, to confirm or replace this order with macOS's own (the trace lane is re-running it). |
macOS reference: task-stage kick order across processes (J714s, macOS 27.0)#2629 orders task-stage tiling across pairs. That order was empirical: the M5 A/B backed it, but no macOS capture had a task-stage render. We now have two captures from the M5 Pro. Each ran macOS under the HV tracer with three processes drawing object+mesh pipelines into offscreen targets at the same time, plus a fourth process drawing a mesh-only pipeline as a control.
The order macOS followsThe same order held in both captures and on every kick:
macOS doesn't serialise task-stage tiling across processes on the host side
What this means for #2629macOS has no cross-process order for task-stage work, so #2629's wait isn't macOS's. Copying macOS literally would mean removing it. #2629's own A/B, though, lost 8/8 clients without the wait. So the wait is hiding some other way our task-stage kicks differ from macOS's, and these captures don't show that difference in the kick dependencies. They do show one candidate difference in how the TA command is bound. It is the same for task-stage and plain renders, at both loads:
(Edit: an earlier version of this comment called this a load-dependent flag on task-stage TA kicks. That was a sampling artifact: the heavy capture only held the first two kicks of each ring.) Follow-up: a PR that drops the wait to match macOS has to come together with whatever the wait is hiding.
Until then #2629's order stays as merged. Assisted-by: LLM (Claude:Opus 5.5) |
|
Follow-up TA command read-back on J714s (M5 Pro, T6050, G17S): Tested on
Conclusion: the GPU firmware writes that TA command marking itself on our Linux commands too. That closes it as a candidate driver difference to copy; this PR's cross-pair wait stays in place while the underlying cause of the stalled fragment start under concurrent cross-client task-stage tiling is investigated elsewhere. |
Problem
On the M5 Pro (J714s, G17S), 8 concurrent clients of
dEQP-VK.mesh_shader.ext.misc.many_task_work_groups_xall lose their device, and then the GPU runtime stops for every client until reboot ("GPU runtime stopped, device lost", then ENODEV at device init). It reproduced twice on a clean boot of 7.3.0-m5-intg28d. One client alone passes 3/3 in 87–93 ms.What the kernel log shows:
done == read == write);A code read found no host-side dependency between the clients. The "two VMs defer to each other" lines come from
timeout::blocker()skipping a job's own VM's older head, not from a real cross-client wait.Change
asahi_g17_render_cross_pair_ordercovers the order per board and the dependency choice, including the own-pair exclusion.tools/asahi/g17-quarantine-drain-tests.pycompiles the realquarantine()against a mockPair. The mock gains a no-oprelease_task_order_if_held(), because that model doesn't cover the order (KUnit does). All 90 g17 host tests pass locally.command.rs), so it never has task-stage renders and its kicks are byte-identical.macOS reference
Testing
Scope
🤖 Generated with Claude Code