host: keep command allocators instead of remaking them for age (VICTORY_KEEP_HOST_BUFFERS) #332
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/lobomfz--VIctory-xmem!332
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-332"
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?
@t-jonesy on GitHub · 2026-12-03 15:42 UTC · original
t-jonesy:upstream/keep-host-buffers→main· +191 −6 · 3 files · 1 commits · merged 2026-12-03 16:30 UTCProblem
At its first reset after 60 s, every host list's and prelude's command allocator was made anew, and host lists idle for 60 s were let go. An allocator holds RADV's command memory: an 80 KiB command block and a 16 KiB upload block per command buffer, doubled as recordings grow, each its own buffer in the card's memory.
A remake freed them all, and the new allocator grew back block by block. A kernel trace of the game threads over 5 s showed ~110 maps and ~107 unmaps a second of exactly those sizes. Each unmap goes through
amdgpu_vm_clear_freed, whose page-table job waits for all queued work in the VM. The next submission then waits for that job and flushes the TLB.Changes
VICTORY_KEEP_HOST_BUFFERS=1(off by default): allocators are not remade for age, and idle lists are not let go for age, while the card's memory in use is under budget (checked every 100 ms). Past the budget, the old trimming applies. A list's command memory stays at the largest it recorded, which it grows back to within seconds of a remake anyway.docs/SETTINGS.mdlists the switch.Results
3 alternating pairs, normal priority:
A kernel trace (5 s) showed the game's host-buffer maps going from 110/s to 31/s, and VM-flushed gfx jobs from 123/s to 72/s.
All of these numbers come from one machine:
They were measured on a fork whose base is about 150 commits behind current
main; this branch is the same change rebased (only the README conflicted; the setting moved todocs/SETTINGS.md). Untested on other GPUs and on cards with less VRAM, where the budget check matters more. Not re-measured in game after the rebase.#306's reuse of send buffers works on a different kind of memory (upload buffers, not command allocators), so the two should combine. That combination is untested.
Testing
./build.sh(release) builds.host::keep_testspass. The full suite has 313 passed and 6 failed; the same 6 tests (indirect::tests::host_list_*andwatch::*) fail on unmodifiedmainin the same environment.🤖 Generated with Claude Code
https://claude.ai/code/session_01ETU6PfySRvsjk18uHFtWya