Repository navigation
perf(gpu): opt-in switches to keep pools under commit pressure and move landed-list resets off the submit thread - #7
Open
mguttmann wants to merge 1 commit into
Conversation
…ve landed-list resets off the submit thread VICTORY_POOLS_STEADY=1: a critical commit sample shrinks the send/scratch/idle-list pools to their pressured floors instead of 0 (a real E_OUTOFMEMORY still empties them). VICTORY_SEND_MIN_KB: optional minimum send buffer size (default 8192 KiB as before). VICTORY_LAND_ASIDE=1: the submitting thread leaves landed-list resets to late_helper. VICTORY_CARD_SPLIT=1: diagnostic split of 'copies in the card's memory'; plus land/recycle lines. All default off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HuGTJNMrJLuUZxoXBD4Xjc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two opt-in changes (both off by default, no behaviour change unless switched on) for periodic CPU-side stalls seen on a 32 GB / 16 GB-VRAM machine, plus one diagnostic line. Measured on the user's PC with real logs; details below.
VICTORY_POOLS_STEADY=1ÔÇö a critical commit sample (residency::critical_commit, < 1536 MiB, sampled every 32 ms, no hysteresis) shrinks the send / scratch / idle-list pools to their existing pressured floors instead of to 0. A realE_OUTOFMEMORYstill empties everything as before.VICTORY_SEND_MIN_KB=<n>ÔÇö optional minimum size of a send buffer (unset = 8192 KiB as today).VICTORY_LAND_ASIDE=1ÔÇö with the relay and the helper running, the submitting thread no longer resets landed host lists itself;late_helperdoes it (falls back to the old behaviour from 96 waiting flights on).VICTORY_CARD_SPLIT=1ÔÇö diagnostic: onetracing::infoline splitting "copies in the card's memory" (send buffers made/freed, lock waits, commit left). Two further always-on lines report landed-list resets (land_line,list::recycle_line).Why
Hardware: Ryzen 7 9800X3D, RTX 5080 16 GB (driver 621.40), 32 GB RAM, Windows 11 26300, HAGS on, 2560x1440.
perf/nv-next@ bd91cb7, release,-C target-cpu=native. Settings: Series X 1440p, DLSS, Frame Gen on, BVH off,VICTORY_THINunset,VICTORY_ASYNC_SUBMIT=1.Without the switches, about every third second the submitting thread went from ~25 ms to 90ÔÇô114 ms per frame while the card sat idle behind it (card ~26 % busy). Same scene, spike second vs. normal second:
The pass counts are the same, so it is not more work but waiting. The log showed
host memory pressurewithavailable_commit_mib=3280shortly after start. Reading the code: when the commit sample turns critical the pools go to limit 0, so each of ~37 submissions per frame creates a fresh 8 MiB upload buffer underCARD_WORK/QUEUE_ORDER(the land thread then waits for that lock ÔÇö its excess matches), landed lists are destroyed and remade, memory is returned, the sample recovers, the pools refill, and it starts over.With
POOLS_STEADY=1+LAND_ASIDE=1(same PC, same small page file): "copies in the card's memory" 411 ms as per-minute averages and 32 ms in the worst second (before: 66 ms average over the spike seconds, 86 ms worst), "after the sending" 0.0 ms on the submitting thread (helper 0.8 ms).CARD_SPLITconfirmed the mechanism: in the worst seconds the commit left was 860 MB, "2901 of 2901" samples critical, and making/freeing ~55 MB of send buffers cost 23.5 / 17 ms per frame.Honest caveat: the largest overall improvement came afterwards from the user's page file (system-managed 5.6 GB  fixed 64 GB; commit limit 36.6  95 GB). After that the commit never went below ~48 GB in a 20-minute run and fps followed scene density only (34 fps at ~2,200 draws/frame, 2021 fps at ~8,500). The point of this PR is that, under commit pressure, the current code makes things worse by throwing all pools away; these switches keep it from doing that. It might be worth mentioning the page file in
docs/windows-memory.mdfor 32 GB machines.Related observation (no code change here)
The README recommends
VICTORY_TEXTURE_ROOM_PERCENT=80with Frame Gen. On this 16 GB card that set the texture line to 11,881 MB of a 14,851 MB budget (the defaultline_forwould give ~14,083 MB). After ~20 minutes the log showedthe texture queue's room: 12681 MB in use  against a line of 11881 MB: no room, new textures waitwith 9,703 textures waiting, and pedestrians visibly got wrong clothing/face textures. Maybe the 80 % advice should be limited to cards  12 GB.Testing
The analysis and patches were made with the help of Claude (Anthropic); measurements are from the user's own runs.
ƒñû Generated with Claude Code