Repository navigation
asahi: enable native shader preambles (Ioto CProg) on G16G - #716
Conversation
|
Read at f67f15c. The two guard changes in agx_ioto_load_core.c ( Two points:
Perf is neutral overall (+0.15% wall geomean, with Assisted-by: LLM (Claude:Opus 5.5) |
Add AGX_QUIRK_NATIVE_PREAMBLE to the G16G chip entry, widen the two remaining AGX_CHIP_G17P guards in agx_ioto_load_core.c to agx_chip_native_preamble(), and update test-chip and agx3_ioto_uniform_program for G16G parity with G17P. G16G and G17P share HAL200 (cs_generation = HAL200, sampler_generation = GEN4_HAL200), AGX3B, and GPU0 Ioto; enabling native CProg on G16G brings G17P/HAL200 parity and smaller shader binaries (overall ABBA performance is neutral at +0.15% wall geomean). G15* remains excluded because it uses the older G15 (RTKit 2419) command-stream generation whose direct CDM launch has no TI spill field for agx_chip_query_ti_spill(), and native preambles have not been hardware-qualified on M3/J615. Because agx_chip_query_ti_spill() tracks agx_chip_native_preamble(), enabling the quirk on G16G turns on: - Vulkan VS/FS native Ioto CProg and monolithic FS uniform-export blend CProg (hk_shader.c, hk_cmd_draw.c), - Gallium OpenGL FS native CProg (agx_state.c:2835), and - Gallium OpenGL compute TI spill reservation on resource-info queries via agx_chip_query_ti_spill() (agx_state.c:8163, matching G17P and Vulkan hk_cmd_dispatch.c). Signed-off-by: Diljit Singh <hey@djdev.me>
f67f15c to
4e2f016
Compare
|
@RyanTheTide Thanks for the review — pushed R2 (
Assisted-by: LLM (Gemini:4 Neon) |
satchlj
left a comment
There was a problem hiding this comment.
Verdict at 4e2f016cb76a
Approved.
Blockers
None.
Checked
- Audited all 4 changed files (
src/asahi/lib/agx_chip.h,src/asahi/lib/agx_ioto_load_core.c,src/asahi/lib/tests/test-chip.c,src/asahi/compiler/test/test-agx3-ioto-uniform-program.c). - Verified
AGX_QUIRK_NATIVE_PREAMBLEis enabled onG16Ginagx_chip.hwith clear documentation of whyG15*remains excluded, and the two remainingAGX_CHIP_G17Pguards inagx_ioto_load_core.care widened toagx_chip_native_preamble(). - Verified build,
217/217non-layoutasahitests (includingasahi-agx-chip,agx3_ioto_uniform_program, andagx_tests), and live Borealis Vulkan compute smoke on Apple M5 Max (G17C B1), Linux 7.3 (MESA_SHADER_CACHE_DISABLE=1) confirming no M5 regression and0GPU faults indmesg. - Untested scope: Live hardware execution on
G16G(M4).
Evidence
meson test --suite asahi(non-layout):217/217OK (asahi-agx-chip,agx3_ioto_uniform_program,agx_testsall OK)- Live Apple M5 Max (
G17C B1), Linux 7.3,MESA_SHADER_CACHE_DISABLE=1:dEQP-VK.compute.pipeline.basic.*:80/81passed (0failed,1not supported)dmesgGPU fault delta:0
|
Merged into Verification summary:
|
…bounds PRs aurora-silicon#716 and aurora-silicon#760 updated the agx_chip_native_preamble() and agx_chip_vdm_indirect_index_bounds() predicates in agx_chip.h from pre-agx_chip_caps.h bases without updating the matching capability rows in agx_chip_caps.h, breaking test-chip-caps on aurora-wip. Add AGX_CAP_NATIVE_PREAMBLE to G16G and AGX_CAP_VDM_INDIRECT_INDEX_BOUNDS to AGX_CAPS_G17P so agx_chip_has_cap() agrees with the predicates on all chips. Signed-off-by: Diljit Singh <hey@djdev.me>
Summary
Brings
AGX_CHIP_G16G(M4) intoG17P/HAL200parity for native shader preambles (Ioto CProg) and smaller shader binaries, while keepingG15*excluded:src/asahi/lib/agx_chip.h: AddAGX_QUIRK_NATIVE_PREAMBLEtoG16Gand document theHAL200(G16G/G17P) vsG15(RTKit 2419) boundary —G15*usescs_generation = G15whose direct CDM launch lacks a TI spill field foragx_chip_query_ti_spill(), and native preambles have not been hardware-qualified on M3/J615.src/asahi/lib/agx_ioto_load_core.c: Widen the two remainingAGX_CHIP_G17Pguards inagx_ioto_cprog_input_offset()andagx_ioto_load_finish_worst_case_size_with_ops()toagx_chip_native_preamble().src/asahi/lib/tests/test-chip.c&src/asahi/compiler/test/test-agx3-ioto-uniform-program.c: Update chip-matrix expectations (agx_chip_native_preamble,agx_chip_query_ti_spill) and CProg publication unit tests forG16G(retainingG15Grefusal coverage).Because
agx_chip_query_ti_spill()followsagx_chip_native_preamble(), this enables:hk_shader.c,hk_cmd_draw.c),agx_state.c:2835), andagx_chip_query_ti_spill()(agx_state.c:8163, matchingG17Pand Vulkanhk_cmd_dispatch.c).Verification (
Apple M4 G16G B0,J773g,Linux 7.3)meson test --suite asahi156 / 156 PASS;DEFAULT_BRANCH=aurora-wip .github/aurora/agent-policy.sh pr HEADclean.AGX_MESA_DEBUG=shaders:0preamble=1binaries on basec0b51ef24554→ 3 nativepreamble=1binaries onf67f15c3bb1d(e.g.render.bindless_uboVS shrunk372 → 306B,110B preamble; FS60B preamble).--jobs 8):2,571 Pass / 429 NotSupported / 0 Fail / 0 Crash / 0 Timeout(vk-mustpass-short87/87,cprog_sweep2,484/0),0GPU faults.query_ti_spillproof:1,029 Pass / 11 NotSupported / 0 Fail / 0 Crash / 0 Timeout(gles31-588-gl50750/0,dEQP-GLES31.functional.compute.*195/0,image_load_store.*image_size*60/0,texture_size.*24/0), plusprojected.*_mirror2/2 PASS,0GPU faults.AGX_MESA_DEBUG=shaders: confirmedMESA_SHADER_FRAGMENTstage=4 preamble=1 encoding=1 size=328(andsize=228) andMESA_SHADER_COMPUTEuses_resource_info_query: trueexecuting cleanly with0faults.gpubench-vk(f67f15c3bb1dvsc0b51ef24554, 14 rows):+0.15%wall geomean /+1.27%gpu_usgeomean;render.shadow-2.4%wall /-1.3%gpu_us), confirming the value is smaller shader binaries andG17P/HAL200parity rather than a broad speedup.0GPU faults,0recoveries,0hang kills across all runs.