Skip to content

asahi: admit the M5 Ultra (G17D) as one row of the chip table, so Vulkan runs on the Mac Studio's GPU instead of failing at device open - #362

Merged
RyanTheTide merged 13 commits into
aurora-silicon:aurora-wipfrom
funkzy:g17d-admission
Nov 27, 2026

Conversation

@funkzy

@funkzy funkzy commented Nov 15, 2026 •

Copy link
Copy Markdown

What: Admit the M5 Ultra (G17D, T6050, 2 dies, 8 clusters) as one row of AGX_CHIPS / AGX_CHIP_CAPS and agx_params_m5_supported(), move M5 layered-store / index-list / profile-loader helper offsets / Gallium-through-zink / multi-die CDM memory-scope decisions onto the chip table and kernel-reported cluster/die counts (keeping G18G general tile programs on the 1-cluster G17G helper base), flush after internal graphics launches on every M5 part, route all Borealis M5 compute program generation and binding (including fused compute and its cached loader) through shared device-seeded helpers, and keep unmeasured M5 capabilities excluded on G17D via chip-table queries.
Tested: J775D (Mac Studio, M5 Ultra, G17D B1) at 0bb4666a07ef on aurora-wip 8c74e92d5162 (build mesa-362m11, standalone, bare aurora-silicon/linux main f3bfe5007089, kit pr2884-m1b (window m5u-mesa362m13@20261125-1814), 27.0 stub, published Aura main 7bf44a6374af, default env): vulkaninfo --summary reports Apple M5 Ultra (G17D B1) / Borealis / Vulkan 1.4.363, 628-case render CTS subset 571 Pass / 57 NotSupported / 0 Fail, dEQP-VK.compute.pipeline.{basic,indirect_dispatch} 104 Pass / 13 NotSupported / 0 Fail (all 6 compute barrier cases pass), host_image_copy 1-in-8 1,783/3,527/0, ycbcr 1-in-8 5,634/2,886/0, Gen10 2D compression sample (render_to_image, clear_color, copy_and_blit, texture.mipmap, 1,200 cases) 496 Pass / 704 NotSupported / 0 Fail, Gen5 LOD bias 17/0, VK_EXT_depth_clip_control 17/0, VK_EXT_fragment_shader_interlock 192 Pass / 384 NotSupported / 0 Fail, vkcompute plain & burst 20/20, vkchain 300/300 (median 126 us), vktimestamp 10/10, 46 concurrent clients 46/46, vkmark 24012, 0 GPU faults/recoveries/oops, 1/1 baseline failed unit (iwd.service; ALARM has no SELinux). Host aarch64 Lima VM packaged configuration: meson test --suite asahi 324/324 OK (0 fail, including asahi-g18g-reencode-cache multi-cluster G18G tile helper-base checks) plus meson test --suite zink 2/2 OK.
Risk: two-way door · commit 2 adds G17D (shifts G18G enum value by 1, updating its optimalTilingLayoutUUID once); commit 3 moves M5 Max (G17C) profile-loader helper offsets from 0x200/0x400 to 0x400/0x800 (derived from its 4-cluster count; earlier 0a8eda4c78e1 ran on J716C); commit 4 adds a flush after internal graphics launches on all M5 parts (G17G/G17S/G17C/G17D; performance impact on single-die M5 is unmeasured); commits 5–6 affect G17D only; commit 7, the aurora-wip merges, and 0bb4666a07ef keep fused M5 compute enabled on all M5 parts with G17D memory scope, keep unmeasured M5 capabilities (COALESCE_PURE_GLOBAL_WORKGROUPS, SIGNED_ZERO_MINMAX_SELECT, CDM_OVERLAP_SPLIT, CACHED_CMD_MEMORY, etc.) excluded on G17D, and keep G18G general tile programs emitting the existing 0x200 SR14 helper base byte for byte.
Not yet: J716C (M5 Max) re-check at 0bb4666a07ef (earlier 0a8eda4c78e1 J716C row passed multi-draw tessellation 4,512/4,512 and compute pipeline); single-die M5 / M5 Pro row for commit 4 (tessellated draws) and commit 6 (6 compute barrier cases under plain barriers); follow-up unifying .usc_clusters seeding on the remaining 9 graphics/G18 call sites.

Details

Problem

The M5 Ultra (T6050, two dies, eight clusters) reports G17 variant D. aurora-wip maps that to AGX_CHIP_UNKNOWN, so on the Mac Studio (J775D) every Vulkan, GL, and GBM client fails at device open with Unsupported Apple GPU architecture G17 (variant 0x44, 8 clusters).

Why this shape

Since #588 a chip is one row of AGX_CHIPS (paired with AGX_CHIP_CAPS), and this series makes G17D one row of that table, its variant letter in agx_chip_from_identity(), and its admission contract. After #588, three decisions still named chips: the M5 layered-store form (copied four times), the M5 index-list form, and the profile loader's helper-table offset (a raw byte per chip). A narrower shape would add G17D to every list and keep chip == AGX_CHIP_G17D tests, forcing the next M5 part to repeat those edits. Instead, chip properties live on the row (AGX_QUIRK_M5_LAYER_OPERAND, AGX_QUIRK_GL_THROUGH_ZINK, AGX_RECORD_CDM_ORDERING_FLUSH_MEMORY) and machine-varying geometry comes from kernel-reported num_clusters_total and num_dies.

When merging current aurora-wip (8c74e92d5162), every Borealis M5 compute dispatch and loader path (hk_dispatch_precomp_m5, hk_dispatch_preamble_cs, hk_dispatch_m5_native, hk_dispatch_g17g_native, hk_emit_fused_compute_dispatch, hk_m5_loader_create, and the cached fused compute loader in hk_cmd_dispatch.c) goes through shared device-seeded helpers so .usc_clusters and .ordering_memory_scope come from one place. G17D's AGX_CAPS_M5 bits (12 caps) are partitioned into AGX_CAPS_G17D_MEASURED (ELIDE_APP_DISPATCH_BARRIER, COOPERATIVE_MATRIX, SPARSE_BINDING, GEN10_2D_COMPRESSION) and AGX_CAPS_G17D_EXCLUDED (VDM_INDIRECT_INDEX_BOUNDS, HW_TXF_BOUNDS, DESCRIPTOR_BUFFER, COALESCE_PURE_GLOBAL_WORKGROUPS, CDM_WAR_WEAK_BARRIER, SIGNED_ZERO_MINMAX_SELECT, CDM_OVERLAP_SPLIT, CACHED_CMD_MEMORY) with test_g17d_partitions_m5() pinning disjointness and full coverage. All 7 runtime callers of M5 NIR preprocessing (6 in hk_shader.c, 1 in agx_state.c) pass dev->chip into agx_preprocess_nir_m5_chip() / agx_preprocess_nir_m5_defer_idiv_chip(), querying agx_chip_has_cap(chip, AGX_CAP_SIGNED_ZERO_MINMAX_SELECT) from the chip table instead of a compile-time AGX_CAPS_M5 macro. For G18G general tile programs, agx3_g18g_general_tile_program_generate() keeps the intermediate G17G tile program at usc_clusters = 1 so agx3_transcode_agx3d_ioto() continues to double 0x100 to the existing G18G 0x200 SR14 helper base regardless of G18G's cluster count.

Admission (agx_params_m5_supported()) remains narrow and identity-keyed (SoC ID, variant, dies, clusters), matching the existing M5 admission model until kernel-capability admission replaces it across all M5 parts.

Change

Six feature commits, fused-compute helper commit (0fbe9e82ac28), normal non-force-push aurora-wip merges up to 8c74e92d5162 (4a69a4e255fd), and the G18G general tile helper-base fix (0bb4666a07ef):

  1. asahi: read the M5 layered-store form and the M5 index-list form from the chip table (7cc623dba5d, no behaviour change): add AGX_QUIRK_M5_LAYER_OPERAND on G17C and move the layered-store and index-list checks onto the chip table.
  2. asahi: recognise the M5 Ultra (G17D) as one row of the chip table (6d0bcbff3bd): add AGX_CHIP_G17D to AGX_CHIPS and AGX_CHIP_CAPS, update agx_chip_from_identity(), and extend chip truth-table and capability tests.
  3. asahi: point every M5 program's profile loader at the helper tables the kernel's cluster count lays out (f191c7bb9ba): derive M5 profile-loader helper offsets from num_clusters_total (refusing usc_clusters == 0), fixing the 8-cluster G17D and 4-cluster G17C offsets and ensuring every agx3_g17p_graphics_program_desc builder populates .usc_clusters.
  4. borealis: flush after internal graphics launches on every M5 part (4419ea8fda9): emit a memory-scoped hk_cdm_cache_flush() after internal graphics launches on M5, fixing 66 tessellated render CTS cases on J775D, with hk_internal_stage_flush test coverage.
  5. asahi: admit the M5 Ultra (G17D) (f9622122916): admit G17D (T6050, 2 dies, 8 clusters) in agx_params_m5_supported(), set AGX_QUIRK_GL_THROUGH_ZINK so Gallium refuses G17D while Borealis runs Vulkan/zink, and add the G17D drm-shim profile (hk-g17d-global-priority-allow).
  6. borealis: give the compute barriers of a multi-die M5 GPU memory scope (0a8eda4c78e): add AGX_RECORD_CDM_ORDERING_FLUSH_MEMORY (1 << 24, avoiding #438's 1 << 23) on G17D and agx_cdm_ordering_memory_scope() (num_dies > 1 && agx_chip_g17_m5() && has_record), routing multi-die M5 compute ordering records and barriers through memory scope.
  7. borealis: keep fused M5 compute enabled and scope M5 Ultra fused launches (0fbe9e82ac28, after aurora-wip merge 9701aa353879): seed .usc_clusters and .ordering_memory_scope from hk_device in one place across Borealis M5 compute paths, partition AGX_CAPS_M5 into AGX_CAPS_G17D_MEASURED and AGX_CAPS_G17D_EXCLUDED, and add fused M5 / G17D memory-scope / zero-cluster tests in test-hk-compute-pair-cache.c.
  8. Merge branch 'aurora-wip' into g17d-admission (e2401a84bd45, 98f96bb0df6b, and 4a69a4e255fd): normal non-force-push merges up to aurora-wip 8c74e92d5162:
    • Route the cached fused compute loader in hk_cmd_dispatch.c through hk_m5_compute_launch_bind() and hk_m5_compute_program_generate().
    • Partition upstream's new AGX_CAPS_M5 entries (GEN10_2D_COMPRESSION in AGX_CAPS_G17D_MEASURED; COALESCE_PURE_GLOBAL_WORKGROUPS, SIGNED_ZERO_MINMAX_SELECT, CDM_OVERLAP_SPLIT, and CACHED_CMD_MEMORY in AGX_CAPS_G17D_EXCLUDED).
    • Replace the compile-time AGX_M5_SIGNED_ZERO_SELECT macro in agx_compile.c with chip-aware agx_preprocess_nir_m5_chip() / agx_preprocess_nir_m5_defer_idiv_chip() querying agx_chip_has_cap(chip, AGX_CAP_SIGNED_ZERO_MINMAX_SELECT) at all 7 runtime callers (6 in hk_shader.c, 1 in agx_state.c).
    • Populate num_clusters_total (1/1/1/2/4/8, including G17D) in hk_cpu_upload_bench.c:graphics_launch_replay_correctness() and restore 0 on teardown.
    • Update test-hk-execution-allowance.c shader binary version expectation for G17D from 52 to 53, and gate test_cdm_overlap_splits() in test-hk-sync-prior.c on AGX_CAP_CDM_OVERLAP_SPLIT while covering G17D in its excluded list.
  9. borealis,asahi: keep G18G general tile programs on the 1-cluster G17G helper base (0bb4666a07ef): add agx3_g18g_general_tile_program_generate() (usc_clusters = 1) and route hk_m5_tile_program()'s G18G branch through it so multi-cluster G18G parts keep emitting the existing 0x200 SR14 helper base after agx3_transcode_agx3d_ioto() (preventing 0x400 on 2-cluster J873 or transcode refusal above 2 clusters), covered in test-g18g-reencode-cache.c.

Open rows & follow-ups

  • Follow-up cleanup: extend device-seeded .usc_clusters helpers to the remaining 9 graphics/G18 agx3_g17p_graphics_program_desc call sites (outside this merge's compute path).
  • Single-die M5 / M5 Pro row for commits 4 and 6: verify dEQP-VK.draw.renderpass.multi_draw.*tess* and the 6 compute barrier cases under plain barriers (no ASAHI_M5_HOST_ALIAS_STATIC).
  • J716C (M5 Max) check: earlier 0a8eda4c78e1 J716C row passed multi-draw tessellation (4,512/4,512), compute pipeline (80/81), and indirect dispatch (24/36); re-verify at 0bb4666a07ef if desired.
  • Note aurora-silicon/linux#1973, #1173, #1650, and #2185 have now merged; our two G17D 27.2 kernel commits remain in draft aurora-silicon/linux#2866.
Evidence

Testing

Own row: J775D (Mac Studio, M5 Ultra, G17D B1) at 0bb4666a07ef on aurora-wip 8c74e92d5162

Build mesa-362m11 (standalone, no needs), running on bare aurora-silicon/linux main f3bfe5007089, kit pr2884-m1b (window m5u-mesa362m13@20261125-1814), 27.0 stub, published Aura main 7bf44a6374af, default command line and default environment (no ASAHI_M5_BRINGUP or MESA_LOADER_DRIVER_OVERRIDE):

  • Host aarch64 packaged configuration (Lima VM): meson test --suite asahi 324/324 OK, 0 FAIL (including asahi-g18g-reencode-cache verifying 2- and 4-cluster G18G BG/EOT tile programs transcode to SR14 helper base 0x200 and match agx3_g18g_tile_program_generate() byte for byte, hk_sync_prior, hk_cpu_upload, asahi-agx-chip, asahi-agx-chip-caps with test_g17d_partitions_m5, hk_compute_pair_cache, hk_compute_pair, agx_tests, test-chip-admission, test-agx-ioto-program-core, agx3_m5_programs, hk_internal_stage_flush, hk-g17d-global-priority-allow, test-hk-execution-allowance, test-native-feature-defaults, asahi-egl-priority-*); meson test --suite zink 2/2 OK, 0 FAIL.
  • vulkaninfo --summary: Apple M5 Ultra (G17D B1), Borealis, Vulkan 1.4.363, Mesa 26.3.0-devel (git-0bb4666a07).
  • 628-case render CTS subset: 571 Pass, 57 NotSupported, 0 Fail (7 s).
  • dEQP-VK.compute.pipeline.{basic,indirect_dispatch} (117 cases):
    • basic: 80 Pass, 1 NotSupported, 0 Fail (all 6 compute barrier cases pass: copy_image_to_ssbo_{small,large}, copy_ssbo_to_image_{small,large}, image_barrier_multiple, ssbo_cmd_barrier_multiple).
    • indirect_dispatch: 24 Pass, 12 NotSupported, 0 Fail.
  • dEQP-VK.image.host_image_copy.* (1-in-8 sample, 5,310 cases): 1,783 Pass, 3,527 NotSupported, 0 Fail.
  • dEQP-VK.ycbcr.* (1-in-8 sample, 8,520 cases): 5,634 Pass, 2,886 NotSupported, 0 Fail (2 s).
  • Merged aurora-wip feature coverage on J775D (G17D B1):
    • Gen10 2D compression (#835, 1,200 sampled cases across render_to_image.core.{2d,2d_array,cube,cube_array,3d}, clear_color_{image,attachment}, copy_and_blit, texture.mipmap): 496 Pass, 704 NotSupported, 0 Fail.
    • Gen5 LOD bias (#717, 17 cases): 17 Pass, 0 Fail.
    • VK_EXT_depth_clip_control (#1082, 17 cases): 17 Pass, 0 Fail.
    • VK_EXT_fragment_shader_interlock (#1080, 576 cases): 192 Pass, 384 NotSupported, 0 Fail (sample interlock passes; pixel interlock stays unsupported).
  • Compute / submit / timestamp / concurrency checks: vkcompute plain 20/20 exact, burst 20/20 exact; vkchain 300/300 exact (median 126 us); vktimestamp 10/10 exact and in order; 46 concurrent clients (50 chained submits each) 46/46 PASS, 0 FAIL (3.7 s).
  • vkmark (13 default scenes, Wayland, 3 s each): Apple M5 Ultra (G17D B1), Score 24012.
  • Regression check: 0 GPU recoveries, 0 Error(110), 0 firmware restarts, 0 GPU/MMU/UAT faults, 0 timeouts, 0 lost devices, 0 WARNING/BUG/Oops, 1/1 baseline failed unit (iwd.service; ALARM has no SELinux), peak sensor 45.3 C / 85.8 W.

@RyanTheTide

Copy link
Copy Markdown

Thanks for bringing up the M5 Ultra and for the clear write-up.

One request on point 3. We select behaviour by a hardware property, not by the machines a fix was tested on. The flush after internal graphics launches is applied to G17D only:

  • src/asahi/vulkan/hk_cmd_buffer.h:2828-2831: "Of the M5 parts, the M5 Ultra (G17D) takes the flush too ... The others keep the launch's own ordering record alone until they are measured." with if ((!m5 || dev->dev.chip == AGX_CHIP_G17D) && ...

The reason given, that software stages hand outputs to the next launch through memory with no application barrier in between, holds on every M5 part. Could the flush apply to all M5 parts (as it already does on G17P), or, if G17G/G17S/G17C are known to order these launches in hardware, cite that in the comment?

The rest of the bring-up (the new chip entry, admission contract and helper-table offsets) looks fine to us. We can run no-regression rows on our A18 Pro and M4 Pro for the shared launch helper.

@funkzy

funkzy commented Nov 19, 2026

Copy link
Copy Markdown
Author

Thanks, done: the flush after internal graphics launches now applies to every M5 part, as it does on G17P. The G17D term is gone, and the comment says why the flush is needed. hk_internal_stage_flush now expects a launch and then a flush for G17G, G17S, G17C and G17D.

G17D emits the same commands as before, so the M5 Ultra results in the description stand. We have not measured the other M5 parts. The 66 tessellated cases listed in the description, run on an M5, M5 Pro or M5 Max, would cover the parts that changed. The A18 Pro and M4 Pro paths emit the same as before.

Also rebased onto aurora-wip at 11ab5f0. The only conflict was in your new agx_chip.h comment, where G17D now joins the line for the M5 parts that use AGX3C. #363 is restacked on this branch, with no change to its commits.

@RyanTheTide

Copy link
Copy Markdown

Thanks, applying the flush after internal graphics launches to every M5 part, with the reason in the comment and the test expecting it, covers what we asked. The M5 Ultra results stand; the remaining item is the 66 tessellated cases on an M5, M5 Pro or M5 Max, which we will try to line up from an owner since we have no M5 ourselves.

@DjDeveloperr

Copy link
Copy Markdown

@funkzy, we'd like to merge this. aurora-wip has moved since 11ab5f0 (139 commits, now 4596393), and the PR conflicts again. Could you rebase it? If you'd rather we did it, say yes here and we'll push the rebase to g17d-admission with your authorship kept (maintainer edits are on).

We rebased it locally to start review and testing. Branch rebase/pr362-g17d gives a920130a, c759d8fb, fd34202c and 657cb956.

The conflict. There is one, in src/asahi/lib/agx_chip.h. #354 (a657fb8) moved agx_chip_g17_m5() above agx_chip_elide_app_dispatch_barrier(). We removed the copy your commit 1 adds lower down and added AGX_CHIP_G17D to the moved one. Commits 2-4 applied cleanly.

Please check this on the M5 Ultra. Because G17D is now in agx_chip_g17_m5(), it picks up three aurora-wip changes that key on that helper and weren't there when you measured:

If any of these shouldn't apply to G17D yet, an explicit exclusion in your rebase is fine. Otherwise, rerunning the 628-case subset and the compute and chained-submit checks on J775D after the rebase would cover them.

Testing on our side. We're putting the rebased series through an independent review, local build and unit checks (including hk_internal_stage_flush), and an M5 Pro (G17S) hardware row. The row runs the 66 tessellated cases plus the tessellation and geometry groups, with and without commit 3, and a perf A/B for the extra flush. That's the M5-part check @RyanTheTide asked for. Results will follow here.

@DjDeveloperr

Copy link
Copy Markdown

Independent review of the rebased series (rebase/pr362-g17d, a920130a..657cb956 on aurora-wip 4596393). This was a code-only review. Nothing was built or run for it.

Verdict: NOT CLEAN. The one blocking item comes from the rebase, not from the four commits. No correctness bug was found in the commits themselves.

Rebase. git range-diff shows commits 2-4 identical to 647377b, 67139a7 and 386634c, and commit 1 differs only in context lines. The agx_chip.h resolution is correct: there is one agx_chip_g17_m5(), at the moved spot, and it includes G17D.

Findings

  1. Major (merge condition). Through the rebase, G17D now takes the application-dispatch barrier elision. Since a657fb8 (hk, asahi: bound AGX3B mma8 GPRs, guard G17P dispatch barrier elision, and add weakbarrier perftest #354), agx_chip_elide_app_dispatch_barrier() is native_agx3 || agx_chip_g17_m5 (agx_chip.h:551, used at hk_cmd_dispatch.c:1974-1978). G17D also enters hk_pack_boundary() packing (hk_pack.c:37) when the J775D kernel reports DRM_ASAHI_FEATURE_COMPUTE_VISIBLE_COMPLETION. Neither path existed when the J775D results were measured, and the description says G17D takes no elision. @funkzy, please pick one:

    • exclude G17D from agx_chip_elide_app_dispatch_barrier() (and decide packing the same way); or
    • rerun the J775D compute, chained-submit, multi-client and 628-case checks on the rebased branch.

    Either way, pin the choice in src/asahi/vulkan/tests/test-native-feature-defaults.c:48.

  2. Minor. Commit 3 doesn't write "the G17P flush" byte for byte. hk_cdm_cache_flush() forces memory scope on M5, so each internal launch's tail becomes 0x6000157c. G17P gets the plain 0x60001560 from the same call. The plain record is narrower, and 23644ad measured it as enough on M5. Your G17D fix was measured with memory scope, though, so keep it as is unless an A/B on J775D says otherwise. Please fix the wording in the comment and description.

  3. Nits.

    • hk_internal_stage_flush stubs out both the launch and the flush, so it pins the call order but not the word written.
    • G18G's enum moves from 18 to 19, so its optimalTilingLayoutUUID changes once. That's harmless.
    • The raw helper-table bytes 4/8/16 equal the long-immediate encoding of 0x100/0x200/0x400, so every M5 part could take the encoder path.
    • There is no drm-shim profile for G17D.

Correction to my earlier comment. hk_cdm_alias_scope()'s M5 may_alias_memory path is not new: 23644ad is an ancestor of db928e7. Only the elision and the packing are new for G17D.

(a) G17G/G17S/G17C. Apart from commit 3, their behaviour is unchanged:

  • every case AGX_CHIP_G17C: outside tests is followed by case AGX_CHIP_G17D:;
  • the three positional tables and their static_assert are extended;
  • commit 2's new path is keyed on G17D, and the G17G/S/C bytes stay the same;
  • commit 4 accepts and refuses exactly the same G17G/S/C param sets as before;
  • the Gallium refusal of G17D cleans up correctly.

(c) LDIMM. 0x800 becomes byte 5 = 0x04 and 0x1000 becomes byte 5 = 0x08 (imm[12:11] at instruction bits 42-43). Both decode back exactly. The destination, the 8-byte form and the container size are all unchanged.

(d) Admission. G17D is admitted only as 0x6050, variant D, two dies, eight clusters, USC 3, HAL 300. The tests cover the 1-die, 4-cluster, 0x6051, HAL 200 and variant-C-with-2-dies refusals.

(b) Commit 3 on G17S. By the code's contract the flush is needed on every M5 part. The M5 weak launch tail orders the next launch but does not publish writes (hk_cmd_buffer.c:922-934), and nothing else covers VS→TCS, TCS→tessellator or VS→GS inside the pre-graphics stream. Whether a single-die part shows the failure is up to hardware.

The cost lands only on tessellated, geometry-shader and XFB draws: +2 strong tails per draw, up to +4 with tess+GS or with statistics and primitives-generated queries. Plain draws, mesh/task, compute, meta and libagx are unaffected.

M5 Pro (G17S) row, queued with the hw lock, FIFO, two ≤30-min slots. It uses three builds on the M5:

  • aurora-wip (no flush);
  • this series as committed (0x6000157c);
  • a local test-only variant with the plain flush (0x60001560).

The dEQP gate, about 32k cases per build, covers:

  • the 66 cases (as a superset), tessellation.*, geometry.*, clipping.* and ray_query in tess/geom stages;
  • samples of query_pool.statistics_query.* and transform_feedback.*;
  • compute, mesh and plain-draw controls.

Perf rows are gpubench render rows (control) and a Geekbench Vulkan A/B. Results will follow here.

@RyanTheTide

Copy link
Copy Markdown

Thanks for the rebase review. One request on the G17D question: we would prefer the J775D rerun on the rebased branch over excluding G17D from agx_chip_elide_app_dispatch_barrier() and packing. If an exclusion is needed, please base it on a measured G17D failure and say so in a comment next to the exclusion, so the M5 helper keeps covering every M5 part by default.

@DjDeveloperr

Copy link
Copy Markdown

@RyanTheTide, agreed: no exclusion. G17D stays in agx_chip_g17_m5() with the elision and packing, and the J775D rerun on the rebased branch covers them.

Local checks on the rebased series pass. I ran them on an aarch64 host, -j2, Vulkan configuration with tests. Every commit (a920130a, c759d8fb, fd34202c and 657cb956):

  • builds libvulkan_asahi.so with no warnings in the changed files;
  • passes an assert-enabled (-UNDEBUG) syntax check of every changed src/asahi/{lib,vulkan} file;
  • passes meson test --suite asahi: 139/139, 139/139, 140/140 and 140/140, with hk_internal_stage_flush OK.

The x86 asahi.yml CI run (Gallium + Vulkan, drm-shim) will follow when our offload builder is back.

@funkzy: to merge, we need two things from you.

  1. Either rebase onto aurora-wip yourself, or say yes and we'll push rebase/pr362-g17d to g17d-admission with your authorship kept.
  2. When you can, rerun the J775D checks (the compute, chained-submit, 46-client and 628-case subset) on the rebased head.

The M5 Pro (G17S) row for commit 3 is still queued on our side.

@funkzy

funkzy commented Nov 20, 2026

Copy link
Copy Markdown
Author

@DjDeveloperr, thanks. We'll do the rebase ourselves, onto the current aurora-wip head, and rerun the J775D checks (compute, chained submits, 46 clients and the 628-case subset) on it before pushing to g17d-admission. Results will follow here, together with the wording fix for commit 3's flush in the comment and the description.

@funkzy

funkzy commented Nov 20, 2026

Copy link
Copy Markdown
Author

dj, RyanTheTide: thanks. Rebased onto aurora-wip 82af196 and rerun on the Mac Studio (J775D, 27.2 stub), with
one new commit.

The two M5 defaults. G17D keeps both, as you suggested.

  • The elided barrier between application dispatches: correct, and faster. The compute CTS subset, the 628-case
    render subset (571 pass, 57 not supported, twice), compute, 300 chained submits, the timestamp test and 46 clients
    read the same with it as with G17D kept out of it (a test-only build). Back-to-back independent dispatches finish
    5.2x, 4.1x and 1.7x faster (512, 128 and 64 a command buffer, every element checked, both dies). llama.cpp's tg128
    is 16% faster, and pp512 is the same.
  • Submit packing does not run on the M5 Ultra yet. hk_pack_boundary() needs
    DRM_ASAHI_FEATURE_COMPUTE_VISIBLE_COMPLETION, and no current kernel reports it for the J775D: the board does not
    set the completion inputs. So there is nothing to measure until a kernel does.

A failure from #552 on the M5 Ultra. Under #552's per-resource rule these fail on the J775D:

  • 6 compute cases, on every run (six runs, three boots): dEQP-VK.compute.pipeline.basic.copy_image_to_ssbo_small,
    copy_image_to_ssbo_large, copy_ssbo_to_image_small, copy_ssbo_to_image_large, image_barrier_multiple,
    ssbo_cmd_barrier_multiple;
  • 5 more on three of those six runs: dEQP-VK.compute.pipeline.indirect_dispatch.gen_in_compute.empty_command,
    large_offset, large_offset_multiple_invocations, multi_dispatch, multiple_groups;
  • 2059 to 2160 of an 8520-case dEQP-VK.ycbcr sample, a different set from run to run;
  • 270 of 5310 dEQP-VK.image.host_image_copy cases;
  • llama.cpp's output (wrong text, greedy decoding, same model).

With ASAHI_M5_HOST_ALIAS_STATIC=1 every one of them passes. The tree before #552 (this PR's previous head, on
11ab5f0) is clean too: 104 pass and 13 not supported on the compute subset, and llama.cpp correct. With
ASAHI_M5_HOST_ALIAS_TRACE=1, the six cases and llama.cpp report no import and no change of scope. So no aliasing
resource is involved: on G17D the plain strong flush between dependent compute work is not enough by itself.

Why only the M5 Ultra? We don't know. Its two dies are one guess. It is not tested, and nothing we have shows it.
If it holds, it may matter for what #552 assumes on any later multi-die part, not only G17D.

Commit 5 gives the M5 Ultra's compute barriers memory scope, through one predicate,
agx_chip_m5_barriers_memory_scoped(), true for G17D for now. On G17D:

  • every launch's ordering record has memory scope (0x6000017c; the packer and decoder accept flags 0 with scope
    there only);
  • hk_cdm_alias_scope() answers yes whatever the device enabled, so every flush recorded for a dependency is
    0x6000157c;
  • a compute-to-compute dependency with no image barrier, transfer source or host access keeps the launch's scoped
    record instead of adding the strong flush;
  • hk_CreateDevice() gives it no per-resource rule.

G17G, G17S and G17C keep #552's rule and the plain record, and no call site names a chip. If the cause turns out to
be a device property, the predicate can be keyed on that instead, without touching the callers. Against the strong
memory-scoped flush at every compute dependency (which also passes everything), it is the same or slightly faster:
dispatches separated by barriers 0.5 to 5% less, llama.cpp and gpubench the same.

dj, ewb: could one of you run the six cases on an M5 Max (J716c) or M5 Pro, under the default rule (no
ASAHI_M5_HOST_ALIAS_STATIC)? A pass there points at something only the M5 Ultra has (the two dies, perhaps); a
failure points at the M5 family, and then the predicate should cover every M5 part.

deqp-vk --deqp-case='dEQP-VK.compute.pipeline.basic.copy_image_to_ssbo_*'
deqp-vk --deqp-case='dEQP-VK.compute.pipeline.basic.copy_ssbo_to_image_*'
deqp-vk --deqp-case='dEQP-VK.compute.pipeline.basic.image_barrier_multiple'
deqp-vk --deqp-case='dEQP-VK.compute.pipeline.basic.ssbo_cmd_barrier_multiple'

Rebase. One conflict, in agx_chip.h, as dj described: #354 moved agx_chip_g17_m5(), so commit 1 adds G17D to
the moved helper instead of a second copy. git range-diff: commits 2 to 4 are identical, and commit 1 differs only
in context lines. On top of that, text only: commit 1's message now says G17D takes the M5 defaults (the elision and
packing where the kernel reports it), and commit 3's comment and message describe the M5 flush as the memory-scoped
0x6000157c (G17P's is the plain 0x60001560). No code changed in either.

With all five commits, on one boot: the compute subset 104 pass / 13 not supported (twice), the ycbcr sample
and host_image_copy with no failure, the 628-case subset 571 / 57 (twice), compute, chained submits, timestamps and
46 clients exact, commit 3's 66 tessellated draws passing, and llama.cpp's perplexity identical to the pre-#552 tree
(43.2720), tg128 195.1 and 197.0 t/s on die 0, 197.5 and 197.4 on die 1. meson test --suite asahi 160 of 160.

@RyanTheTide

Copy link
Copy Markdown

Thanks for the rebase and the J775D reruns. Keeping both M5 defaults on G17D settles our earlier question.

For commit 5, agx_chip_m5_barriers_memory_scoped() naming G17D alone is fine with us. The measured failures sit in the comment next to it, the callers name no chip, and the predicate can widen to every M5 part, or move to a device property, once an M5 Pro or Max run under the default rule shows where the line is. We have no M5 hardware in our lab, so that run will have to come from someone who does.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blockers. Re-checked at 9cc49df against 4c9f43e. Only the admission commit changed, and the change is the shared refusal table we asked for on #363.

agx_drm_names.h stays libc-only. agx_gallium_refuses_gpu() matches by compatible or by chip name, and agx_screen_create() now refuses through it by agx_chip_name(), so the check still works under virtio, where no device tree is visible. The new test-chip-admission loop checks that G17D is refused and that every other chip is not, both by chip name and by compatible. The comment now says "zink over Borealis". The other four commits are byte-identical in git range-diff.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

DjDeveloperr commented Nov 25, 2026 •

Copy link
Copy Markdown

@funkzy @satchlj's live M5 Max (G17C B1) verification at 0a8eda4c78e1 (4,512/4,512 multi-draw tessellation, 80/81 compute pipeline, 24/36 indirect dispatch, 0 faults) plus your 283/283 packaged host suite clear items 1–3 and 5 of the prior change request (and @satchlj's eglinfo -B check on #363 covers the non-G17D native-Asahi check). The only remaining item before clearing the CR and queuing #362 -> #363 is the exact-head J775D (G17D) re-run at 0a8eda4c78e1 (and b5d23c1933c7 for #363).

@funkzy

funkzy commented Nov 25, 2026

Copy link
Copy Markdown
Author

@DjDeveloperr Exact-head J775D (Mac Studio, M5 Ultra, G17D B1) verification at 0a8eda4c78e1 on aurora-wip cedf24806bcb (build mesa-362r8, standalone), running on bare aurora-silicon/linux main bf03d7419ea8 (kit pr2501-m3b (window m5u-mesa362r8@20261124-1929), 27.0 stub, published Aura main c0aaf3162ede, default environment with no ASAHI_M5_BRINGUP or MESA_LOADER_DRIVER_OVERRIDE):

  • vulkaninfo --summary: Apple M5 Ultra (G17D B1), Borealis, Vulkan 1.4.363, Mesa 26.3.0-devel (git-0a8eda4c78).
  • 628-case render CTS subset: 571 Pass, 57 NotSupported, 0 Fail (7 s).
  • dEQP-VK.compute.pipeline.{basic,indirect_dispatch} (117 cases):
    • basic: 80 Pass, 1 NotSupported, 0 Fail (1 s) — all 6 compute barrier cases pass (copy_image_to_ssbo_{small,large}, copy_ssbo_to_image_{small,large}, image_barrier_multiple, ssbo_cmd_barrier_multiple).
    • indirect_dispatch: 24 Pass, 12 NotSupported, 0 Fail (0 s).
  • dEQP-VK.image.host_image_copy.* (1-in-8 sample, 5,310 cases): 1,784 Pass, 3,526 NotSupported, 0 Fail (1 s).
  • dEQP-VK.ycbcr.* (1-in-8 sample, 8,520 cases): 5,634 Pass, 2,886 NotSupported, 0 Fail (2 s).
  • Compute / submit / timestamp / concurrency checks: vkcompute plain 20/20 exact, burst 20/20 exact; vkchain 300/300 exact (median 122 us); vktimestamp 10/10 exact and in order; 46 concurrent clients (50 chained submits each) 46/46 PASS, 0 FAIL (3.6 s).
  • vkmark (13 default scenes, Wayland, 3 s each): Apple M5 Ultra (G17D B1), Score 23872.
  • llama.cpp (b12202, Vulkan backend): llama-bench --list-devices enumerates Vulkan0: Apple M5 Ultra (G17D B1) (Borealis, KHR_coopmat). With cooperative matrices now enabled by default on aurora-wip, llama-completion on this assert-enabled build hit a pre-existing upstream NIR metadata validation assertion (nir_metadata_check_validation_flag); #362 touches no NIR passes.
  • Regression check: 0 GPU recoveries, 0 Error(110), 0 firmware restarts, 0 GPU/MMU/UAT faults, 0 timeouts, 0 lost devices, 0 WARNING/BUG/Oops, 1/1 baseline failed unit (iwd.service; ALARM has no SELinux).

Ready for re-review and merge-train queueing.

Merge aurora-wip (e23b654) into g17d-admission, resolving the shader binary version assertion conflict in src/asahi/vulkan/tests/test-hk-execution-allowance.c (keep AGX_CHIP_G17D on the updated AGX3 binary version 51 alongside AGX2 version 38 and classic version 39).

Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
…ches

After merging aurora-wip (e23b654), hk_emit_fused_compute_dispatch()
built an M5 program descriptor without usc_clusters (causing
agx3_g17g_compute_program_generate() to fail and silently fall back to
unfused submission on every M5 part) and bound the launch without
ordering_memory_scope (omitting the multi-die memory-scope ordering
record on G17D).

Route all five M5 compute program/launch sites and hk_m5_loader_create()
in hk_cmd_dispatch.c through shared helpers
(hk_m5_compute_program_desc_set_device(),
hk_m5_compute_program_generate(), and hk_m5_compute_launch_bind()) so
compute cluster count and multi-die memory scope are derived from
hk_device in one place, and add fused M5 dispatch tests (G17G plain
0x60000160, G17D memory-scoped 0x6000017c, and zero-cluster refusal) in
test-hk-compute-pair-cache.c. The remaining graphics/G18 usc_clusters
sites in hk_cmd_draw.c, hk_cmd_buffer.c, and hk_shader.c are left as a
separate follow-up.

Also partition AGX_CAPS_M5 into AGX_CAPS_G17D_MEASURED and
AGX_CAPS_G17D_EXCLUDED in agx_chip_caps.h with a disjoint-cover check in
test-chip-caps.c so new M5 capabilities stay off on G17D until assigned.

Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
Merge aurora-silicon/mesa aurora-wip (a734049) into g17d-admission,
keeping both the G17D and updated G18G comment lines in agx_chip.h and
dropping the deleted hk_build_g17g_bg_eot() hunk in hk_cmd_draw.c (its
replacement hk_build_m5_bg_eot() already populates .usc_clusters).

Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
@funkzy

funkzy commented Nov 25, 2026

Copy link
Copy Markdown
Author

Merged current aurora-wip (a7340499fe17) into the branch (9701aa353879 + e2401a84bd45, normal pushes, no force push), resolving the 3-line shader binary version assertion conflict in test-hk-execution-allowance.c, the 3-line G18G/G17D comment in agx_chip.h, and dropping the obsolete hk_build_g17g_bg_eot() hunk deleted upstream in #1008 (hk_build_m5_bg_eot() already populates .usc_clusters), and added 0fbe9e82ac28 (borealis: keep fused M5 compute enabled and scope M5 Ultra fused launches):

  • Upstream #688 (hk_emit_fused_compute_dispatch()) built an M5 compute program desc without .usc_clusters (which would refuse and fall back to unfused on every M5 part after commit 3) and a launch desc without .ordering_memory_scope (missing G17D multi-die memory scope on fused launches). 0fbe9e82ac28 routes all Borealis M5 compute program generation and binding (including hk_m5_loader_create() and hk_emit_fused_compute_dispatch()) through shared device-seeded helpers so both fields come from hk_device in one place, adds fused M5 / G17D memory-scope / zero-cluster refusal tests in test-hk-compute-pair-cache.c, and explicitly partitions AGX_CAPS_M5 into AGX_CAPS_G17D_MEASURED and AGX_CAPS_G17D_EXCLUDED (with test_g17d_partitions_m5()). The remaining 9 graphics/G18 .usc_clusters call sites are noted as a follow-up.

Exact-head verification at e2401a84bd45 (build mesa-362m9, standalone, no needs, bare aurora-silicon/linux main bf03d7419ea8, kit pr2501-m3b (window m5u-mesa362m10@20261125-0025), 27.0 stub, published Aura main 7bf44a6374af, default env):

  • Host aarch64 Lima VM: meson test --suite asahi 313/313 OK (0 fail, including asahi-agx-chip-caps and hk_compute_pair_cache), zink/gbm/egl 6/6 OK.
  • J775D (G17D B1): vulkaninfo reports Apple M5 Ultra (G17D B1) / Borealis / 1.4.363, 628-case render CTS 571/57/0, dEQP-VK.compute.pipeline.{basic,indirect_dispatch} 80/1/0 (all 6 barrier cases pass) + 24/12/0, host_image_copy 1-in-8 1,784/3,526/0, ycbcr 1-in-8 5,634/2,886/0, vkcompute 20/20 plain & burst, vkchain 300/300 (median 108 us), vktimestamp 10/10, 46 concurrent clients 46/46, vkmark 23382, 0 GPU faults/recoveries/oops, 1/1 baseline failed unit (iwd.service; ALARM has no SELinux).

Ready for re-review and merge, @DjDeveloperr @satchlj.

@DjDeveloperr DjDeveloperr left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict merge at 0bb4666a07ef. Thanks, Jeff.
Blockers none.
Checked

  • Since e2401a84bd45, the two merges of aurora-wip move the series onto the per-chip preprocess entry points: agx_preprocess_nir_m5_chip() and the defer-idiv variant take the device's chip. The fixed-G17G wrappers are now called only from tests, so G17D never gets the signed-zero select it excludes.
  • AGX_CAPS_M5 gains the overlap-split and cached-command-memory bits from aurora-wip. G17D lists both as excluded, and the measured and excluded sets still cover AGX_CAPS_M5 with no overlap. MOD3 register-bank RA stays off on G17D.
  • 0bb4666a0: G18G general tile programs are composed as one-cluster G17G before re-encoding, so the helper base stays at 0x200 for any cluster count. The new test checks this for 2 and 4 clusters.
  • The flagged chip lines are all comments. Admission and routing key on chip-table properties.
  • Rows: the J714s row at this head matches its merge-base (97,036 cases; the only failures are submit out-of-memory flakes at 16 jobs, seen on base too). The J775D row at #363's head f7a1a3f3a9c8, which carries this head unchanged, passes.

@RyanTheTide

Copy link
Copy Markdown

GitHub reports conflicts against current aurora-wip at e2401a84bd45 and in the stacked loader PR at caec1a25218b. Please merge current aurora-wip into the admission branch and push it normally, then merge that updated branch into the loader PR. If the resolution changes shader output, device admission, or loader behavior, please point it out so we can recheck the affected J775D tests on the updated pair. #363

Merge aurora/aurora-wip (67e2a2f) into aurora-silicon#362 (e2401a8), reconciling
G17D admission with the upstream M5 capability, compression, cached compute
loader, and execution-allowance updates:

- Partition AGX_CAPS_M5 in agx_chip_caps.h into AGX_CAPS_G17D_MEASURED
  (ELIDE_APP_DISPATCH_BARRIER, COOPERATIVE_MATRIX, SPARSE_BINDING,
  GEN10_2D_COMPRESSION) and AGX_CAPS_G17D_EXCLUDED
  (VDM_INDIRECT_INDEX_BOUNDS, HW_TXF_BOUNDS, DESCRIPTOR_BUFFER,
  COALESCE_PURE_GLOBAL_WORKGROUPS, CDM_WAR_WEAK_BARRIER,
  SIGNED_ZERO_MINMAX_SELECT), matching test-chip-caps.c and
  test-hk-compression-contract.c.
- Replace the compile-time AGX_M5_SIGNED_ZERO_SELECT macro in agx_compile.c
  with chip-aware agx_preprocess_nir_m5_chip() and
  agx_preprocess_nir_m5_defer_idiv_chip() querying agx_chip_has_cap(), and
  route all runtime Borealis (hk_shader.c) and Gallium (agx_state.c)
  callers through them so G17D's exclusion stays enforced from one source.
- Route the cached fused compute loader in hk_cmd_dispatch.c through
  hk_m5_compute_launch_bind() and hk_m5_compute_program_generate() so G17D
  keeps its 8-cluster helper group and multi-die memory-scoped ordering.
- Populate num_clusters_total in graphics_launch_replay_correctness()
  (hk_cpu_upload_bench.c) for M5 chips including G17D.
- Reconcile test-chip.c (Gen5 LOD bias), test-hk-execution-allowance.c
  (binary version 52), and test-hk-g17p-compression.c.

Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
Merge aurora-wip (8c74e92): update the G17D shader binary version
expectation in test-hk-execution-allowance.c from 52 to 53, add
AGX_CAP_CDM_OVERLAP_SPLIT and AGX_CAP_CACHED_CMD_MEMORY to
AGX_CAPS_G17D_EXCLUDED until measured on J775D, and gate
test_cdm_overlap_splits() in test-hk-sync-prior.c on
AGX_CAP_CDM_OVERLAP_SPLIT while covering G17D in its excluded list.

Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
… helper base

hk_m5_tile_program() generates G18G general HAL300 tile programs by calling
the M5 composer as AGX_CHIP_G17G and then re-encoding the canonical GPU1
output with agx3_transcode_agx3d_ioto(). Because the M5 composer now scales
its SR14 helper base by desc->usc_clusters while agx3_transcode_agx3d_ioto()
accepts only 0x100/0x200 and doubles it, passing a multi-cluster G18G
device's num_clusters_total (2 on J873) shifted the transcoded G18G tile
helper base from 0x200 to 0x400, and >2 clusters would fail transcoding.

Add agx3_g18g_general_tile_program_generate() to compose the intermediate
G17G tile program with usc_clusters = 1, route hk_m5_tile_program()'s G18G
branch through it, and verify in test-g18g-reencode-cache that 2- and
4-cluster G18G tile descriptors transcode to SR14 helper base 0x200 and
match agx3_g18g_tile_program_generate() byte for byte.

Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
@funkzy
funkzy requested a review from a team as a code owner November 26, 2026 03:07
funkzy added a commit to funkzy/mesa that referenced this pull request Nov 26, 2026
Bring aurora-silicon#363 onto the updated aurora-silicon#362 merge commit (98f96bb) over
aurora/aurora-wip (67e2a2f).

Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
@funkzy

funkzy commented Nov 26, 2026

Copy link
Copy Markdown
Author

Merged current aurora-wip (8c74e92d5162) cleanly into g17d-admission and added one G18G tile fix at 0bb4666a07ef (normal non-force-push updates preserving approval):

  • Cached fused compute loader (hk_cmd_dispatch.c): routed through hk_m5_compute_launch_bind() and hk_m5_compute_program_generate() so 8-cluster G17D helper offsets and multi-die memory scope stay seeded from hk_device.
  • New AGX_CAPS_M5 partition (agx_chip_caps.h): added GEN10_2D_COMPRESSION to AGX_CAPS_G17D_MEASURED (verified below) and COALESCE_PURE_GLOBAL_WORKGROUPS, SIGNED_ZERO_MINMAX_SELECT, CDM_OVERLAP_SPLIT, and CACHED_CMD_MEMORY to AGX_CAPS_G17D_EXCLUDED.
  • Per-chip signed-zero min/max query (agx_compile.{h,c}, hk_shader.c, agx_state.c): replaced the compile-time AGX_M5_SIGNED_ZERO_SELECT macro with agx_preprocess_nir_m5_chip() / agx_preprocess_nir_m5_defer_idiv_chip() querying agx_chip_has_cap(chip, AGX_CAP_SIGNED_ZERO_MINMAX_SELECT) at all 7 runtime callers (6 Borealis, 1 Gallium) so G17D keeps SIGNED_ZERO_MINMAX_SELECT off as excluded.
  • G18G general tile helper base (0bb4666a07ef): added agx3_g18g_general_tile_program_generate() (usc_clusters = 1) and routed hk_m5_tile_program()'s G18G branch through it so multi-cluster G18G devices keep emitting the existing 0x200 SR14 helper base after agx3_transcode_agx3d_ioto() instead of 0x400 on 2-cluster J873 (or transcode refusal above 2 clusters), covered in test-g18g-reencode-cache.c.
  • Unit test updates (hk_cpu_upload_bench.c, test-hk-execution-allowance.c, test-hk-sync-prior.c): populated num_clusters_total (1/1/1/2/4/8, including G17D) in graphics_launch_replay_correctness() and restored 0 on teardown; updated G17D shader binary version expectation from 52 to 53; gated test_cdm_overlap_splits() on AGX_CAP_CDM_OVERLAP_SPLIT while covering G17D in its excluded list.

Exact-head J775D (G17D B1) verification at 0bb4666a07ef (build mesa-362m11, standalone, no needs, bare aurora-silicon/linux main f3bfe5007089, kit pr2884-m1b (window m5u-mesa362m13@20261125-1814), 27.0 stub, published Aura main 7bf44a6374af, default env):

  • Host aarch64 Lima VM: meson test --suite asahi 324/324 OK (0 fail), zink 2/2 OK.
  • J775D (G17D B1): vulkaninfo reports Apple M5 Ultra (G17D B1) / Borealis / 1.4.363; 628-case render CTS 571/57/0; dEQP-VK.compute.pipeline.{basic,indirect_dispatch} 80/1/0 (all 6 barrier cases pass) + 24/12/0; host_image_copy 1-in-8 1,783/3,527/0; ycbcr 1-in-8 5,634/2,886/0; Gen10 2D compression sample 496/704/0; Gen5 LOD bias 17/0; VK_EXT_depth_clip_control 17/0; VK_EXT_fragment_shader_interlock 192/384/0; vkcompute 20/20 plain & burst; vkchain 300/300 (median 126 us); vktimestamp 10/10; 46 concurrent clients 46/46; vkmark 24012; 0 GPU faults/recoveries/oops, 1/1 baseline failed unit (iwd.service; ALARM has no SELinux).

Ready to merge ahead of the src/borealis/ move, @RyanTheTide @DjDeveloperr.

@DjDeveloperr

Copy link
Copy Markdown

J714s (MacBook Pro 14" M5 Pro, G17S B1) row at 0bb4666a07ef: PASS, A/B against the merge-base 8c74e92d5162 on kernel 7.3.0-m5-cdirect16. The #363 head f7a1a3f3a9c8 ran in the same hold and is also clean.

@DjDeveloperr

DjDeveloperr commented Nov 26, 2026 •

Copy link
Copy Markdown

Thanks, Jeff. One thing has to change before this can merge.

#1111 landed on aurora-wip after your last forward merge. It adds AGX_CAP_MOD3_REG_BANK_RA to AGX_CAPS_M5. Merged onto the current tip (69179743d9ae), this branch fails one check: test-chip-caps.c:163, (AGX_CAPS_G17D_MEASURED | AGX_CAPS_G17D_EXCLUDED) == AGX_CAPS_M5 (mirror CI). The branch passes on its own head. This is the decision your partition test is there to force.

MOD3 register-bank RA hasn't been measured on the M5 Ultra, so please merge the current aurora-wip into the branch, then:

That changes nothing on the J714s or J775D, so the rows at this head still apply. Once the merge-result CI is green, #362 and then #363 merge.

funkzy added a commit to funkzy/mesa that referenced this pull request Nov 26, 2026
Replace the per-fill VkBufferView and PBE image-store path (08a8a66,
extended to native AGX3 in 3ee8572 and M5 in 83eb346) with an
8x-unrolled 256-thread global uint4 store compute shader on native AGX3
and M5 (inside hk_xfer_fillbuffer's existing agx_chip_native_or_m5
branch; AGX2 and G18G stay untouched on libagx_fill).

Each workgroup writes 32 KiB (256 threads x 8 uint4 stores). Engage for
16-byte-aligned fills (including sparse and captured-address buffers) at
size >= MAX2(8 MiB, agx_get_num_cores() * 32 KiB) so smaller in-cache
fills stay on vk_meta_fill_buffer_addr (1 KiB workgroups) without
32 KiB/WG partial-wave tail loss, while large fills benefit from the 8x
unroll and alternating forward/reverse sweep order (0bce194) without
per-fill buffer view or PBE descriptor setup (-31 net lines).

Measured headless A1/B1/B2/A2 on J775D (M5 Ultra, 80 cores, with aurora-silicon#362):
+26.6% at 8 MiB (845.7 vs 668.2 GB/s), +29.9% at 16 MiB (896.6 vs
690.4 GB/s), +37.7% at 32 MiB (954.4 vs 693.0 GB/s), and +53.6% at
64 MiB (1301.2 vs 847.4 GB/s), with fills below 8 MiB unchanged. On
J714s (M5 Pro, 20 cores, G17S), the same shader measured +26.4% at
8 MiB, +12.6% at 16 MiB, +58.1% at 32 MiB, and -3.1% at 64 MiB (297.5
vs 307.0 GB/s, both near the DRAM limit where base used PBE), while the
8 MiB floor keeps 1-4 MiB unchanged on vk_meta_fill_buffer_addr.

Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
Conflicts:
- agx_chip.h: G17C keeps both M5_LAYER_OPERAND (this branch) and
  TRI_MERGE_ACROSS_SIDE_EFFECTS (aurora-wip). G17D gets neither quirk.
- test-chip.c: tri_merge row now on for G17G/G17S/G17C and off for G17D.
- agx_state.c: keep .usc_clusters from this branch and take program_va = 0
  from aurora-wip (it is set after the allocation now).

aurora-wip also added TRI_MERGE_ACROSS_SIDE_EFFECTS and MOD3_REG_BANK_RA to
AGX_CAPS_M5. Neither is measured on the M5 Ultra, so both go to
AGX_CAPS_G17D_EXCLUDED, and G17D joins the MOD3 comment's "off on" list.
That keeps G17D's capabilities exactly as before.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide added a commit to funkzy/mesa that referenced this pull request Nov 27, 2026
Brings in the forward-merge of aurora-wip into g17d-admission (aurora-silicon#362). No conflicts.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown

funkzy's 24 h window on Dj's 11-26 request passed with no push, so as maintainers we merged aurora-wip (fa8970c; still merges cleanly with the newer 29bdd67) into g17d-admission as a fast-forward on top of 0bb4666a. The original commits are kept and nothing was force-pushed. New head: 963b466b.

Conflicts and how they were resolved:

  • agx_chip.h: G17C keeps both AGX_QUIRK_M5_LAYER_OPERAND (this branch) and AGX_QUIRK_TRI_MERGE_ACROSS_SIDE_EFFECTS (aurora-wip). G17D gets neither quirk, as before.
  • test-chip.c: the tri_merge row is on for G17G/G17S/G17C and off for G17D (101110). Every other row keeps this branch's G17D column.
  • agx_state.c: keeps .usc_clusters from this branch and takes .program_va = 0 from aurora-wip, which now sets it after the allocation.

Dj's request: AGX_CAP_MOD3_REG_BANK_RA is added to AGX_CAPS_G17D_EXCLUDED, and G17D is added to that capability's "off on" list. aurora-wip also added AGX_CAP_TRI_MERGE_ACROSS_SIDE_EFFECTS to AGX_CAPS_M5. That isn't measured on the M5 Ultra either, so it is excluded too. G17D's capability set is unchanged from the reviewed head.

Local x86 drm-shim gate (asahi + poly suites) at 963b466b: 338/338, including test-chip and test-chip-caps (partition check MEASURED | EXCLUDED == AGX_CAPS_M5). Per Dj's note, the J714s/J775D rows at 0bb4666a still apply: no capability or quirk changes on either chip. Resolution review requested from someone other than us.

@RyanTheTide

Copy link
Copy Markdown

Hold: at the forward-merged head, rows are still owed. A regression row on two non-M5 lab Macs is running now (shared code in hk_cmd_dispatch.c / agx_state.c / the IOTO program core changes for every chip). The approvals above are from before the forward-merge. Please don't merge before the row comment lands.

@RyanTheTide

Copy link
Copy Markdown

Regression row at 963b466bf069fb85d91f6d67ef4c9c06ffebea62 on two non-G17D Macs. Overlay only, nothing installed.

  • Macs: J713 M4 Air (G16G B0), kernel 7.3.0-aurora-fleet85; M1 Pro J316s (G13S C0), kernel 7.3.0-aurora-fleet89.
  • Base: aurora-wip 3edbd1c46211 (current tip). Head: 963b466bf069 (this PR). I also ran loader: pick zink for the M5 Ultra's GPU, so Hyprland and EGL clients start on its GPU instead of aborting #363's head b7e2f042acb4 (contains this PR) as a third arm.
  • Build: exact-sha git archive, native arm64 in the fc45 build container, release with asserts, Borealis Vulkan + asahi/zink Gallium + EGL/GBM/GLX. Same kits on both Macs.
  • Cases: 10,656 deqp-vk cases per arm (vulkan-cts-1.4.7.1). Subset: api.smoke, api.command_buffers, compute.pipeline basic/indirect_dispatch/builtin_var/zero_initialize_workgroup_memory, compute.* every 10th, pipeline.monolithic push_constant/input_assembly/vertex_input every 20th, draw.renderpass simple_draw/indirect_draw, glsl.loops, memory_model.message_passing every 8th, synchronization2.basic. J=4 on J713, J=2 on M1 Pro. Run order base, loader: pick zink for the M5 Ultra's GPU, so Hyprland and EGL clients start on its GPU instead of aborting #363, asahi: admit the M5 Ultra (G17D) as one row of the chip table, so Vulkan runs on the Mac Studio's GPU instead of failing at device open #362.
  • Fails, base vs head:
    • J713: 4 vs 4, the same cases (api.command_buffers.record_many_draws_{primary,secondary}_{1,2} DeviceLost, kernel submit EINVAL). This is the known aurora-wip G16G depth/stencil issue from borealis: enable HAL200 lossless compression on G16G #1050, not from this PR.
    • M1 Pro: 1 vs 1, the same case (compute.pipeline.basic.ssbo_cmd_barrier_multiple). It fails with a different wrong value in each arm and passes when run alone on base, head and packaged Mesa, so it is intermittent and was already there.
    • Per-case results are identical to base on both Macs.
  • New failures: 0. GPU fault/recovery lines: 0. AVC: 0. Enforcing, 0 failed units.
  • Render smoke (gpubench-vk compute.light/heavy, render.light/heavy, compile.pso): all ok. Depth-8 throughput is within 1 % of base on both Macs. The M1 Pro depth-1 latency is noisy, and a 6-round ABBA recheck shows overlapping ranges.
  • GL: eglinfo (surfaceless, gbm) and a GLES2 render/readback smoke pass on every arm. The renderer is Apple M4 (G16G B0) / Apple M1 Pro (G13S C0), from the overlay build.
  • Restore: production verified on both (saved entry running, next_entry empty, Enforcing, 0 failed units, system Mesa sha and rpm -V unchanged, scratch removed).
  • Kits: kits/test/20261127-mesa362-363-overlay/ (base, h362, h363). Evidence: traces/gpu/20261127-merge-blitz-rows/rows362/ on the lab store.

This covers regression on G13S and G16G only. G17D itself needs the M5 Ultra rows.

@RyanTheTide
RyanTheTide merged commit 1b4e816 into aurora-silicon:aurora-wip Nov 27, 2026
@RyanTheTide

Copy link
Copy Markdown

Merged. Conditions from Dj's 11-26 note: aurora-wip merged in, MOD3 (and TRI_MERGE) added to the G17D exclusions, local gate 338/338, Dj's J714s/J775D rows still valid, and regression rows on J713 + M1 Pro with 0 new failures. aurora-wip tip after #362 gates 338/338. Revert: git revert -m1 <merge sha> (#363 first). Still to run: a row on the M5 Ultra itself (J775D) once it boots this tip. Thanks Jeff.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post-merge resolution review at 963b466bf069fb85d91f6d67ef4c9c06ffebea62.

I found no revert trigger in the integration reviewed. The G17D measured and excluded capability lists preserve the single-die M5 defaults and exclude MOD3 and cross-side-effect TRI_MERGE on G17D. The program construction keeps the cluster count and the deferred address/relocation path. The landed delta in agx_state.c leaves the resolved graphics block intact. Reviewed the posted J713 and M1 Pro matched-run evidence and the 338/338 gate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants