Skip to content

hk: set up G17P ray tracing only for devices that enable it; keep test assertions in release builds - #32

Merged
DjDeveloperr merged 3 commits into
aurora-wipfrom
aurora/g17p-rt-on-demand-20261022
Oct 23, 2026
Merged

DjDeveloperr merged 3 commits into
aurora-wipfrom
aurora/g17p-rt-on-demand-20261022

Conversation

@DjDeveloperr

Copy link
Copy Markdown
  • hk: G17P ray-tracing state only for devices that enable an RT feature. A Vulkan device without RT features no longer pays for ray-query scratch in its render free list or for the RQ code image. On Neo (A18 Pro), a render-only device's kernel GPU memory went from 165 to 61 MB and user GEM from 19 to 4.5 MB. A 16-client burst peaked 666 MB lower. Ray-query CTS was unchanged against the baseline, and zink, Chromium and vkmark were at parity.
  • hk/tests, asahi/tests: assertions in release builds. Three hk tests used assert() without #undef NDEBUG, so the release (b_ndebug) package build checked nothing and the host-AS test crashed. Two NIR tests undefined NDEBUG before the NIR headers, which broke the release link (nir_validate_shader).

Meson: 100/100 on aurora-wip dde4825.

Three host tests relied on assert() but did not undefine NDEBUG. The
package build sets b_ndebug, so test-hk-host-as dropped its staging-layout
call and crashed, and the lifetime and execution-allowance tests checked
nothing. Undefine NDEBUG before <assert.h>, as the other hk tests do.
test-gen1-wait and test-hk-rt-inlining undefined NDEBUG before the NIR
headers. In a b_ndebug build that declares the out-of-line
nir_validate_shader(), which libnir does not provide then, so the tests
fail to link and the build stops. Undefine it just before <assert.h>, as
the other hk tests do.
hk_device_init_accel_struct_state() created the native ray-tracing state
for every G17P device on a kernel that supports it: the 11 MB ray query
program image with its 630 fixed code binds, the acceleration-structure
tables, and the profile flags that make every queue reserve render SCS.
The kernel sizes each render context's free list from that reservation,
so a device that never traces a ray held a render pool of about 103 MB
instead of 23.5 MB, on top of the user memory for the image.

No acceleration structure, ray query or ray-tracing pipeline can exist on
a device that enables none of the ray-tracing features, so create the
state only when one of them is enabled. Other devices keep the state a
G17P device has on a kernel without native ray tracing, and their queues
are created without a render SCS layout.

Shaders compile differently for the two kinds of device: ray-query shaders
use the native query ABI, and Poly's geometry and evaluation lowering runs
extra passes under the native profile even without queries. Add the
decision to the shader feature key, which every graphics and compute
shader cache key hashes, including pipeline binary keys and module
identifier lookups, so neither the in-memory nor the disk cache hands one
kind of device a binary built for the other. Ray-tracing pipelines exist
only on ray-tracing devices. Refuse a deserialized shader that needs the
native ray-query state on a device without it.

Ray-tracing devices are unchanged. Other GPUs and kernels cannot enable
these features, so their state and cache keys are unchanged as well.
@DjDeveloperr
DjDeveloperr force-pushed the aurora/g17p-rt-on-demand-20261022 branch from e8cc0dd to 43fe12d Compare October 22, 2026 23:07
@DjDeveloperr

Copy link
Copy Markdown
Author

Rebased onto aurora-wip c363804 (the Borealis identity commit); no conflicts. Neo (A18 Pro, G17P) results on the new base: a render-only Vulkan device now gets the plain 24 MB render free list instead of the ray-query-sized one. Ray-query CTS sample: 1,990 pass, 10 not supported, 0 fail. Validated render and compute stress clients pass. Meson: 100/100.

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.

1 participant