Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions docs/drivers/asahi-capability-gates.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
Capability gates across GPU generations
=======================================

Every chip-specific gate in the Asahi drivers (Borealis Vulkan, the Gallium
driver, the compiler and ``src/poly``) should answer one question: does the
hardware or the firmware running on it lack the feature? If the answer is
"it was only measured on one chip", the gate is a to-do, not a limit.

Rules:

* Gate on a measured capability, not on the chip id. Use firmware or kernel
facts where they exist: ``drm_asahi_params_global.gpu_hal_generation``, the
``DRM_ASAHI_FEATURE_*`` bits, or the record and capability tables in
``agx_chip.h`` and ``agx_chip_caps.h``.
* Write the reason next to the gate: the hardware unit, the firmware
interface, or the measurement that showed the failure.
* A gate with no recorded reason, or one that says "until measured", is open
work. Enable it, prove it with CTS and gpubench on one Mac per generation,
and keep it only where it fails.

Generations: G13 (M1), G14 (M2), G15 (M3), G16G (M4), G17P (A18 Pro, M4 Pro,
M4 Max), G17G/S/C (M5), G18G (M6).

Shared-code gates that were not hardware limits
-----------------------------------------------

These gates were removed because the "chip-specific" behaviour was a bug in
shared code:

.. list-table::
:header-rows: 1

* - Gate
- What it was
- Change
* - ``compact_levels`` in ``poly_nir_lower_tcs_with_options()``
- Enabled for G17P only. On every other chip, a TCS writing
``gl_TessLevelOuter[gl_InvocationID]`` added the index to the varying
slot instead of the component. The patch was culled and the TES never
ran.
- Compact addressing on every chip: Vulkan in mesa#1324, Gallium in
mesa#1329.

Features opened to more generations
-----------------------------------

.. list-table::
:header-rows: 1

* - Feature
- Gate basis
- Status
* - Ray queries on G13/G14 (M1, M2)
- No ray-tracing unit, so traversal runs in software. Exposure is
selected by ISA (``AGX_ISA_ENCODING_AGX2``).
- mesa#1317
* - Hardware ray tracing on G16G (M4)
- The kernel advertises ``EXACT_PRIOR_BARRIERS | RENDER_RAY_QUERY``
(acceleration structures only with ``BOUNDED_AS_BUILD``). Same GEN1
runtime as G17P.
- mesa#1327 (the ray-tracing commit from #577)

G15 on HAL200 firmware
----------------------

Several G15 (M3) gates cite the older G15 command-stream generation (RTKit
2419): no CDM thread-invariant spill field in the compute launch, so no
native preamble, and none of the HAL200 compression contract. That reasoning
holds for the legacy firmware. On macOS 27.2 firmware the kernel runs G15G
on its g16 runtime (the HAL200 interface G16G uses), but still reports
``gpu_hal_generation == DRM_ASAHI_GPU_HAL_LEGACY``, so userspace cannot yet
tell the two firmwares apart. Measured on a MacBook Air M3 (J615) on 27.2,
with the features forced on in test builds:

* The HAL200 compute launch layout is accepted, including launches that carry
thread-invariant spill.
* Native preamble/CProg engages and is correct: 12,369 CTS cases Pass -> Pass.
On a uniform-heavy compute shader the main program drops from 130 to 11
instructions.
* HAL200 lossless colour compression and tri-merge across side effects:
13,423 CTS cases Pass -> Pass, with colour targets confirmed compressed.

The plan is to have the kernel report the 27.2 firmware (HAL200 on the g16
runtime's G15 rows, or a dedicated feature bit) and key these on that fact
instead of the chip, so G15 on legacy firmware keeps today's paths.

Gates kept, with evidence
-------------------------

.. list-table::
:header-rows: 1

* - Gate
- Chips
- Evidence
* - Sparse binding and residency on G16G
- Off on G16G
- Enabling it on an M4 Air with an older kernel fails 23
``sparse_resources`` cases (aliased binding and SSBO data
mismatches). The SSTT flush record is a HAL200 record, so it is not
the blocker; the failure needs a current-kernel row and a look at the
g16 runtime's page-table invalidation.
* - ``few_primitives``, ``fragment_busy`` on M4 Pro firmware V25G83
- Off on M4 Pro
- Firmware hangs or loses memory with them set (see the kernel's g17
variant table).
* - ``EXT_sampler_filter_minmax``
- Gen5 sampler only (M5, G18G)
- Earlier samplers have no reduction mode.
* - Strict sparse residency
- M5
- Needs soft faults, which only M5 has.
* - Colour compression of 16-byte formats on G17P
- Off
- Tilebuffer spill corrupts them (15 CTS failures).

Still to measure
----------------

* 8x MSAA on AGX3B (G15, G16G, G17P): the kernel admits it for M5; AGX3B is
unverified.
* ``VK_NV_cooperative_matrix2`` on AGX3B: the lowering exists only for AGX3C
(M5).
* CDM overlap split, coherent compute stores and Gen9 2D compression on G16G:
no regressions on an older kernel; a current-kernel row is pending.
* Hardware ray tracing on G15: the M3 kernel runtime has no ray-query
work-item state yet.
1 change: 1 addition & 0 deletions docs/drivers/asahi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ working as before.
:maxdepth: 1

asahi-barriers
asahi-capability-gates

Wrap (macOS only)
-----------------
Expand Down