Repository navigation
borealis: let a drirc profile cap the commands per kernel submission - #438
Conversation
|
Some data from the M4 Max (J616C, T6041, G17P, firmware 25G83), in case it helps decide the gating here. I ported only the render-clear half of this PR to G17P (your 5090c9b plus a gate change, single-sample clears only because of the M4 family's multisampled uncovered-tile defect) and A/B'd it in CS2 with the same binary and an env switch: offline de_dust2, fixed camera, 1728x1117, MSAA 4x, FSR on, 15-20 s windows, fps from the driver's present calls.
The clear-only passes did move from compute to the render engine as intended (compute jobs per submit dropped a lot), but the frame got slower overall on G17P. So I'd keep this G17C-only for now rather than widening it to G17P. Context: those runs were on a kernel where CS2 was mostly limited by a different stall (passes beyond the 32-in-flight window waiting for a jiffy-long poll at HZ=250, now in aurora-silicon/linux#2213; CS2 went ~102 -> ~158 fps with that fix). I haven't re-run the clear A/B on top of that kernel fix, so the G17P number could change; I can re-measure if useful. Disclosure: prepared with an AI tool; the measurements were run on my M4 Max. |
|
Thanks for the CS2 investigation, and for the G17P data from the comment thread. We select behaviour by a hardware property and keep a gate only when a code comment gives the hardware reason. Two parts of this are tied to G17C:
We can supply CS2 or synthetic rows on our M1 Pro, M2, M4 Pro and A18 Pro. |
a067aec to
58bce3e
Compare
|
Note 🤖 Claude Opus 5.5 responding on behalf of erikwb Both points are addressed in 58bce3e.
|
RyanTheTide
left a comment
There was a problem hiding this comment.
No blockers. Re-review of 58bce3e. Both earlier points are resolved: the render-clear gate now cites the G17P measurement and the AGX2 native_eot reason in a comment, and batching is a generic hk_submit_batch_size applied in max_commands_per_submit().
- Scope widened: the render clears (src/asahi/vulkan/hk_cmd_buffer.c:4807) now run on G17G and G17S as well as G17C, but the evidence (CS2 timedemo and the clear readbacks at widths 16/32/33) is from the M5 Max only. Before merge, please add one M5 or M5 Pro row with the clear readbacks and
dEQP-VK.api.image_clearing.*. - The CS2 profile now sets
hk_submit_batch_size=2on every chip (00-hk-defaults.conf), but the gain was measured only on the M5 Max.MIN2keeps it safe, so this is about perf, not correctness. We'll run the CS2 rows below with 0 vs 2 and post them. If it loses anywhere, the profile entry can be limited to where it wins. - The G17P exclusion rests on the 11% A/B, which predates linux#2213 (as AxxzyWasTaken noted). It is fine to keep for now, but it is worth re-measuring on a kernel that has #2213.
HW rows we can run: J616s (M4 Pro) and M1 Pro: the CS2 Dust II timedemo, hk_submit_batch_size 0 vs 2, alternating launches. Pass = no FPS loss with 2.
Assisted-by: LLM (Claude:Opus 5.5)
|
Blockers: 1.
No CI checks are reported on this branch. HW row: M5 Max (J716c) at 58bce3e: the CTS groups above, 0 new Fail/Crash, 0 GPU faults; CS2 Dust II timedemo base vs head with Assisted-by: LLM (Claude:Opus 5.5) |
58bce3e to
afd2fb5
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Updated to
|
|
Re-review of afd2fb5. Fixed:
Still open, all evidence (no code change requested):
Assisted-by: LLM (Claude:Opus 5.5) |
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb @RyanTheTide Ran the CS2 Dust II timedemo A/B at 3-way balanced 3×3 Latin square (1280×720, 2× MSAA, VSync off, 530-frame
To check whether render clears still help when combined with
Driver identities (x86_64 release
Updated the PR description with these tables and raw engine output. Given that commit 1 ( |
Splitting a long submission into smaller kernel ioctls lets the GPU start work from the first ioctl while the kernel validates later ioctls. Add hk_submit_batch_size, a drirc option that caps the commands in each kernel submission on any chip, and apply it in max_commands_per_submit(), which splitting, synchronization and resource tracking already share. 0 keeps the kernel and batching limits. Set it to 2 for Counter-Strike 2, where it was measured on the M5 Max. Signed-off-by: Erik Bourget <erik@ebourget.net>
afd2fb5 to
ec5a8c8
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Dropped the M5 render-clears commit (
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Review of ec5a8c8336593f071b948214ea4db534921ac2ba
0 code/policy/attribution blockers. Holding APPROVE only for §5 multi-generation CS2 A/B evidence on G17P and AGX2.
Checklist summary
- §1 No model gating: Pass.
hk_submit_batch_sizeis a generic0..64(default0) drirc option applied uniformly across all GPUs viamax_commands_per_submit(), with no chip or board gates. - §2 Hygiene & §3 Correctness: Pass. Dropping the regressing single-sample render-clear commit leaves a clean, minimal
+20/-2change. Verified all callers ofmax_commands_per_submit()insrc/asahi/vulkan/hk_queue.c(hk_sibling_eligible(),hk_cmd_pending_begin()chunk count,chunk_timelines/point_count,queue_submit_singlevsqueue_submit_looped, and chunk slicing insidequeue_submit_looped) share the capped limit consistently.MIN2(limit, dev->submit_batch_size)when non-zero preserves kernel/batching upper bounds and guarantees a positive divisor (>= 1). - §4 Attribution & clean-room: Pass. Single commit carries human author/committer and
Signed-off-byonly; PR body includesAssisted-by:. - §6 Naming: Pass. Commit subject uses
borealis:and PR body uses Borealis;hk_submit_batch_sizematches the pre-#591src/asahi/vulkan/hk_*codebase (#591 also retains existinghk_*drirc option names). - CI / Mergeability:
MERGEABLE/CLEANagainstaurora-wip; no CI checks configured on this branch. Hostmeson test --suite asahi(154/154) and aarch64 release build pass onec5a8c833659. - §5 Evidence (J716c / J713): Strong same-machine isolation on J716c (M5 Max, G17C):
+64.1% mean / +58.1% medianFPS (-37.3% P95), 0 GPU kernel errors / 0 AVC / 0 new failed units, plus 58,945 clear CTS cases on J716c (0 diffs atbatch=0and2) and 555 sampled cases on J713 (G16G).
Remaining items (§5 evidence)
Because 00-hk-defaults.conf sets hk_submit_batch_size=2 for Counter-Strike 2 on all GPU generations, §5 requires same-machine A/B coverage on the other affected generations (already listed under Still to run):
- G17P (M4 Pro / M4 Max / A18 Pro): alternating CS2 Dust II timedemo A/B (
hk_submit_batch_size0 vs 2), specifically verifying that disqualifying >2-command compute submissions fromhk_sibling_eligible()(hk_queue.c:1521) does not regress G17P. - AGX2 (M1 Pro / M2): alternating CS2 Dust II timedemo A/B (
hk_submit_batch_size0 vs 2). If2regresses on either generation, the CS2 profile entry should be scoped accordingly with the measurement cited.
Assisted-by: LLM (Gemini 4 Neon)
|
AGX2 row (M2 MacBook Air J413, G14G, fleet82 kernel, user-space overlays; base = main bc937ed, head = main + this PR ec5a8c8).
No perf was measured on AGX2 for this PR. No CTS regression on AGX2. |
|
Note 🤖 Gemini 4 Hydrogen responding on behalf of erikwb Recorded Verified against Still to run continues to track the G17P (M4 Pro / M4 Max / A18 Pro) and AGX2 (M1 Pro / M2) CS2 Dust II timedemo |
satchlj
left a comment
There was a problem hiding this comment.
Verdict at ec5a8c833659
Approved.
Blockers
None.
Checked
- Audited all 5 changed files (
src/asahi/vulkan/hk_drirc.py,src/asahi/vulkan/hk_device.h,src/asahi/vulkan/hk_device.c,src/asahi/vulkan/hk_queue.c,src/util/00-mesa-defaults.conf). - Verified
hk_submit_batch_sizeis clamped to[0, 64]with default0, keeping default submission sizing unchanged for all profiles without an override. - Verified
max_commands_per_submit()insrc/asahi/vulkan/hk_queue.calways returns a positive limit (>= 1) and is shared consistently across all batching and split-calculation callers inhk_queue.c. - Verified build,
216/216non-layoutasahitests, and live Borealis Vulkan CTS on Apple M5 Max (G17C B1), Linux 7.3 (MESA_SHADER_CACHE_DISABLE=1) across default,hk_submit_batch_size=2, andhk_submit_batch_size=1with0GPU faults indmesg. - Untested scope: Live CS2 frame-pacing / throughput A/B benchmark on AGX2 / AGX3B hardware.
Evidence
meson test --suite asahi(non-layout):216/216OK (agx_testsOK)- Live Apple M5 Max (
G17C B1), Linux 7.3,MESA_SHADER_CACHE_DISABLE=1:- Default (
hk_submit_batch_size=0):dEQP-VK.compute.pipeline.basic.*:80/81passed (0failed,1not supported) hk_submit_batch_size=2:dEQP-VK.compute.pipeline.basic.*:80/81passed (0failed,1not supported)hk_submit_batch_size=1:dEQP-VK.synchronization.smoke.*:12/12passed (0failed)dmesgGPU fault delta:0
- Default (
|
Merged after merge-result CI passed. The G17P and AGX2 Counter-Strike 2 timedemo A/B rows ( |
Problem
Long multi-command submissions in Counter-Strike 2 keep the GPU waiting while the kernel validates the remaining commands in the ioctl.
Change
hk_submit_batch_size) (src/asahi/vulkan/hk_drirc_gen.py,hk_device.{c,h},hk_queue.c,00-hk-defaults.conf): add an integer drirc option (0..64, default0) applied inmax_commands_per_submit(), which splitting, synchronization, and resource tracking already share.0preserves the existing kernel and batching limits.hk_submit_batch_size=2for Counter-Strike 2 (csgo), letting the GPU start work from the first ioctl while the kernel validates later ioctls.hk_submit_batch_size(currently Counter-Strike 2 only). Note: capping to 2 commands per ioctl preventshk_sibling_eligible()from pairing >2-command compute submissions on G17P, so G17P and AGX2 A/B rows are tracked in Still to run.5d35c9f81bc) was dropped after 3-way CS2 isolation onaurora-wip(8e288e5dbc3) showed render clears alone regressed CS2 by −6.0% FPS and added no clear gain on top ofhk_submit_batch_size=2.Testing
ec5a8c83365,x86_64,debugoptimized):meson test --suite asahi— 154/154 OK, 0 fail.ec5a8c83365,aarch64, release):libvulkan_asahi.sobuilt cleanly with 0 warnings in touched files.7.3.0-ewb270+) — CS2 Dust II timedemo (aurora_dust2_short.dem, 530 frames, 1280×720, 2× MSAA, VSync off, FEX x86_64):0new GPU kernel errors indmesg,0AVC denials (Arch Linux, SELinux not installed),0new failed systemd units (aurora-peripherals.servicepre-existing).libvulkan_asahi.so, verified viaVK_LOADER_DEBUG=driveron warmup):8e288e5dbc3):dab5378fd130c70912dc00e62dab4955b083b3cb59e8e3a7c00e20e037116f6c8e288e5dbc3+hk_submit_batch_size=2, identical code toec5a8c83365, comment-only diff):884816245d53e071a346262728294abcb922a11ac42fc83a783c388d3bd8bfa6afd2fb56132):cc0facf876a9110e844ed62ebbc35bf25c2f60fc29011196995ebea90135db598e288e5dbc3)batch=0(render clears only, dropped)batch=2(render clears +batch=2)batch=2only (8e288e5dbc3+ this commit)batch=2vs earlier Latin-square Base)J716cG17C B1 +J713M4 G16G B0): Earlier headafd2fb56132(samehk_submit_batch_sizeimplementation) passed 58,945 Vulkan clear CTS cases on J716c (0 diffs vs base at bothbatch=0andbatch=2, 0 GPU kernel errors) and 555 sampled cases on J713 (0 diffs, 0 failed units).J413Apple M2 MacBook Air, G14G / AGX2,fleet82kernel,ec5a8c83onmainbc937edc540, run by@RyanTheTide): Vulkan CTS A/B across a 16.2k-case buffer/memory cut, a 4.0k sampling cut, and a 1.5k subgroups cut:drirc:0status differences vs base across all three cuts (CS2csgoprofile does not apply outside Counter-Strike 2).hk_submit_batch_size=2forced:0differences on sampling and subgroups; in the 16.2k buffer/memory cut, 4subgroups.arithmetic.compute.*_requiredsubgroupsizecases returnedResourceErroratJ=8and passed3/3when rerun alone on both arms (load flakiness, not a regression).0CTS regressions on AGX2; no perf measured on AGX2.Still to run
hk_submit_batch_size0 vs 2 alternating launches (AGX2 CTS is clean onJ413, perf remains unmeasured on both G17P and AGX2), verifying whether losinghk_sibling_eligible()for >2-command compute submissions regresses G17P; if it loses on any generation, the CS2 profile entry can be narrowed accordingly.CS2 Dust II timedemo commands and raw engine output (J716c, 7.3.0-ewb270+)
Input: local Dust II recording (
aurora_dust2_short.dem), SHA-2567fff8bb95dbea92f7555f476708542eb53b357f303c98bd00a0b6861349ad044.3-way balanced 3×3 Latin square (after warmups
base123.76 fps,head-b0116.35 fps):Follow-up 2-way alternating A/B (
batch-only=8e288e5dbc3+hk_submit_batch_size=2only, vshead-b2; after warmupbatch-only196.26 fps):