Repository navigation
drm/asahi: g17: Fix M5 Max GPU work running before the work it waits for - #1070
DjDeveloperr merged 1 commit into
Conversation
b1615e3 to
0dd0833
Compare
DjDeveloperr
left a comment
There was a problem hiding this comment.
Approved. This works on the M5 Pro too, and it fixes a real M5 Pro bug.
host_producer_waits() holds on J714, which has no G17D forms, so this commit changes the M5 Pro's behaviour as well. I compared the same kernel, Mesa (15eb7b7be4) and boot flow with and without it; #1177 was also in the "with" kernel. The commit cherry-picks cleanly onto 0dd0833. Results on J714sAP, bare metal:
| without | with | |
|---|---|---|
multi_queue.timeline_semaphore write_copy_buffer_read_ssbo_geometry.buffer_16384_concurrent and write_copy_image_read_blit_image.image_64x64x8_r32_sfloat_exclusive |
Fail 3/3 each | Pass 3/3 each |
every 20th synchronization2.op.multi_queue.timeline_semaphore case (214) |
175 Pass, 34 Fail, 5 DeviceLost | 208 Pass, 0 Fail, 6 DeviceLost |
| dEQP s0 smoke | 109 Pass, 2 NotSupported | 109 Pass, 2 NotSupported |
| compute 65,536 words / 256x256 triangle | PASS / crc32 d5e4bea9 | same |
Every DeviceLost case in both runs is a 128x128 RGBA32F image case in the vertex or tessellation stages. That is the M5 Pro firmware's ~12 ms vertex-phase limit, which this change doesn't affect.
|
Leaving this open: it is based on #1012 ( 🤖 Generated with Claude Code |
88a3531 to
26d8287
Compare
|
Update: I am handling this rebase directly as part of the owner's M5 integration work. The freshly pinned #1070 head is |
Without the G17D forms, an M5 compute kick's implicit parent is pipelined: the next kick on a ring may start while its predecessor still runs. The M5 Max needs it that way; with the G17D forms' completion parent its compute kicks never complete. Converting a compute input fence into ring order therefore let a consumer run alongside its producer on the same queue. Leaving other-engine producers to firmware waits also lost devices to submission timeouts under load. On those boards, keep compute inputs as completion fences, and wait on the host for other-engine producers to complete, checking their errors before publication. Boards with the G17D forms keep their firmware dependencies. On the M5 Max, three synchronization2 multi-queue cases returned incorrect memory contents on every run, and the 17,073-case CTS sample recorded 17 job timeouts. With this change, 195 repeats of 65 previously failing synchronization cases pass, and three samples record no job timeouts. Disabling only the input conversion still left 24 and 60 timeouts in two samples. Developed with Claude Code. Signed-off-by: Erik Bourget <erik@ebourget.net>
26d8287 to
e962ea2
Compare
What this is
On the M5 Max, #1012's driver can run GPU work before the work it waits for has finished:
This adds a backend query that holds for an M5 board without the G17D forms. On those boards, compute inputs keep their completion fences, and other-engine prefix producers are waited for on the host, with their errors checked before publication. The M5 Ultra and the other GPUs keep their firmware dependencies; the M5 Ultra passes the same CTS sample without this change.
This fixes the multi-queue synchronization known issue from #1056 (now part of #1012), apart from the MMU faults below.
Testing (J716c, bare metal)
Tested on the previous #1012 head (d078ca1) with #1056 and the GPU device tree, with the same Mesa build throughout. The patch rebased onto this head unchanged. It is rebased again onto #1012's current head (0dd0833), unchanged, and runs in the J716c daily on current integration/aurora, which passes an 18,427-case sample of the Vulkan default list (9,694 passes; only the two driver-ID/conformance metadata failures; no GPU recoveries).
Three
synchronization2.op.multi_queuecases that returned wrong memory contents on every run: 15/15 passes.The 65 synchronization cases (multi-queue, cross-instance, timeline semaphore) that failed or crashed in the drm/asahi: g17: Run the M5 Max (J716c) GPU on bare metal #1056 sample: 195/195 passes over three runs, on two boots.
A 1-in-100 sample of the Vulkan CTS default list (17073 tests, 8557 not supported):
Turning off only the input conversion still left 24 and 60 job timeouts in two samples, so both halves are needed.
Builds with integration's
defconfig+asahi.config, with KUnit.Known issues
GPU MMU faults remain (0, 1 and 5 recoveries in the three samples above). They are being investigated separately.
🤖 Generated with Claude Code