perf(gpu): opt-in LARP_HEAP_MB for smaller placed-buffer heaps on 8 GB cards #388
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/gamingwithhomie--larp!388
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-388"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@gaut33680-sudo on GitHub · 2026-12-06 00:03 UTC · original
gaut33680-sudo:heap-size-option→main· +183 −43 · 2 files · 2 commits · openWhat
Adds an opt-in environment variable,
LARP_HEAP_MB(32,64or128), for the size of the heaps of placed buffers incrate::heaps(upload, read-back, scratch, ray-tracing structure and geometry tiles).MOST(32 MiB), so every piece still fits.crate::texheap) are not touched.docs/environment-variables.md.Why
A heap goes back to the card only once every piece in it is free, so a few live pieces can keep whole 128 MiB heaps taken. On an 8 GB card whose memory is full, the F9 panel showed about 1.0 GB in "free in the heaps" while about 1.0 GB had spilled into shared (system) memory. Smaller heaps empty and go back sooner, at the cost of a few more
CreateHeapcalls.Testing
series-s, 1920x1080 output, FSR balanced, FSR frame generation 2x.LARP_HEAP_MB=64(alongside an unrelated local change), two sessions of about 10 minutes of driving: no errors or crashes; the log line confirmsmb=64.LARP_HEAP_MBunset vs64) would settle it, which is why it is opt-in.cargo check -p larp-gpu --target x86_64-pc-windows-msvcon currentmain.🤖 Generated with Claude Code
https://claude.ai/code/session_01QHHCB138ncHJF4i3kpiP16
@vanya890 on GitHub · 2026-12-06 01:19 UTC · original
The implementation consistently replaces the former fixed 128 MiB constant, including the empty-heap check and host-memory accounting, and keeping this opt-in is the right choice until a controlled A/B isolates the benefit. The main missing regression coverage is the boundary behavior: 32 MiB is exactly
MOST, while requests larger thanMOSTare committed instead of placed. Could you add a small pure test for the accepted values (32/64/128) and fallback for unset/invalid input, plus a check that a 32 MiB heap is considered empty after its final piece is returned? Current runtime evidence only covers 64 MiB.@gaut33680-sudo on GitHub · 2026-12-06 01:32 UTC · original
Thanks for the review! Added in
6f154f6:heap_size_of, the pure part ofheap_size: 32/64/128 accepted; unset or invalid values (empty, non-numeric,64MB, negative, 0, 16, 256) fall back to 128 MiB.piece_len: the placed/committed boundary (MOSTis placed,MOST + 1is committed).Free: the free-piece bookkeeping, moved out ofHeapunchanged so it can be tested without a device. One test checks that a 32 MiB heap filled by a singleMOSTpiece is empty once that piece is returned. Another checks that a 32 MiB heap split into several pieces is empty only after the last one is returned (joined on both sides).Checked with
cargo check --testsfor x86_64-pc-windows-msvc, and the pure parts pass undercargo test. Runtime evidence still only covers 64 MiB.@vanya890 on GitHub · 2026-12-06 01:36 UTC · original
Thanks, this closes the test gap from my review: the accepted/fallback values, the exact
MOSTplacement boundary, and both single-piece and multi-piece free-list coalescing are now covered without a D3D12 device. The remaining limitation is still that runtime A/B evidence only covers 64 MiB, so keeping the setting opt-in is the right scope for this PR. No further concern from my earlier review.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.