VRAM: ray-tracing working buffers (rt-aux 643 MB) sized for the worst case #161

Closed
opened 2026-09-29 05:49:02 +00:00 by sky_line · 0 comments
Owner

VKMem breakdown in a busy two-sim view: rt 403 ... as 944 (51466 blas) rt-aux 643. That's ~2 GB for ray tracing, of which 643 MB is auxiliary (build scratch, TLAS instance / geometry tables, rig position buffer, used-bit readbacks).

These look sized for the maximum rather than the live need:

  • TLAS capacity is 491,520 instances vs ~40-100k active.
  • Scratch is grown to the largest frame's builds and kept.

Check / fix

  • Size the TLAS instance / rt_geom tables and the TLAS itself from active instances (the pass-A compaction count), not buffer capacity. Grow with headroom and shrink when far over.
  • Bound scratch: split large build batches across frames rather than one scratch big enough for all of them.
  • Review the 944 MB of BLAS: ~45k static BLAS at the 768 MB budget. Check the compaction hit rate, and whether distant or small objects need BLAS at all within RenderVKRTRadius.
  • Break the rt / rt-aux lines into their parts in the VKMem log so regressions are visible.

Refs #157.

VKMem breakdown in a busy two-sim view: `rt 403 ... as 944 (51466 blas) rt-aux 643`. That's ~2 GB for ray tracing, of which **643 MB is auxiliary** (build scratch, TLAS instance / geometry tables, rig position buffer, used-bit readbacks). These look sized for the maximum rather than the live need: - TLAS capacity is 491,520 instances vs ~40-100k active. - Scratch is grown to the largest frame's builds and kept. ## Check / fix - Size the TLAS instance / rt_geom tables and the TLAS itself from **active** instances (the pass-A compaction count), not buffer capacity. Grow with headroom and shrink when far over. - Bound scratch: split large build batches across frames rather than one scratch big enough for all of them. - Review the 944 MB of BLAS: ~45k static BLAS at the 768 MB budget. Check the compaction hit rate, and whether distant or small objects need BLAS at all within `RenderVKRTRadius`. - Break the `rt` / `rt-aux` lines into their parts in the VKMem log so regressions are visible. Refs #157.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#161
No description provided.