Lists: idle host lists none took are let go after a while (VICTORY_LIST_IDLE_TRIM_S, off by default) #372
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/Belobug--VIctory-Belobug-AMD!372
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-372"
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?
@Esteban-V on GitHub · 2026-11-26 22:50 UTC · original
Esteban-V:perf/list-pool-trim→a-publier· +126 −11 · 1 files · 1 commits · openA D3D12 command allocator keeps its memory across
Reset, so every list in the idle pool (IDLE, up to 512,crates/victory-gpu/src/list.rs:242) keeps the most its commands ever took, for the rest of the run. The pool is never trimmed, and with the scratch pool on, its byte cap counts 0 after a reset. This adds a low-water trim, off by default.VICTORY_LIST_IDLE_TRIM_S=N: every N seconds (10 to try), the idle lists none took in that window are let go, oldest first, at most 32 per trim, always leaving 16 (trim_count).VICTORY_LIST_IDLE_MOST=N: pool size instead of 512 (16..=4096).land(),bury_lagand the reset order are untouched.To A/B:
VICTORY_LIST_IDLE_TRIM_S=10with the memory line (VICTORY_MEMORY_MAP), comparing the lists' share.Already merged in DoubleGhosty/cool_fox (d15a711). Related: #335 also trims this pool (under pressure) and retires allocators. Both touch the same code in
list.rs, so whichever lands second needs a rebase.Testing
windows-latest): Clippy, default tests and diagnostics tests pass (run).x86_64-pc-windows-msvcon a macOS host (cargo clippy --workspace --all-targets -- -D warnings, default features and--all-features).trim_count_keeps_the_floor_and_the_stepanda_trim_lets_go_what_none_tookadded.@MamaLeVrai on GitHub · 2026-11-27 00:22 UTC · original
Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at
f5307bf:cargo test --release -p victory-gpu --lib398 passed, 0 failed, 34 ignored in 3 runs. A fourth, earlier run had onewatch::tests::what_the_kernel_writes_through_is_not_guarded_for_another_viewfailure, which did not come back (that area is flaky on this card on the base too). Not run in the game withVICTORY_LIST_IDLE_TRIM_Sset.AI-assisted (Claude Code); no game data.
@a15106479638-hub on GitHub · 2026-11-27 08:18 UTC · original
Your diagnosis is the other half of what removes the device on RDNA2, and it has been measured from the other side.
On an RX 6950 XT (16 GB, driver 32.0.21045.29003) the removal is the video memory manager running out of room in a 2 GB aperture segment — and the lists in exactly this pool are most of what fills it, since a command allocator keeps its memory across
Resetjust as you say. From an ETW trace in kyokyotosh/VIctory-6700XT: 1 MB + 64 KB per list, ~830 lists climbing to 1,150–1,250 at the world load, thenReserveResource→0xC0000001and the kernel marks the device faulted. There is an independent measurement of the same figure in #329 (1.16 MiB per allocator + list pair, 1.0 MiB of it shared GPU memory, 64 KiB local).That tree landed an adaptive version of your trim rather than a timer: while an aperture segment is over 80% of its limit, idle host lists are cut to 64 (
trim_idle) and idle preludes to 16, and it counts as clear only below 70%. On my card the monitor showed segment 1 (aperture, 2,048 MB) crossing 80% at 1,638 MB six times in nine minutes, each time trimming back to 1,428 MB, with 0 device removals and 18.1 fps average against 2.8 fps withRELAY=0.So your
VICTORY_LIST_IDLE_TRIM_Sand that back-off are aimed at the same memory. Worth comparing: a timer trims on a schedule, the segment reading trims only when the memory is actually short. Either way, on RDNA2 the pool size is not a tuning detail — it is the difference between running and losing the card, which is why the default of 512 matters more than it looks.@Esteban-V on GitHub · 2026-11-27 14:34 UTC · original
Thanks, this is really useful. I hadn't seen the 6700XT findings, and the 1 MB + 64 KB per list lines up with #329 nicely.
Trimming when the aperture segment is actually short makes more sense than a timer if that's what runs out. I'm going to look at their
trim_idleand see whether it fits here or works better as a follow-up. One thing to watch from #335: when the pool got cut too hard, lists were being made again all the time (2.9k to 140k in a run) and fps roughly halved, so the floor and the clear threshold really matter.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.