victory-gpu: small device-local buffers placed together #110
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!110
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-110"
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?
@Bushyon on GitHub · 2026-12-01 20:38 UTC · original
Bushyon:small-buffers-placed-together→main· +290 −3 · 3 files · 1 commits · merged 2026-12-02 01:43 UTCWhat was wrong
Every buffer
Host::uav_buffermakes is a committed resource, and the AMD driver gives each one in local video memory 256 KiB of the card, however small it is. Indirect batch buffers (64 KiB), indirect budgets (256 bytes) and indirect arguments buffers are made by the thousands.What this changes
New
card_pool.rs: buffers of 256 KiB or less are placed in shared 4 MiBALLOW_ONLY_BUFFERSheaps at 64 KiB multiples.take_batch_buffer,make_card_budgetand the indirect arguments buffer ask the pool first and fall back touav_buffer. A slot is reused only once the pool's own reference is the last one (host::references).VICTORY_CARD_POOL=0turns it off.Measured
run.sh play,VICTORY_BVH_BUILDER=1, 330 s, pool off vs on: no panics or device removal, average FPS 28.7 vs 30.0 (noise). With the pool on: 2,986 small buffers in 81 heaps (324 MB, 98% used), against about 750 MB if committed at 256 KiB each (arithmetic, not an RMV trace).Not checked
SPARE_BATCH.AI-assisted.
@Frtuchinno on GitHub · 2026-12-01 20:52 UTC · original
Ran the pool's unit tests you couldn't run, on an RX 7800 XT (RDNA3), CachyOS,
proton-cachyos-slr, this PR merged on37bb30f:This only covers the unit tests, not the open point about owners holding a real reference while the GPU may still read a batch buffer.
Why the test exe printed nothing: it imports
d3d12.dll, and without the DLL overridesrun.shsets, Wine/Proton loads its builtind3d12→wined3d, which isn't there, so the process exits during import (statusc0000135, exit code 53) before the harness prints anything. With the same overrides asrun.shit runs:(Running the whole
victory-gpusuite in one go still dies part-way with exit status 5 on unmodifiedmainhere, so a filter is the way to check one module.build.shappends its own flags after its arguments, so a test filter can't go through it; hence running the exe directly.)