GPU: small first scratch chunk per list; log host memory against budget #1666
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1666
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1666"
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?
@cyudev on GitHub · 2026-11-24 20:35 UTC · original
cyudev:gpu/scratch-first-chunk→main· +150 −13 · 1 files · 2 commits · openGPU: small first scratch chunk per list; log host memory against budget
HostList::scratchhands out upload memory in 4 MiB chunks, and a list keeps every chunk across resets. In the world the title records with hundreds of host lists, most of which need a few KiB per recording. So each list that ever touched scratch pinned a full 4 MiB upload buffer.On an RTX 3060 Ti (8 GB) with 16 GB RAM, running r4tedx's
integration/testersupdate 10, this went as follows:E_OUTOFMEMORY(no upload buffer … size=4194304, confirmed with the debug layer).DXGI_ERROR_DEVICE_REMOVED), or the title's own crash handler fired withmemory.load_percent: 97.This happened a few minutes into the world. Report on #71: #71
Change
A list's first chunk is now 256 KiB. A request that does not fit gets 4 MiB chunks after it, as before. Requests over 4 MiB still get their own buffer, freed at reset.
On reset, a list keeps only its first chunk.
Every 5 s, next to the frame-rate line:
The figures come from
IDXGIAdapter3::QueryVideoMemoryInfo, so testers can see memory pressure without the debug layer.Measured
Same machine and tree,
VICTORY_SHADER_LOOP_LIMIT=32, one run each:A first attempt that only trimmed chunks past the first on reset changed nothing. No list ever held more than one chunk; the cost was the size of that one chunk.
Not fixed here
The run after the change still ended with a device removal. System memory the GPU uses kept climbing to ~5.6 GB of a 7.4 GB budget from other sources. Video memory sat above budget (~9.2 GB of 7.2 GB) from world entry on. Those are separate problems.
Testing
cargo clippy -p victory-gpu --all-targets --all-features -- -D warnings: clean.cargo test -p victory-gpu: 52 passed on the RTX 3060 Ti, 55 with--features diagnosticson WARP. Two new tests cover the scratch scheme: a small first chunk; requests packed and 256-byte aligned; growth by 4 MiB chunks without overlap; a request over the small chunk taking a big first chunk; a request over 4 MiB getting its own buffer; a reset keeping and reusing only the first chunk.integration/testerswith this change applied; this PR is the same change onmain.🤖 Generated with Claude Code
@Marvisak on GitHub · 2026-11-25 01:34 UTC · original
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-gpu/src/host.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
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.