Repository navigation
borealis: share AGX_CAP_CACHED_CMD_MEMORY to G15 and G16G - #1132
Conversation
Enable CPU write-back command, USC, root-descriptor, VDM-slab, Ioto-arena, and descriptor-pool allocations (AGX_CAP_CACHED_CMD_MEMORY) on all native AGX3 chips (G15/G16G/G17P) alongside M5, giving G15 and G16G slab span suballocation, cached root reuse, push-descriptor elision, and HAL200 fragment-root snapshot elision: - Clean each patched command-stream word in hk_cmd_buffer_patch_sparse_sites() via util_flush_range_no_fence() when hk_g17p_cached_cmd_memory() is active, matching hk_cmd_buffer_patch_alias_sites(). - Promote AGX_CAP_CACHED_CMD_MEMORY into AGX_CAPS_NATIVE in agx_chip_caps.h (AGX2 stays on write-combined pools after J316s/J413 ABBA showed explicit flush overhead outweighed reuse; G18G stays off). - Add test_cached_cmd_memory() to test-chip-caps.c and extend hk_cpu_upload_bench.c to cover G15G and G16G. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Reviewed at
One tiny non-blocking test note: in (Pre-existing and not a blocker here: |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict merge at fdc988ca88d8 after a forward merge (see below).
Blockers none.
Checked
- Cached command memory moves to
AGX_CAPS_NATIVE, which adds G15G/S/C and G16G. AGX2 stays write-combined, and the cap's comment gives the J316s/J413 reason. hk_cmd_buffer_patch_sparse_sites()now cleans each patched word when command memory is CPU-cached, and always fences after. This also fixes G17P and M5: a sparse-site word patched at submit could otherwise sit in the CPU cache after the command buffer's clean.- The rows at this head are on G15G and G16G, with G13X as the control and G17P as the regression check.
- This conflicts with #1131 and #1130 in
agx_chip_caps.h. Once #1131 lands, please merge aurora-wip in and re-run the G15G/G16G set at the new head. I'll only check the resolution.
|
J516s (MacBook Pro 16" M3 Pro, G15S, 27.2 stub) row for |
|
J773g (M4 Mac mini, G16G B0, second generation) at Both arms are release Borealis builds loaded from private prefixes on the stock kernel VK CTS:
gpubench-vk ABBA (head/base):
No speed change on G16G beyond run-to-run noise. |
|
Forward-merged Resolution in Local x86 drm-shim gate: 335 OK / 0 FAIL at @DjDeveloperr Please check the resolution. Row needed at |
Bring in aurora-wip 9ce6bc3. The only conflict is in test-chip-caps.c: keep both test_cached_cmd_memory() from this branch and test_g13_compute_codegen_caps() from aurora-wip, and call both. agx_chip_caps.h merged cleanly: the new G13-only capabilities do not change the G15/G16G/G17 sets. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Forward-merged aurora-wip |
There was a problem hiding this comment.
Verdict: FINISH, then merge at f8045d6a
Blockers: none in the change. Before merge: resolve the aurora-wip conflict in src/asahi/lib/agx_chip_caps.h (the AGX_CAPS_NATIVE / AGX_CAPS_G17P macros moved on aurora-wip since base 69179743). The rows were taken on that old base and the changed file will differ after the merge, so re-run the host suite (asahi-agx-chip-caps, hk_cpu_upload) and one J615 and one J713 smoke/CTS row at the merged head. Ask on SMALL-TASKS for the approval at that head.
Checked: AGX_CAP_CACHED_CMD_MEMORY moves into AGX_CAPS_NATIVE, so G15G/S/C, G16G and G17P get it from one macro; AGX2 and G18G stay on write-combined pools. Every reader goes through hk_g17p_cached_cmd_memory(), which also requires util_has_cache_ops(). The new per-word clean in hk_cmd_buffer_patch_sparse_sites() matches hk_cmd_buffer_patch_alias_sites(), and the post-flush fence still runs. No new chip if-gates, no Apple material, no attribution.
Evidence and notes
- Read at
f8045d6a(PR commitfdc988caplus two merges): theagx_chip_caps.hdiff,hk_cmd_pool.h:114,hk_cmd_buffer.caround lines 193 and 374, and the span allocator around line 683. git merge-treeagainstaurora-wip(15:37 AEDT): conflict insrc/asahi/lib/agx_chip_caps.honly.- Not blocking:
- Sparse sites exist only where
AGX_CAP_SPARSE_BINDINGis set (G17P, M5, AGX2), and G15 and G16G don't have that cap. So the missing clean inhk_cmd_buffer_patch_sparse_sites()was a latent G17P/M5 bug, not a G15/G16G one. Saying so in the commit message helps bisects. cpu_cached || util_has_cache_ops()reduces toutil_has_cache_ops(), becausecpu_cachedalready requires it.
- Sparse sites exist only where
|
Forward-merged Conflict: Host check at |
There was a problem hiding this comment.
The resolution preserves the base coherent-store bit and moves only cached command memory into the shared native capability. The sparse-word path writes, cleans when cached, then fences. The reported host result clears the Vulkan and chip-table tests. Hold for exact J615/G15G and J713/G16G rows exercising sparse submit with caches enabled. If #1130 lands first, recheck the shared capability definitions on the next merge result.
|
Forward-merged On the J615 half of the hold: J615 (M3 Air, G15G, |
There was a problem hiding this comment.
Verified the forward merge has no manual resolutions and retains the native cached-memory selection. J615 exposes no sparse binding, so the 1,504 matching NotSupported cases document scope. Please keep the G16G/J713 sparse-submit row as the hardware gate for the cache-clean path and smoke ordinary command submission on the affected G15G family.
|
G16G half, at So on both chips this PR promotes the capability to (G15G J615, G16G J713), Borealis doesn't offer sparse, and the sparse-word clean-before-fence path can't be reached from Vulkan. The row the hold asks for can't be produced on these chips. It applies only when sparse gets exposed there, and the change that exposes it would carry that row. Apart from the sparse path, the cap changes ordinary command-memory caching. The merge train is running a broad A/B on J713 (26,595 VK cases, A vs B) to cover that. |
There was a problem hiding this comment.
Verdict: MERGE at 7421b3a after the combined regression checks.
Checked: The exact G15G and G16G evidence shows sparseBinding disabled, with identical NotSupported outcomes across 1,504 and 2,081 cases. Sparse submit therefore cannot exercise the cache-clean path on the newly covered GPUs. Prior source review found the write, clean and fence ordering intact. Keep the broad ordinary-command regression and recheck shared caps against the live base after #1130.
|
Broad G16G row at Result: 0 status changes. Both arms (and the sibling PR arm) have identical totals: 10,981 Pass, 14,000 NotSupported, 59 Crash, 1,555 DeviceLost. 0 GPU firmware crashes. The DeviceLost/Crash set is the known fleet85 kernel submit-EINVAL baseline on this Mac and is the same case by case on every arm. Table: |
# Conflicts: # src/asahi/lib/tests/test-chip-caps.c
# Conflicts: # src/asahi/lib/agx_chip_caps.h
|
Forward-merged The conflict was the one REVIEW6 predicted, in This resolution is exactly what was tested. Compared with comb7 Host App re-approval at |
There was a problem hiding this comment.
Verdict: MERGE at 81a1237 once the integration gates clear.
Checked: Relative to the live b156422 base, this head adds cached command memory to the native capability set, preserves the merged indirect-index and WAR-barrier bits, and keeps G17P coherent stores. The sparse patch retains write, conditional cache clean, then fence ordering. I compiled and ran the exact-head chip capability test independently: 855/855 passed. git diff --check passed.
The comb7 M1 Pro and J713 runs each compared 26,595 Vulkan and 8,153 GL cases with zero status changes and zero firmware crashes. The command-buffer and upload-test files are identical to comb7. In the two capability files comb7 also carries the separate G13G smart-waits change and its tests. The full trees also differ by newer base GL and utility changes, so keep the merge-train integration smoke for the resulting tip. The earlier rows establish that G15G and G16G do not advertise sparseBinding.
|
Merge-train landing at
Revert: |
What
Enable CPU write-back command, USC, root-descriptor, VDM-slab, Ioto-arena, and descriptor-pool allocations (
AGX_CAP_CACHED_CMD_MEMORY) across all native AGX3 chips (G15G/G15S/G15C,G16G,G17P) alongside M5 (G17G/G17S/G17C), givingG15andG16Gslab span suballocation, CPU-cached root reuse, push-descriptor elision, and HAL200 fragment-root snapshot elision:hk_cmd_buffer_patch_sparse_sites()(src/asahi/vulkan/hk_cmd_buffer.c) viautil_flush_range_no_fence()whenhk_g17p_cached_cmd_memory()is active, matchinghk_cmd_buffer_patch_alias_sites().AGX_CAP_CACHED_CMD_MEMORYintoAGX_CAPS_NATIVEinsrc/asahi/lib/agx_chip_caps.h. AGX2 (G13/G14) stays on write-combined pools after same-machine ABBA on J316s (G13X) and J413 (G14G) showed explicitDC CVACflush overhead outweighed reuse (compute.light d=16-7.0%,render.light d=1-6.7%).G18Gstays off until qualified.test_cached_cmd_memory()tosrc/asahi/lib/tests/test-chip-caps.cand extendsrc/asahi/vulkan/tests/hk_cpu_upload_bench.cto coverG15GandG16G.Tested
Tested: exact-head
fdc988ca88d8hostmeson test --suite asahi325/325 PASS (0 fail, includingasahi-agx-chip-capsandhk_cpu_upload), plus isolatedVK_DRIVER_FILESdEQP-VK CTS and same-machinegpubench-vkABBA acrossG15G,G16G,G13X(AGX2 unchanged control), andG17P(regression) (base69179743d9aevsfdc988ca88d8, 0 failures, 0 GPU faults, 0 new AVCs, Enforcing, 0 failed units):7.3.0-aurora-fleet85):api.smoke.*8/8 Pass,nested_execute*2/2 Pass, 240-casepush_descriptor+command_buffers+dynamic_renderingmatrix 106/240 Pass (134 NS),control96/96 Pass (0 Fail).gpubench-vkABBA:compute.light d=16 +2.75% wall / +7.8% rec_cpu,compute.light d=1 +5.5% rec_cpu(and Wave 5c full matrixcompute.edge d=4 +1.49%,compute.heavy d=4 rec_cpu +7.6%,compute.stereo d=1 rec_cpu +3.5%).7.3.0-aurora-fleet85):api.smoke.*8/8 Pass,nested_execute*2/2 Pass,secondary_push_descriptor*2/2 Pass,compute.pipeline.basic.*78/81 Pass,draw.renderpass.indirect_draw.indexed.*41/41 Pass (0 Fail).gpubench-vkABBA:render.light d=1 +0.42% wall / +2.0% rec_cpu,render.light d=16 +1.4% rec_cpu(and Wave 5c full matrixrender.mdi d=4 +5.74%,render.light d=16 +2.88%,compute.light d=1 rec_cpu +3.6%).7.3.0-aurora-fleet89):api.smoke.*8/8,nested_execute*2/2,cached_full147/240,sparse_full95/118,control87/96 (0 Fail, unchanged WC pools).7.3.0-aurora-fleet89):api.smoke.*8/8,nested_execute*2/2,cached_full218/240,sparse_full103/118,control96/96 (0 Fail, 0 regressions).Risk
Risk: Low — reuses the existing
AGX_CAP_CACHED_CMD_MEMORYwrite-back pool andhk_cmd_buffer_publish_cached_uploads()publication path already qualified onG17Pand M5, plus adds the missing cache clean inhk_cmd_buffer_patch_sparse_sites(). AGX2,G17P, M5, andG18Gruntime behavior is unchanged.Not yet
G15S/G15Chardware rows (represented here by J615G15G).Detailed hardware receipts & SHA-256 provenance
aurora-wip:69179743d9ae4(libvulkan_asahi.base5.soSHA-256686333bb0f10d665f76f03e5e0cf4e1763f4844210cc4615e877edfa46db4ec9)fdc988ca88d82(libvulkan_asahi.b8v2.soSHA-256ea99504f639cccbf634629bb0b442df12b6c1dd70340defff0ce559e80556f98)meson test --suite asahi, release + assertions): 325/325 OK, 0 Fail.Enforcing,FAILED_UNITS=0,GPU_FAULTS_AFTER=0,AVC_AFTER=0, temporary/var/lib/aurora-testcleaned.