gpu: reclaim draining texture blocks under memory pressure #501
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!501
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-501"
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?
@maple-quartz18 on GitHub · 2026-12-04 19:27 UTC · original
maple-quartz18:pr/texture-block-reclamation→main· +645 −106 · 2 files · 4 commits · draftProblem
Under sustained card-memory pressure, texture blocks selected for draining can remain occupied by active host copies, and a drained block that becomes empty can be kept as a spare instead of being returned. On shared-memory APUs, this can retain memory during world streaming.
Change
VICTORY_POOL_FORCE_RELEASE=0disables the behavior. The current patch enables it by default; feedback on making this opt-in is welcome.Dependency and validation
Draft, based on #393. This branch includes its three commits and is not intended to merge before that PR. It adapts the change from a local tree that also has other patches; this exact rebased tree has not yet been built or run in game.
On the local integrated tree, a Windows-target release build passed, and two focused Wine tests passed: pressure/pending policy and a drained block remaining held before its fence threshold and becoming reclaimable after it. No gameplay, memory-pressure, image-correctness, long-run stability, or FPS comparison has been done. Real workloads may retain references indefinitely or increase texture reuploads and stutter. The existing time-based fallback remains unchanged.
@YaBulochka on GitHub · 2026-12-04 19:39 UTC · original
A negative result from the page side that may be worth knowing before draining blocks.
On an 8 GiB card (RX 7600 XT, RADV, Series S + FSR) I measured what the page table holds: 156–166 k pages of 64 KiB in
um::lazy'sTABLE, of which only 19–21 k had a view at the title's address. The rest — 8.6 to 9.1 GB, and growing — isBOUNDwithoutREAL.I read that as the reclaim target and tried it:
unbind(page << 16, K64)for pages that areBOUND, notREAL, notKEPT, notwanted, and not shown for 40 s.0x80000003.So in this tree
BOUND && !REALis not unused memory: the card reads through the aliases, and a page staysBOUNDafter the title drops its own view, because recorded lists still name it. Neitherwanted()nor theSEENbit covered those pages reliably enough.If #501 drains whole texture blocks, the hazard is probably the same one step up: a block can hold pages that recorded lists still name. What would settle it either way is a counter of "blocks whose pieces are free but whose pages some list in flight still names", measured next to
no_room_passeson a small card.Numbers and the two crash runs are in a local probe set; I can paste the log lines if useful. The measurement line that came out of it is one line in
um::lazy::line():held but not mapped: N pages (M MB), K mapped at the title.@maple-quartz18 on GitHub · 2026-12-05 04:47 UTC · original
Can you use APU?
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.