Repository navigation
drm/asahi: admit compute sampler heaps on G14 firmware 27.2 - #3198
Conversation
The G14 firmware 27.2 queues refused every compute command that names a
sampler heap with ENOTSUPP ("M3 compute rejected: ... samplers=1024"),
because the 27.2 compute command's sampler placement was not known.
On these GPUs Borealis names its sampler heap on every compute command
whose shaders sample through a sampler, so compute work that samples
textures was dropped on the 27.2 firmware (the M2, and the M1 with its
27.2 support).
The firmware loads the sampler heap, the sampler count and the sampler
bound of every command type through one handler, keyed by the command
type, into the data master's sampler state: TA command +0x558/+0x560/
+0x564, 3D command +0x8bc/+0x8c4/+0x8c8, compute command +0x284/+0x28c/
+0x290. The count and the bound are 11-bit fields. The render builders
already write the TA and 3D words. In the compute command these are the
13.5 EncoderParams sampler words, 0x10 bytes further on, as the 3D
command's are (13.5 +0x8ac, 27.2 +0x8bc), between the encoder mask
(+0x270) and the JobMeta stamps (+0x298).
Admit the sampler heap on compute for queues whose builders encode it
(the G14 27.2 queues), as render already does. The common compute
translator validates the heap (at most 1024 samplers, both fields set or
both zero, 8-byte aligned, readable in the submitting VM). Carry it in
the compute control to the 27.2 compute encoder, which writes the heap,
the count, and the count plus one as the bound, as the 13.5 compute
command does; a command without samplers keeps the words zero. The M3
queues still refuse compute sampler heaps.
Signed-off-by: Erik Bourget <[email protected]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 0ed56efaa6: the code is ready; it needs only a second-generation row at this head.
Blockers: none in the code. Missing row: g14_v27_2 runs M1 and M2, so it needs one M2 (T8112) on firmware 27.2 at this head: compute sampler cases pass with 0 compute rejected and 0 GPU faults, and render stays unchanged. We're asking PEER-ROWS for a J473 or J413 on 27.2.
Checked:
- The three words sit between the encoder mask and the JobMeta stamps, which is the 13.5 sampler layout shifted by 0x10, matching the shift of the 27.2 fragment words the render builders already write.
- The 11-bit bound holds at 1024 samplers (1025).
- A command without samplers stays all zero.
- Only queues with
samplers_and_helpersadmit a heap, so the M3 26.x queues still refuse it. - The J313 rows cover before and after, plus 2 deep sleeps. No board gates and no new parameters.
|
0ed56ef J473 (M2 Mac mini, T8112, G14G fw 27.2, merged main 255761f) PARTIAL-PASS (sampler heap PASS 3408/3408, compute.heavy timeout finding): before on stock fleet89, binding_model...sampler_mutable.compute.single_descriptor.2d failed 1/1 VK_ERROR_DEVICE_LOST + M3 compute rejected samplers=1024; at 0ed56ef, 0 compute rejected, exact repro 1/1 PASS, all 3408/3408 binding_model sampler*.compute.* CTS cases PASS (100.0%), gpubench-vk compute.light PASS; however gpubench-vk compute.heavy timed out (ETIMEDOUT at g14_v27_2.rs:713, FAULT_INFO=0x0, submitted=27605 completed=27604) leaving M3 scheduler returning EIO for subsequent clients including post-s2idle CTS. Enforcing, 0 failed, 0 AVC; fleet89 restored. |
Brings the G14 firmware 27.2 recovery up to main 255761f (the source of the m2combo22 kit): pool slot double buffers with the publish-only flip and cursor re-advance (#3182), compute sampler heaps (#3198), the pool stall report and the deep-sleep warm restart. Conflicts were additive: State keeps both the recovery fields and hardware_unreachable/commit_stop, the ABI file keeps both the recovery records and the Globals/compute/pool helpers with both test sets, and run-host-tests.py runs both g14-v27-2-abi-tests.rs and pmp-alloc-tests.rs. Stopped commands keep #3182's slot rule: their slot is retired the normal way, and its next command goes to the slot's other buffer, so the stopped command stays intact until the firmware unlinks the slot again. Signed-off-by: Ryan Murray <[email protected]>
What: G14 firmware 27.2 queues refused every compute command that names a sampler heap (
M3 compute rejected: flags=0x0 samplers=1024 heap=…, ENOTSUPP, VK_ERROR_DEVICE_LOST in Borealis), because the 27.2 compute command's sampler placement was not known. The firmware loads the heap, count and bound of every command type through one handler; for the compute command they sit at +0x284/+0x28c/+0x290. Admit the heap on G14 27.2 compute, as render already does, and write it there.Tested: J313 M1 Air (G13G, fw 27.2) at
0ed56efaon the#199tree (#3178dbb7b44b+ #31713577ce0e): before,sampler_mutable.compute.single_descriptor.2dlost the device with 1 rejection; after, 3421/3425 dEQP-VK binding_model compute sampler cases pass (4 not supported, 0 fail), 954/954 fragment sampler controls pass, then 2 deep-sleep cycles and 3408/3408 compute sampler cases pass again after the wake. 0compute rejected, 0 GPU faults, 0 kernel WARN/BUG; only failed unitaurora-sep(pre-existing, also on#199).Risk: two-way · M1 and M2 on firmware 27.2 (the G14 27.2 runtime); M3 queues unchanged (still refuse compute sampler heaps)
Not yet: M2 (T8112) on 27.2 — needs a row from someone with one.
Details
encode_computealready writes, which identifies the branch; the TA and 3D words are the ones the G14 27.2 render builders already write (g14_v27_2_render.rs).EncoderParamssampler words moved 0x10 bytes further on, the same shift as the 3D command (13.5 +0x8ac → 27.2 +0x8bc). They fall between the encoder mask (+0x270) and the JobMeta stamps (+0x298), in no word the compute encoder otherwise writes; a newg14_v27_2_abitest pins this.m3_submit.rs: compute sampler heaps are refused only on queues whose builders do not encode them (samplers_and_helpers, false for M3). The common translator already validates the heap: at most 1024 samplers, heap and count both set or both zero, 8-byte aligned, readable in the submitting VM.agx_compute::ControlandComputeJobcarry the validated heap and count.encode_computewrites heap, count and count + 1 as the bound (the 13.5 compute command's bound), or leaves all three zero without samplers.samplers=1024. Borealis names its whole sampler table (1024 entries) on a compute command whose shaders sample through the heap; dEQP'ssampler_mutablecompute cases reach that path; a plain combined or separate sampler in my own check did not.Evidence
origin/main6563be47; head0ed56efaa61558bc54e8fcf26e251752b2c9d952. Merges cleanly into today'smain(7f00dc6b, which carries drm/asahi: enable T8103 (G13G) on GPU firmware 27.2 and support g14_v27_2 deep sleep warm restart #3171 and drm/asahi: fix the G14 27.2 pool slot lifetime (GB6 firmware crash and pool stall) #3182); that merge buildsdrivers/gpu/drm/asahi/with no new warnings.rustc --test g14_v27_2_abi.rs9/9 on the head, 10/10 on the merge withmain.7.3.0-j313cmpsmp: the#199tree (4f0dc3dd) plus this commit, the#199config byte for byte, one-shot GRUB entry on the default command line (root=… rw rootflags=subvol=root plymouth.ignore-serial-consoles user4k=on loglevel=4 console=tty0).#199(before)j313cmpsmp(after)binding_model…bind.sampler_mutable.compute.single_descriptor.2dcompute rejectedbinding_model…bind.*sampler*.compute.single_descriptor.2d*.compute.sampler cases (3425).fragment.sampler case)dEQP-VK.compute.pipeline.basic.*.amberdata file in the copied CTS)rtcwake -d rtc1 -m mem -s 30) ×2GPU prepared for deep sleep: submitted=69949 completed=69949 pending=0, wake source PMU RTC); after wake 3408/3408 compute sampler cases, own check and 15 s stress passcompute rejectedcompute rejected, 0 aurora fault/timeout, 0 WARNING/BUG/Oopsmesa-aurora 26.3.0_devel.202611150611.d4ad4a4dce6.7.3.0-j313usb4s2r #199afterwards; GRUB files match their pre-trial hashes.