Skip to content

GPU: retry texture staging with smaller blocks after out-of-memory - #986

Closed
yumaste wants to merge 1 commit into
trustno1-coder:mainfrom
yumaste:nvidia/port-texture-staging
Closed

yumaste wants to merge 1 commit into
trustno1-coder:mainfrom
yumaste:nvidia/port-texture-staging

Conversation

@yumaste

@yumaste yumaste commented Nov 28, 2026

Copy link
Copy Markdown

Port of Marvisak/VIctory#3259 to this fork's texture staging pool. The pool already backs off after a refused block, but currently tries only a 64 MiB block. The texture's existing dedicated-buffer fallback can also be deferred after that out-of-memory result.

After E_OUTOFMEMORY, try smaller blocks down to the request rounded to 64 KiB, with bounded retries. Reuse a successful smaller growth size during the 500 ms backoff interval. Account for the actual block size when reusing, reclaiming and reporting staging memory. Keep the existing speculative admission policy. Related to #816, which moves block creation outside the pool lock.

Windows validation: all 11 pool tests passed with cargo test -p victory-gpu --locked --lib pool::tests. The new tests simulate allocation refusals, verify reuse and reclamation, and cover recovery to the normal block size.

fylcr pushed a commit to fylcr/VIctory-NVIDIA-for-low-end that referenced this pull request Nov 28, 2026
…1-coder#923 trustno1-coder#890 trustno1-coder#1008 trustno1-coder#1005 trustno1-coder#801, and trustno1-coder#953 by hand

Merged from trustno1-coder/VIctory-NVIDIA, all aimed at the 8 GB card / 32 GB
RAM class of machine this fork targets:

  trustno1-coder#784  empty texture blocks kept in proportion to the card's budget
        (VICTORY_SPARE_SCALE=1)
  trustno1-coder#986  texture staging retried in smaller blocks after out-of-memory
  trustno1-coder#923  lists' upload buffers kept and used again, not made for each copy
  trustno1-coder#890  VICTORY_CARD_BUFFERS_MIN_KB, an 8 GB card's floor
  trustno1-coder#1008 fault-page bound raised to 16,384, <4 GiB strays skipped
  trustno1-coder#1005 >65,535-group indirect dispatches enabled on NVIDIA
  trustno1-coder#801  stall-free per-draw zero-alloc and COM fast paths

trustno1-coder#953 (an upload buffer refused for want of memory is asked again once the
spare scratch chunks are freed) conflicted with the tree's own try_upload_buffer
split; ported by hand with the same semantics and the same log line.

Not taken: trustno1-coder#991, trustno1-coder#1014, trustno1-coder#722 - they conflict in pool.rs / draw.rs /
memory.rs, which trustno1-coder#784, trustno1-coder#801 and trustno1-coder#1008 already changed here.
@trustno1-coder

Copy link
Copy Markdown
Owner

Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants