diff options
| author | Param Patel <256633936+Param-2811@users.noreply.github.com> | 2026-11-29 23:35:43 +0530 |
|---|---|---|
| committer | Param Patel <256633936+Param-2811@users.noreply.github.com> | 2026-11-29 23:38:43 +0530 |
| commit | fe5a7a8af249a96f25edc113086df9af9cc92d1d (patch) | |
| tree | c76298adbb424e1c31946f61e3fd0380ce72b7bc /runtime/test/code_hooks_test.cpp | |
| parent | eedd72e309647529bc3a025b1b13a9ef329c9233 (diff) | |
leonida-shader: time group packing on the card; tests prefer the high-performance adapter
- `Host::new` takes the high-performance adapter first
(`EnumAdapterByGpuPreference`), then the default as before. On a laptop
the default adapter is the integrated GPU, so the GPU tests ran there.
- `TIME_REPEATS` (tests only): `Host::dispatch` runs the dispatch n times
between two GPU timestamps, each behind a UAV barrier, and leaves the
microseconds of one.
- `packing_times` (ignored, run by hand): the 32-thread console program of
the pack tests, unpacked and packed 2, 4 and 8, over 1,024, 8,192 and
57,600 groups, every run's stores checked against the console's.
Measured on an RTX 4060 Laptop GPU (8 GB, Ada), driver 621.01, Windows 11
build 26300, four runs, least of three per point, us a dispatch:
shape groups unpacked packed 4 gain
32x1x1 1,024 1.9-2.7 1.5-2.2 1.2x
32x1x1 8,192 9.7-11.9 5.4-8.1 1.5-1.8x
32x1x1 57,600 119-143 119-122 1.0-1.2x
8x4x1 8,192 9.2-9.9 5.2-5.5 1.8x
8x4x1 57,600 119-125 119-126 1.0x
Packed 4 was never slower than unpacked; packed 8 is worse than 4 for
32x1x1. At 57,600 groups the program writes 29.5 MB in about 120 us
(about 240 GB/s, the card's memory bandwidth), so that point measures
memory, not launch.
This is the best case: a program of 16 VGPRs and next to no arithmetic.
In the game on an RTX 3070 Ti (Wine, VKD3D-Proton), `LEONIDA_GROUP_PACK=4`
made the GPU wait longer (8.7-14.5 -> 25-52 ms; djrolfes in #1608, who
suspects the register pressure of the packed programs that use many
VGPRs: 554 of the 1,396 packed use over 128). So this does not turn
packing on. What it gives is a way to measure a packing rule on a card
before a game run, for example packing only programs under some VGPR
count.
leonida-shader --features host --lib: 365 passed, 0 failed, 5 ignored, on
that card. AI-assisted (Claude).
Diffstat (limited to 'runtime/test/code_hooks_test.cpp')
0 files changed, 0 insertions, 0 deletions