Repository navigation
drm/asahi: g17: one zeroed clustering-metadata copy per in-flight render - #2170
AxxzyWasTaken wants to merge 1 commit into
Conversation
|
The production boot stub pins at macOS 27.2 (26B123), so please retarget this to 27.2. The clustering metadata layout here comes from the 26.6.2 (25G83) GPU firmware; please take it from the T6041 GPU image the 27.2 stub loads. |
|
Thanks. As far as I can see, 26.6.2 is still what M4 Max installs get today, so I'd like to keep this on 25G83 for now and port it once there's a 27.2 base for the T6041:
When a T6041 board moves to 26B123 in the installer, I'll port this and the four-cluster series (#2021, #2171, #2172) onto the 27.2 base and re-test on my J616c. If you'd rather hold these until then, that's fine too. Disclosure: prepared with an AI tool (the commits carry Assisted-by: LLM); facts checked against the repos named above. |
|
I found an overflow in this PR's metadata-copy commit and pushed a fix as a new commit on top ("drm/asahi: g17: hold the last tile map in the shared TPC object"). The earlier commits are unchanged.
Testing on my J616C (32-core M4 Max, 25G83):
#2171 and #2172 aren't affected: they sit on #2021 alone, where the TPC object holds the whole parameter block and is sized to its end. Disclosure: prepared with an AI tool (the commits carry Assisted-by: LLM); tested as described. |
2ee4e1a to
8e7877b
Compare
8e7877b to
17a8d6f
Compare
|
Looks good; approve once this exact head has booted on the M4 Max and on a two-cluster M4 Pro.
Checked and correct: the shared/per-render split in gtp_va() (target.rs:364). Offsets below HW row: this head on #2021, booted as-is (not a daily tree with other work). On the J616C (M4 Max, 25G83): Minecraft with the shader pack near 3456x2234 for 10 min and SCP:SL for 10 min, 0 GPU recoveries. On a T6040 (J616s or J614s): the same pair, or the G17 Vulkan CTS render subset, with 0 recoveries. Also 0 AVC, 0 failed units and no new kernel errors on both. Assisted-by: LLM (Claude:Opus 5.5) |
17a8d6f to
6d2f59d
Compare
|
#2021 has been reworked since this branch was cut: its head is now 2ba7a68 with three commits ("scale the render pool floor from GPU shape" replaces the fixed 96-block pool). The four #2021 commits under this branch are no longer patch-equal to any of them. A test merge of this branch with the current #2021 head conflicts in six files. Please rebase the metadata-copy commit onto the current #2021, then boot that exact head on the M4 Max and on a two-cluster M4 Pro, since |
6d2f59d to
24e7a34
Compare
|
Rebased the metadata-copy commit onto Verified at
Keeping in Draft pending exact-head boot rows on J616C (M4 Max) and T6040 (two-cluster M4 Pro). Assisted-by: LLM (Google:Gemini 4 Neon) |
|
Checked the rebase: 24e7a34 is the single metadata-copy commit directly on #2021's current head 2ba7a68, and nothing else from #2021 is carried. We can run the two-cluster M4 Pro (T6040) boot of this exact head on our J616s as a one-shot (render-heavy Vulkan and GL load, then the KUnit and fault counts). The M4 Max row still needs a J616C owner. Assisted-by: LLM (Claude:Opus 5.5) |
|
J616C (Apple MacBook Pro 16", M4 Max, 32-core T6041,
Keeping in Draft pending Assisted-by: LLM (Google:Gemini 4 Neon) |
|
The updated head |
|
Rebased onto the updated Assisted-by: LLM (Google:Gemini 4 Neon) |
24e7a34 to
458f63b
Compare
|
Now that #2021 has merged (
Assisted-by: LLM (Google:Gemini 4 Neon) |
458f63b to
ff737f9
Compare
A render target keeps one TPC object, with the 25G83 clustering metadata (GTP 4-7) after it, for all of its in-flight renders, and never clears the metadata; only the per-slot records are zeroed. Clustered tiling can then read metadata left by another render, or written by one still in flight. Give each render slot its own copy of the clustering metadata, as the records have, and zero it before the render uses it, as G15 gives each clustered pass a zeroed buffer. Only the metadata is copied: the TPC and the tile maps stay shared among the target's renders. A copy of the whole object per slot took 47 MiB for a 1728x1117 target with 32 renders in flight, and SCP: Secret Laboratory filled the 320 MiB target window within minutes (target growth failed with ENOSPC until the render submit gave up with EBUSY). The metadata copy is 0x70000 bytes at 1728x1117 (metadata 4, GTP 6, has room for 64 partial renders) and starts at a page-aligned base, so every sub-buffer keeps its alignment. M5 is unchanged. The shared TPC object, which holds the TPC and GTP 1-3, is sized to GTP 4 rounded up to a page, not down. The tile maps (GTP 1) run up to GTP 4 itself, so when GTP 4 is not page aligned their end would lie past the object. With 32x32 utiles at 3456x2234 the TPC is 0x46000 bytes and the last 8 KiB of the tile maps would fall into the unmapped guard page after it; that hung the GPU (reason 3, no MMU fault reported) within about 35 seconds of Minecraft with a shader pack in a window near that size. gtp_va() checks the bound. The TPC itself has to stay shared by the target's renders: two kernels that also gave each render its own copy of the TPC hung the GPU in SCP: Secret Laboratory (reason 0). The tests check that every sub-buffer lies in its object with its alignment across sizes, utile shapes, layer counts and cluster counts, including 3456x2234 with 32x32 utiles. Signed-off-by: AxxzyWasTaken <[email protected]>
ff737f9 to
37e3889
Compare
|
@AxxzyWasTaken checking open drafts today. To come out of draft, this still needs:
If it's no longer needed, say so here and we'll close it. Otherwise it stays open as a draft until these are done. |
|
Still needed on |
|
Hardware verification row on J616c (16-inch M4 Max, T6041, 32-core G17P) on macOS 27.2 (
Marking ready for review. |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
What: Give each in-flight 25G83 G17 render slot its own zeroed copy of the clustering metadata (GTP 4-7) while keeping the TPC and tile-map sub-buffers (GTP 1-3) shared across a target's renders.
0x70000bytes / 448 KiB per render at 1728x1117, 14 MiB for 32 in-flight renders) from a page-aligned base so every sub-buffer preserves its alignment without exhausting the client's 320 MiB target window (copying the full TPC object per slot took 47 MiB per target and causedENOSPC/EBUSYin SCP: Secret Laboratory, and also hung the GPU with reason 0).gtp_va().Tested:
upstream/main(7be48f374c67->37e388985962, updatingObject::new/Target::replacecall sites toOption<PairObject>after drm/asahi: g17: M5: render large passes instead of losing the device after 26 s, refuse those that cannot fit, and account their memory to the client #2501; no functional change).tools/asahi/run-host-tests.py --only g17: 220/220 PASS (including sub-buffer bounds and alignment across sizes, utile shapes, layer counts, and cluster counts, including 3456x2234 with 32x32 utiles).make ARCH=arm64 LLVM=1 drivers/gpu/drm/asahi/aurora.o: compiles and links cleanly (0errors,0warnings in touched files).0GPU recoveries.Risk: Two-way · M4 Pro/Max (
drivers/gpu/drm/asahi/g17/buffer/target.rsandqueue/render.rsonly; affects 25G83 clustered tiling targets, M5 unchanged; plain revert restores shared metadata).Not yet:
37e388985962(previous hardware runs were in a combined daily tree).