One owner for the whole card budget, for any card near its memory limit (measured on 8 GB; a plan in small steps) #4463
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA#4463
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Jesper-Andersson on GitHub · 2026-11-30 20:36 UTC · original
What changed in v12
The maintainer's texture and video-memory rework is on main (merge
415f3d854; main atb97efa767when this was written). This version re-reads the plan against it.What you would like
One owner for the whole card budget, so a card near its memory budget has one figure for "in use" and one line to keep under. We measured on 8 GB cards. 12 GB cards report memory pressure too (#3200, Series X profile: 10.9 of 12 GB in use with heavy stutter, with DLSS frame generation on; #3197: a crash report titled "exceeding 12GB VRAM", no figures given). Ray tracing, frame generation and higher resolutions may reach the budget sooner on any card (not measured).
I'm proposing to build it in small steps, each behind its own switch and each its own PR. The aim of this issue is to coordinate, so memory PRs point the same way. Where main or an open PR already does a step, the step is to test that, not to write our own. I update this post as measurements come in.
What the rework fixed on our 8 GB card. Upstream's test build v2026.12.01.01-test,
victory play, one 28-minute session (our post on #4987), against one 31-minute session of the old main's memory defaults on our fork's build. Not like for like: a different exe, and the test build started with an empty pipeline cache.VICTORY_TEX_PARK=1) instead of being held behind a gray stand-in. At the end 1,290 MB of textures were parked.Why one owner is still needed (our reading of main). There is still no single owner.
Host::video_memoryasks DXGI twice (local and shared) on every call, with no cache. It has 45 call sites in 22 files.cardledger.rsnow counts every card allocation by kind, frees included. Its header says "It only counts and logs; nothing is decided from it", and it is off by default (VICTORY_CARD_LEDGER=1).Two launch paths on cards with a budget of 8 GiB or less. They no longer behave alike:
victory play(the menu launcher): the park is on, tiled levels are off (LEVELS_ON_DEMAND=0). A texture with no room is parked whole.scripts/play-nvidia.ps1(the script launcher):LEVELS_ON_DEMAND=autoturns tiled levels on at this budget. That switches off the park,SMALL_WHEN_FULLandTEXTURE_QUALITYfor those textures. A refused texture is held about 4 s behind a gray stand-in and asked again, as before the rework. #4005's 512 MB cap still refuses there, and its log line still calls it "refused by an explicit byte limit".Every result below says which path it used.
Earlier numbers (old main, our settings). Our 28-minute table in v11 was taken with our launcher's memory settings, not main's (
POOL_SMALL=0,SLOT_EVICT=0,TEXTURE_KEEP_FREE_MB=0,ROOM_BY_BLOCKS=1,CARD_ROOM_FOR_TARGETS_MB=1280). On the old main's defaults the card went over its budget at about 3 minutes, in 10 % of readings, by at most 314 MB (comment). @CuteBooty's RTX 3070 8 GB stayed under its budget, but the margin fell from 869 MB to 22 MB over a 28-minute mission (comment). Neither is on the new main.What others do (re-checked 2026-12-01; links in our comment of that date). One count of what is held, with one line below the OS budget: Dawn caps at 95 % of the budget, Unreal's DX12 back end takes 90 % (forum quotes of its source). D3D12MA and VMA estimate use between DXGI readings from what they made and freed, and read again about once a frame (D3D12MA also after 30 allocations or frees). Empty heaps are freed with one spare kept (D3D12MA, DXVK). Over budget, Unreal lowers texture detail one level at a time, least recently seen first, and DXVK falls back to system memory. The rework's park is the DXVK answer, and its
DEMOTEis the Unreal one.Proposed steps (revised for v12). A ticked item exists on main and was checked in the code; each item says where.
cardledger.rson main: per-kind card bytes, frees counted (VICTORY_CARD_LEDGER=1, off). This was #2910's ledger. Step 1 would make it the owner's ledger.DEMOTEor slot eviction. It gives them one figure and one line.video_memory. It folds in @andrewpozdnakov7-jpg's race fix and his follow-up 820c696f, with his authorship. Off by default.b97efa767; it was a fixed 9,600 MB, maintainer's post). T should be that same figure, not a second one. Our earlier T (B − max(512 MiB, B/16), about 93 % on 8 GB) gives way to it.SAMPLED_EVICT=pressure) let go 677 more textures, but only 49 MB, and card use stayed at 5,840-5,873 MB. No idle render-target copy was free to go: about 100 were idle (280-400 MB), all held by a list or a slot. Textures stayed refused (118,000-187,000 refused asks per line at first, 9,000-94,000 in the last three lines), and the white stand-ins stayed. So one line and a same-sum drain are needed but not enough: the owner also needs a drain that moves whole textures, including ones shaders pick by index, without the use marks.TEX_PARK=2(moves the least-used card copies to PC memory, emptiest block first, and back when there is room) andDEMOTE(two levels fewer for long-unused textures).TEX_PARK=2works without the texture-use marks.DEMOTEworks without them too, but then keeps textures shaders pick by index. The marks cost about 10 ms a frame on an RTX 3090 at 1440p (62.8 against 52.1 ms, play.rs), sovictory playhas them off. Not #4581 as it was: it needs the marks.targets_room_kept, up to 2.5 GiB on a budget of 8 GiB or less). Unchanged by the rework.retire_resource, which keeps a COM reference until running lists finish, and the same call then demandsreferences(&host.texture) == 1(resource.rs:5027; descriptor/host.rs:5248). That is bug 1 of #4737. Two of #4737's other fixes are partly on main.ALIAS_TARGETS=2, about 0.8 GB) were on in the test build and are off again on main after testers saw streaks and halos (c7f736c06, maintainer's post). This class has no other lever on main.COMPACT_SPARSE, merge8dd9dad2a). It acts only when DXGI use is over the budget or PC commit is short, and our 8 GB run with the park never went over the budget, so that trigger never fired.COMPACT_WHOLE) is not on main.TEX_PARK=2already picks the emptiest block first.SAMPLED_MARKS=1, whichvictory playnow sets to 0, so as written it would do nothing there.victory playby the park (a whole copy in PC memory, never small, never gray). Still open on the script launcher's tiled path on 8 GB, where a refused texture shows gray for about 4 s.VICTORY_DEMOTE=1exists and is off; test it before building anything.TEXTURE_QUALITYis not this step: it cuts levels from large textures for the whole run, whether used or not, and does nothing under tiled levels.Our 8 GB port (warpGTAIV/VIctory-8GB's policy, ported on our fork). Mostly not on main: 64 MiB texture blocks only (no 16 MiB), no 1 GiB card windows below an 8,192 MiB budget, no budget/3 texture line, no buffers-first rule. Its textures-outside-blocks mode works against the park, which only places pool textures. Its loading-crash fix is superseded by upstream's stricter one (console_insn.rs). If any of it goes upstream, it goes as fresh single PRs on main.
Related work. These steps build on what is merged (#4005, slot eviction, #2361, #1491, the park), not replace it.
cardledger.rs), #4340 (idle sweep and the dynamic reserve), #1968 and #1562 (block size), #4603 (keep the shown texture;KEEP_SHOWN=2is on invictory play), #4713 (early-Z with sampled marks).b0335dff8), #3754 (free space counted as room,ROOM_BY_BLOCKS; step 1d's figure settles it), #3828 (pool bounds), #4205 (the PC-memory line). What each still means for this plan is in our comment.Spec dependence
Are you working on a fix?
Yes. Next on our side, on main and our 8 GB card, each run naming its launch path (
victory playandscripts/play-nvidia.ps1):If someone is already on one of the steps, please say so here so we don't duplicate it. Runs on other 8 GB cards are very welcome.
Drafted with AI assistance (Claude Code).
@github-actions[bot] on GitHub · 2026-11-30 20:36 UTC · original
Please attach both logs from the run that went wrong. Without them we can only guess. Paste
%LOCALAPPDATA%into the address bar of File Explorer to get there.%LOCALAPPDATA%\victory\logs\: the newestvictory-nvidia-play-<date>-<time>-<number>.log(fromvictory.exe) orvictory-nvidia-<date>-<time>.log(from the script launcher). The window shows its path at the start, on the lineLog: ....%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newestvictory-<date>-<time>-<number>.crash.login%LOCALAPPDATA%\VIctory\data\7952987A\temp\.Also say which GPU, Windows version (10 or 11)
@Remorce on GitHub · 2026-11-30 21:13 UTC · original
Added the block detail to #2910's line: #2910
@Jesper-Andersson on GitHub · 2026-11-30 21:18 UTC · original
Thanks @Remorce, that covers what I offered. The steps here will read from #2910's
card memory by owner:line instead of a second counter. Our own counter stays on our fork as a local diagnostic.For the bot: this is an enhancement, not a crash, so there is no crash log. Below are the play-log lines behind the table in the first post, from the same session:
card ledgerlines the table rows come from, each with the block histogram just before it;Removed: colour codes, file paths and a few header tokens, our counter's broken bury-delay gauge, and the small-levels line after 260 characters. The ledger lines come from our fork's counter (
VICTORY_CARD_LEDGER), not from main.Setup as in the first post: RTX 2070 SUPER 8 GB, driver 621.40, Windows 11, Series S, DLSS Performance, FSR 3 frame generation x2.
Play log excerpt (13 lines)
Drafted with AI assistance (Claude Code).
@eipastel on GitHub · 2026-11-30 21:31 UTC · original
Another 8 GB data point, in case it helps the plan: RTX 5060 8 GB (Blackwell), Ryzen 5 7600X, 32 GB RAM, Windows 11,
mainatc71899d9(30/11), release, Series S, DLSS Performance, no frame generation. Prison scene from the same save, about 60 s in the world, one run per row.VICTORY_VRAM_BUDGET_MB=5500VICTORY_VRAM_BUDGET_MB=5000+VICTORY_TEXTURE_ROOM_PERCENT=75VICTORY_TEXTURE_BUDGET_MB=2000Single runs per setting, so treat the fps as indicative; the over/under split was the same in every run.
@Remorce on GitHub · 2026-11-30 21:38 UTC · original
@Jesper-Andersson I expanded the ledger a bit more, initially I was just going off your bullet point note and didn't pull in everything. I went and folded most of it in now, per your recommendation.
@CuteBooty on GitHub · 2026-11-30 23:09 UTC · original · edited 2026-11-30 23:15 UTC
@Jesper-Andersson a second 8 GB data set for the plan, from the cases your post lists as untested: Ampere instead of Turing, DLSS frame generation instead of FSR 3, and a session past 30 minutes. RTX 3070 8 GB, Ryzen 7 5800X3D, 32 GB RAM, Windows 11, Series S, 1080p, DLSS Performance. Upstream's play settings plus
VICTORY_SAMPLED_EVICT=1. Normal play, not repeatable. The counts come from the existing log lines (memory in blocks,free in texture blocks, the host-copy census from #3420). There is no per-class ledger like yours, so there are no buffer-copy figures.v2026.11.29.05, frame generation off, 65 minutes:
v2026.11.30.01, frame generation on (x2),
VICTORY_RESIDENCY_PRIORITY=1, 28 minutes:When the steps arrive as PRs with their switches, I can run each one on this card with frame generation on, in sessions past 30 minutes, and post the same table here.
Edit: this end note isn’t from my Claude, it’s directly from me. I’m excited about this plan, and in conjunction with the CPU work, should make this very playable on mid tier hardware. Let me know what I can do to help without getting in your way
@Jesper-Andersson on GitHub · 2026-12-01 01:24 UTC · original · edited 2026-12-01 01:33 UTC
I've revised the step list in the post above after two more long sessions and a second round of reading. Same card and settings as in the post: RTX 2070 SUPER 8 GB, Series S, DLSS Performance, FSR 3 frame generation, our fork's build on upstream v2026.11.30.02 with opt-in ports. Thanks @CuteBooty, @eipastel and @Remorce for the data and the ledger work.
What changed in the steps
Evict(), contents kept by the OS), and depth/MSAA/shared copies (left alone).Why: two sessions (single sessions, not repeated; GPU clocks at default in the first, not recorded in the second)
Compaction with #4582 ported (35 minutes, no texture cap):
VICTORY_TEXTURE_BUDGET_MB=2500(52 minutes):@CuteBooty's two tables fit the same picture: with frame generation on, render-target copies are the class that grows (step 2). In the 65-minute session without it, the texture blocks grow with 1.1–2.9 GB free inside them (steps 3 and 4).
Next on our side
Drafted with AI assistance (Claude Code).
@Jesper-Andersson on GitHub · 2026-12-01 01:36 UTC · original
@CuteBooty thank you, that means a lot. Your two tables already shaped the plan: they showed that with frame generation the render-target copies are what grows, which is why step 2 is the first thing we'll test on our fork.
You're not in the way at all. Two things would help most:
TEXTURES_LET_GO). In our 35-minute run no block was freed; our port is older and lacks that counter, and the new counter should show whether compaction ever hands one back. Compaction acts when the card is over its budget or the PC is short of commit; your 65-minute run was over budget from minute 11 with 1.3–2.9 GB free inside blocks, so it's a good case. The compaction log line plus the same table would be ideal.Drafted with AI assistance (Claude Code).
@Jesper-Andersson on GitHub · 2026-12-01 01:54 UTC · original
A correction to step 2 in the issue body (now edited to match): its first case was already on main. #2361 (@nidea1, merged 2026-11-30) lets go of render-target copies that a newer target at the same address has taken over, unmapped ones, and dead ones held only by stale slots that have been idle for 10 s, aren't in a draw table and aren't marked sampled. I missed it when I revised the steps.
Our builds are on upstream v2026.11.30.02, which includes #2361, and in both sessions from my last comment the owner line "render targets and written textures" still grew, from about 1.3 GB at ~5 minutes to about 1.5–1.6 GB by ~35 minutes (the longer session peaked at 1.65 GB at ~42 minutes). So #2361 did not stop the growth here; what the growth is, that line can't say. @CuteBooty's numbers in #3420 point the same way: copies taken over by a newer target were 3–6 % of the bytes, and no copy idle for 30 s was held by nothing. Their reading, not yet tested, is that most are copies the title still touches or keeps in a slot.
So step 2 is now:
Evict()while over the target and made resident again before their next use. Built on our fork behind a default-off switch (VICTORY_TARGET_COPIES=count|evict, 5 s idle), not yet run in game. Itscountline splits the copies by what holds them, so the first session shows whether this class is empty here too.Drafted with AI assistance (Claude Code).
@CuteBooty on GitHub · 2026-12-01 01:59 UTC · original
@Jesper-Andersson thanks. One more session from tonight, in the same format, for step 2: 42 minutes of free roam (police chases through the city, open water, dense foliage, a lot of fast driving). RTX 3070 8 GB, v2026.11.30.01, Series S, DLSS Performance, DLSS frame generation x2, upstream's play settings plus
VICTORY_SAMPLED_EVICT=1, shader cache already built.VICTORY_TARGET_COPIES=evicttargets looks empty. The growth is in copies a slot or list still holds.About the #4582 session: on this PC its trigger would not fire on its own. To still see whether compaction ever hands a block back, I could run it with
VICTORY_COMPACT_COMMIT_FLOOR_MBset above the commit left, so it looks every 5 s while 512 MiB or more is free inside the blocks. That tests the mechanism, not the trigger. I'm building it now on top of .01 and will post the same table, with the compaction lines, after a 30+ minute session. Tell me if forcing it would mislead.@Jesper-Andersson on GitHub · 2026-12-01 02:05 UTC · original
@CuteBooty thanks for the table. Forcing the floor is fine for what you want to see, as long as the post says it was forced (floor set above the commit left), so readers take it as a test of whether a block ever comes back, not of when #4582 would trigger. With the floor forced and your card under budget, #4582 uses its 35 % line (blocks under 35 % full); its 50 % line is only for while the card is over its budget.
Drafted with AI assistance (Claude Code).
@Remorce on GitHub · 2026-12-01 02:15 UTC · original
Two PRs that bear on steps 1, 4 and 5:
VICTORY_TEXTURE_COMMIT_FLOOR_MB, which lowers the texture line while the PC's commit left is under the floor. Forced on a 4070 Ti, it held the card about 1.1 GB lower and private about 0.9 GB lower. It overlaps your steps 1 and 5 (one target, back-pressure), so worth lining up with.@Jesper-Andersson on GitHub · 2026-12-01 02:33 UTC · original
Results from a per-block census on our fork, for steps 3 and 4. One 24-minute session: RTX 2070 SUPER 8 GB, Series S, DLSS Performance, FSR 3 frame generation (FSR's, not DLSS's), GPU clocks not recorded, our fork's diag build with #4582 ported (its compaction lines are in the log). Every ~5 s it sorts what lives in each texture block by what holds it.
What it means for the plan (one session, one card): here the blocks are kept alive by textures a slot still holds. Evicting by block (step 3) can't empty a block on its own, and step 4's first stage (let a block go only when all its residents can go) would find no block either. The work moves to the slot-held textures: releasing them (#4581's
SAMPLED_EVICT=pressureaims at the index-picked part of this: textures in slots shaders pick by index that no shader has read for 1,800 frames, while the card is at 95 % of its budget or more; measured by its author on a 12 GB card, not yet tested here; the census doesn't say how much of the 2.1 GB that part is) or moving them (step 4's live moves). That fits @CuteBooty's render-target finding. Next on our side: #4581 on this card.@Remorce thanks. #4289's commit floor fits as one input to step 1's single target, and with card memory counted in private bytes, step 4 would give back commit as well. #4698 (RTX 5060 Laptop 8 GB, out-of-memory crash at 6.9–7.1 GB used of a ~6.7 GB budget) is another 8 GB case for this issue.
The census takes 38 ms per pass (median), so it stays a diagnostic on our fork.
Drafted with AI assistance (Claude Code).
memory NVIDIA: one owner for the whole card budget on 8 GB cards (measurements and a plan in small steps)to One owner for the whole card budget on 8 GB cards (measurements and a plan in small steps)@CuteBooty on GitHub · 2026-12-01 02:50 UTC · original
@Jesper-Andersson @mcozcan the #4582 session, as promised. Both commits (including the counter,
09eecc874) cherry-picked onto v2026.11.30.01. RTX 3070 8 GB, Series S, DLSS Performance, DLSS frame generation x2, upstream's play settings plusVICTORY_SAMPLED_EVICT=1,VICTORY_POOL_STATS=1, andVICTORY_COMPACT_COMMIT_FLOOR_MB=99999so it looked every 5 s (the card stays under budget here, so it would not trigger by itself). 34 minutes of free roam, mostly fast driving in the city. Closed normally, no driver events.POOL_STATSshowed blocks under a quarter full all session: 17 at minute 7, 14 at 14, 6 at 21, 10 at 29. So the sparse blocks are there, but what is in them is not idle or not unheld. That is the per-block "what holds it" question from step 0.So on this card compaction gives back a few blocks early on, then nothing. The sparse blocks that stay are held.
@Jesper-Andersson on GitHub · 2026-12-01 02:54 UTC · original · edited 2026-12-01 02:55 UTC
A correction to my census comment above, a comparison with @CuteBooty's run, and what a second round of reading changed in the steps (post edited).
Correction. In our census session slot eviction was off (
VICTORY_SLOT_EVICT=0in our launcher, off since 11-30 because of its pass cost) andVICTORY_SAMPLED_EVICTwas not set. So nothing could release a texture a slot held. The 2.1 GB is what slots held, not what could not go. The census also didn't separate slots a draw table reads from slots shaders pick by index, or recently read from cold.@CuteBooty's run had both on (
SLOT_EVICT=1from upstream's play settings, plusSAMPLED_EVICT=1): 12 blocks came back in the first ~12 minutes (their counter includes blocks the sweep emptied, so 12 is an upper bound), then none for 22 minutes, while between 6 and 17 blocks under a quarter full stayed all session. That fits sparse blocks held by slots that are still read, but it doesn't say how much is cold. Next on our side: the same census with the slot class split by kind and by last read (sampled marks on, release still off, to size it first), on this card.What changed in the steps (sources: Microsoft's residency and descriptor docs, the Titanfall 2, Horizon Zero Dawn and AMD/Avalanche memory talks, DXVK's relocation code, Xenia and Ryujinx):
Evict()is documented only as allowing page-out, so its effect on DXGI's count is to be measured before anything counts on it.Drafted with AI assistance (Claude Code).
@guyansong24 on GitHub · 2026-12-01 03:00 UTC · original
One more 8 GB data point: Ampere laptop, two builds, frame generation off
RTX 4060 Laptop 8 GB (8188 MiB), Ryzen 9 7845HX, 32 GB RAM, Windows 11 22631, driver 621.40.
Series S, DLSS Performance, frame generation off, shaders and pipelines preloaded with
play --preloadbefore each session (made=0 loaded=3886during play, so nothing was being madewhile it ran). Driving the downtown streets, not a fixed route.
Same card, two builds:
The v2026.11.29.05 session, minute by minute:
Total use climbs 71-119 MB/min and texture copies alone 141-260 MB/min. Monotonic in all three
sessions, nothing brings it back down, and the budget does not move. v2026.11.29.05 is about a
40% slower drift than v2026.11.29.01 and lasts 40 minutes instead of 16-28, but the shape is the
same and it ends the same way.
Eviction on the same v2026.11.29.05 run
20143 of those 23301 were marked by no shader within the idle time - the case
crates/victory-gpu/src/descriptor.rs:1979saysVICTORY_SAMPLED_EVICT=1lets go - and they wereheld anyway, because it defaults to 0. 1711 MB, against a 2666 MB overshoot at the end of that
run. That is the one number I would most like to see move in step 2 or 3.
The stop, identical on both builds
Always after the card has been 400-2600 MB over its budget. With frame generation 2x on
v2026.11.29.01 the same streets ended in
host GPU device removed ... (0x887A0006)instead, whichis the
0x887a0006 (hung)case indocs/dlss.mditem 11. Twice the whole machine locked up withno TDR, no minidump and no WHEA event, and the play log simply stops mid-line.
Two questions
VICTORY_TEXTURE_BUDGET_MBfrom @eipastel's table: is that main only, or in a release?It is not in v2026.11.30.03 - I looked through that build's source and only
VICTORY_TEXTURE_ROOM_PERCENTis there (default 80 with frame generation on, 86 with it off).The log reports the line as
90.0 % of a budget of 7089 MB, and use went to 137% of the budget,so on this card that line is not holding anything back. If the MB cap is what actually works,
I would rather run the build that has it than guess at a percentage.
VICTORY_SAMPLED_EVICT=1: @CuteBooty's two runs (65 and 42 minutes, fast driving) show nodeadlock, while
descriptor/host.rs:4302still records that it deadlocked an RTX 5070 Ti twicethree minutes into a drive on 2026-11-28 - although the code now takes
try_lockinstead ofwaiting, which is the step that removed the mutual wait. If that is considered settled, I will
run with it on and add the eviction counters here; if not, say so and I will leave it alone.
Play logs for all three sessions are available if you want them (the 40-minute one is 30.5 MB
uncompressed; it zips to 3.5 MB), with
memory now:,texture queue's room:andtextures let go with their slotsat about one line a second.@Jesper-Andersson on GitHub · 2026-12-01 03:06 UTC · original
@guyansong24 thanks, that's the number we were after. 20,143 of 23,301 index-picked textures unmarked within the idle time (1,711 MB) is the cold part our census couldn't separate yet. Our next session on the 2070 SUPER splits the same slot class by kind and by last read, so we can compare.
VICTORY_TEXTURE_BUDGET_MBis in the v2026.11.30.03 tag:texture_budget_limit()incrates/victory-gpu/src/resource.rs, around line 2441. A caution from our 52-minute run with it at 2500 on our RTX 2070 SUPER 8 GB (Series S + DLSS Performance, in this earlier comment): the cap is compared with all host textures already on the card, so once those passed it, first uploads were refused. We saw white and black textures (refused uploads are the likely cause, not proven), and use was still 1.5 GB over the budget at the end. In our one long run it refused first uploads and did not bring use down.VICTORY_SAMPLED_EVICT=1: I can't say whether the 2026-11-28 deadlock is settled; that's for the author of thetry_lockchange. We haven't tested=1on 8 GB. #4581 (open, not in a release yet, so it needs a build that includes it) addsVICTORY_SAMPLED_EVICT=pressure: it lets the same class of textures go only while the card is at 95 % of its budget or more and only after 1,800 frames unread, so it takes a colder subset of your 1,711 MB. Its author measured it on a 12 GB card, so what it frees on 8 GB isn't known yet.Your logs and the overshoot-before-stop pattern are useful here too. Please also add them to #4693 or #3911, which track the
0x80070057stop itself.Drafted with AI assistance (Claude Code).
@nidea1 on GitHub · 2026-12-01 03:14 UTC · original
@Jesper-Andersson Thanks for tracking #2361 accurately under Step 2 — confirmed that #2361 only targets superseded, unmapped, and stale-slot-only dead RT copies, leaving live-slot copies as an open Step 2 design area.
To help coordinate across 8 GB work and avoid duplicate PRs, here are our active
MERGEABLEmemory/rendering PRs:HOST_WRITTEN_ATand clear host-written ranges on remapSLOT_SAMPLED-only pixel shaders and batch wave-uniform sampled marks (lowersVICTORY_SAMPLED_MARKS=1GPU cost without disabling eviction tracking)aheadonto the DIRECT aliasing barrier and fence-gatePool::reclaim()rest (VICTORY_POOL_SMALLremains opt-in)cache/cpu-mirrors/*.tmp*files on startupEXACT_MANYinExactStore::trim()under host memory pressure@guyansong24 On your
VICTORY_SAMPLED_EVICT=1question (comment #16), here is an 8 GB Ampere data point from our RTX 3060 Ti 8 GB (ReBAR off, driver 621.40) / 32 GB RAM system (Series S, DLSS Quality, FSR 3 FG):720.7 sin-world,16,447frames) uncontested live soak on7d93ee0759withVICTORY_SAMPLED_EVICT=1+VICTORY_WINDOW_GROW=1+#4432/#4463/#4712..#4715(VICTORY_POOL_SMALL=0,VICTORY_RIPE_BLOCKS=12): 0 deadlocks, 0 crashes, 0 Victory errors,HERO LEAD = 0,UPLOAD OVER HOST WRITE = 0.VICTORY_SAMPLED_EVICT=1counters:36,543nulled,3,912requeued (10.71%),32,631null at end; 0<2 seviction remakes after minute 3 and 0>100 mshitches across the final8.7minutes.6,035 / 6,862 MB(-827 MB below budget), Shared GPU RAM5,837 MB(-2.1 GB vs baseline), PrivateBytes21,683 MB(-2.7 GB vs baseline).(Note this was a 12-minute soak on our combined stack rather than extended fast driving, so it adds an 8 GB stability data point alongside @CuteBooty's runs rather than proving every driving path.)
@Jesper-Andersson on GitHub · 2026-12-01 03:37 UTC · original
Results from tonight's session, for steps 0 to 4 (post edited to match). One ~28-minute session, not repeated: RTX 2070 SUPER 8 GB, Series S, DLSS Performance, FSR 3 frame generation, our fork's diag build (census with the new slot split, #4581 by @mcozcan ported, step 1's shared reading, step 2's copy count).
SLOT_EVICTwas off, so nothing released slot-held textures: the cold figures below are what could go, not what went.Slot-held textures
* if every idle unheld texture and every cold index-picked texture went at once.
So about half the slot bytes are cold, but they share blocks with hot ones. Releasing all of them would empty about one 64 MiB block.
Menus. In a few periods 40–53 blocks (2.5–3.4 GB) would have emptied, because hot bytes fell to 33–59 MB. These were times in menus (confirmed by the player): no shader reads, so everything looks cold. Releasing then would make it all again on resume, so a release rule has to ignore periods with no draws. These lines are in the medians above. Leaving out the 10 lines with menu time, the 60 s median is 0 blocks and no line reaches 4.
Step 2. At the end: 897 render-target copies, 1,628 MB. In use 590 MB, idle but held by a command list or a slot 555 MB, idle and held by nothing 0 MB, kept whole (depth, MSAA, twins, aliased, tiled) 482 MB. As on @CuteBooty's 3070, the class
Evict()was for is empty here, so that part is parked. The open part is the 555 MB a list or slot holds.Step 1. The shared reading followed DXGI (worst error in any period 337 MB), but it isn't one reading per frame yet: the budget-change event fired 157,490 times in the session. Each wake-up forced a new reading. A fix (at most one extra reading per frame, 250 ms apart) is built on our fork with unit tests passing (75); it has not run in the game yet. It goes into the next session, before any PR.
What it changes in the plan. On this card, release alone frees little, because cold and hot textures are mixed in the same blocks. Steps 3 and 4 now add temperature-aware placement (recently read textures in their own blocks, so cold ones collect in blocks that can empty) before any live moves, and a release rule that ignores no-draw periods.
@nidea1 thanks for the list, it saves duplicate work. Our next test build will carry three of them:
#4713 we'll test as its own arm. With early-Z back, a texture read only by pixels that end up hidden is no longer marked. That's right for what's on screen, but it raises our cold count, and a release could then let go a texture that becomes visible on the next camera turn (gray until the next read). So we'll compare the census split with and without it, with screenshots. #4715 and #4716 aren't in this build: #4715 is outside card memory, and #4716 (RAM) we'll look at with the RAM side of this issue.
Your stack ran 827 MB under its budget with
SAMPLED_EVICT=1. That's a different card and stack (3060 Ti, DLSS Quality, 12 minutes), and we haven't run release on ours yet. Our census only says that here the cold bytes sit in the same blocks as hot ones, so release alone would empty few blocks on this card. An A/B on our card with release on is next.Spec dependence. All numbers are from one card (RTX 2070 SUPER 8 GB, driver 621.40, ReBAR off, Ryzen 7 5800X, 32 GB RAM, Windows 11) with Series S, DLSS Performance and FSR 3 frame generation, on our fork's diag build with several ports. Likely general: the slot split by kind, step 1's event flood, and the empty
Evict()class (also seen on a 3070). May depend on our setup: how cold bytes mix within blocks, and the budget and over-budget sizes. Untested: other GPU generations, AMD, 12–16 GB cards, Series X, ray tracing.Drafted with AI assistance (Claude Code).
@Jesper-Andersson on GitHub · 2026-12-01 04:24 UTC · original
Results from a second session, for step 1 and for placement in steps 3 and 4. One ~25-minute session in the world, not repeated, closed normally. Same PC and settings as the last one: RTX 2070 SUPER 8 GB, driver 621.40, ReBAR off, Ryzen 7 5800X, 32 GB RAM, Windows 11, Series S, DLSS Performance, FSR 3 frame generation; GPU clocks not recorded. Our fork's diag build on upstream v2026.11.30.02 with @nidea1's #4714, #4433 and #4464 ported, the step 1 debounce (our branch
up-card-read, b734f52f0) and a new census line for placement. Slot eviction was off (VICTORY_SLOT_EVICT=0), so cold figures are what could go, not what went.Step 1. In the world DXGI is now read about once a frame: a median of 15 reads a second (p95 17, max 18, minutes 3 to 16), against a median of 24, p95 153, max 496 in the same minutes last time.
Placement. Cold share of index-picked slot bytes at the 60 s cutoff (medians, 45 in-world census lines):
Ports. Host-written bytes unchanged (about 30 MB in both sessions). Resting bytes in the census: median 6 MB, max 231 MB. The player reported (not measured) gray, white, black and wrong textures and pop-in, mostly in new areas when travelling fast. The card was over budget from about 13 minutes to the end, so this doesn't single out the ports.
Compaction. New detail from the #4582 session reported earlier (our fork's port, one release-build session): each of the 13 logged passes let go 0 to 18 MB, while free space inside texture blocks rose from 845 MB at about 12 minutes to 1,472 MB at the end (1,516 MB at the peak).
Spec dependence
Not tested: a repeat of this session or an A/B of the ports; release on; the 16 ms floor in the game.
Next. A draft PR for step 1 (
Refs #4462) fromup-card-read, then research on placement for small textures before any code.Drafted with AI assistance (Claude Code).
@nidea1 on GitHub · 2026-12-01 04:26 UTC · original
Follow-up to the list above: opened two additional targeted 8 GB / 32 GB memory PRs on
main(5fabb46eaf), both conflict-free with the existing set:EvictedDeadRtSlotsRAII refcount guard across Phase 2 under anyVICTORY_BURY_LAG,make_againbusy guard, depth-stencilTwinholder/byte checks, and whole-backing unmap verification) so slot-pinned superseded/unmapped RTs reclaim cleanly instead of loopingtexture_madeevery 5 s.UPLOADS/SHAREDCPU buffer pool blocks to 16 MiB on<=32 GiBhosts (VICTORY_BUFFER_BLOCK_MB) and defaultsVICTORY_SPARE_SCALEon for<=9 GiBVRAM budgets using a peak-latched budget (strictly separate from texture block sizing in #1562/#1968).Running a live RTX 3060 Ti 8 GB / 32 GB RAM combined verification pass on the full stack now and will report live dead-RT/memory deltas on both PRs.
@CuteBooty on GitHub · 2026-12-01 05:03 UTC · original
One more long session for the plan, this time a whole campaign mission: 28 minutes, start to finish, with indoor scenes and a hotel. Build: v2026.11.30.01 + #4582 on its own trigger (not forced). RTX 3070 8 GB, Series S, DLSS Performance, DLSS frame generation x2, upstream's play settings plus
VICTORY_SAMPLED_EVICT=1. Closed normally.@Jesper-Andersson on GitHub · 2026-12-01 05:06 UTC · original
We re-checked the plan's claims against primary sources and ran three small probes on our card. The top post is updated; this is what changed and why.
Corrected in the top post
Probes (RTX 2070 SUPER 8 GB, driver 621.40, Windows 11 (10.0.26320), ReBAR off, idle desktop, no game; a small D3D12 test program, run once)
QueryVideoMemoryInfo: median 546 ns per call for one memory group, 1,102 ns for both, over 200 × 1,000 calls.Evict(), and back to 520 MB right afterMakeResident(). Unchanged 50 ms to 3 s later.Evict()of 8 heaps lowered the use by 512 MB at once, and so did destroying 8 other heaps. Windows moved nothing to shared memory in the ~10 s we were over.MINIMUMresidency priority still counted in full.MakeResident()costs after Windows has really paged the data out. A GPU read of an evicted heap removes the device, soEvict()stays only for objects nothing references.Texture blocks (our fork's pool lines, 72 Series S sessions on an older base, 4,459 samples): 95 % of textures are one 64 KiB piece. With 500 MB or more free inside blocks (75 samples), it sat in a median of 4,520 holes of about 140 KB each; with under 100 MB free, in a few large ranges. 706 of 794 times the pool added a block, it was nearly full (under 100 MB free). In the 23 additions that came with 300 MB or more free, the largest range was still 17–63 MB, so those are unexplained. Hole size does not look like the reason blocks grow; keeping lifetimes apart when textures are placed looks like the lever before moving them (not confirmed: older base, short sessions). A long session on the current base would confirm it.
Spec dependence
Evict(), the sources above).MakeResident()after a real page-out, the probes under game load.Sources
Drafted with AI assistance (Claude Code).
One owner for the whole card budget on 8 GB cards (measurements and a plan in small steps)to One owner for the whole card budget, for any card near its memory limit (measured on 8 GB; a plan in small steps)@Jesper-Andersson on GitHub · 2026-12-01 05:11 UTC · original
@CuteBooty thanks, a whole mission is a useful second shape next to our free-roam sessions. It's in the top post now.
Your blocks growing from 2.75 to 3.2 GB while 481–835 MB sat free inside them is the case our comment above leaves open. In our older pool logs most new blocks came with the pool nearly full, and the few that came with a lot free are unexplained. Your session looks like that unexplained case, over a whole mission. Could you run the same mission once more with
VICTORY_POOL_STATS=1? Itstexture blocks (VICTORY_POOL_STATS=1)line gives the number of free ranges, the largest one and how much free space is in ranges of 1 MiB or more. That would show whether the holes are too small for what the mission places, or whether something else adds the blocks.Drafted with AI assistance (Claude Code).
@eipastel on GitHub · 2026-12-01 05:23 UTC · original
@guyansong24
VICTORY_TEXTURE_BUDGET_MBis in the releases, not onlymain: it is read incrates/victory-gpu/src/resource.rs(texture_budget_limit) since v2026.11.26, and every release after it has it. My 5060 runs used it on amainbuild, but any release from v2026.11.26 on takes the same switch.@Jesper-Andersson on GitHub · 2026-12-01 05:37 UTC · original
Step 1 (#4745) run in the game on its own branch:
main5fabb46eaplus #4745, diag build,VICTORY_CARD_OWNER=readwith the switch set of our usual runs (listed in the log header; all present onmain), Series S, DLSS Performance, no frame generation. RTX 2070 SUPER 8 GB, driver 621.40, Windows 11, ReBAR off, GPU clocks not locked. One run, 2026-12-01: an 81 s load, then ~7 minutes standing in the world.card owner:lines (316 lines over ~8 minutes), at most 67 MB. The largest drift between two readings, 219 MB, came in the second the budget fell from 7,221 to 6,671 MB.Drafted with AI assistance (Claude Code).
@CuteBooty on GitHub · 2026-12-01 06:07 UTC · original
@Jesper-Andersson no replay of that mission for now. But
VICTORY_POOL_STATS=1is now part of my regular start, so every session from here on will carry the free-range line. I'll post the next mission that shows blocks growing while space sits free inside them.@Remorce on GitHub · 2026-12-01 07:15 UTC · original
Not sure if it'd be of interest, but I am going through and compiling/testing any Memory optimization PRs I can find, along with keeping a list of validated "Dead ends" that don't result in performance gains. Additionally reviewed Whiplash's documentation for what they tried doing and what the results were. #4774
@kraiy404 on GitHub · 2026-12-01 10:28 UTC · original
An 8 GB data point for step 1, from a card that spends most of its time past the budget — RTX 4060 Ti 8 GB, i5-13400F, 32 GB, Windows 11 Enterprise 26H2 (26300.9974), driver 621.40, 2560x1440.
Tested
v2026.11.30.03with only #4745's three commits on top, so thecard owner:line was live. Full numbers, the four run table and the trimmed logs are in a comment on #4745: .What the line says on this card:
hardstate in 83 % of the lines at Series S and 92 % at Series X — the card lives above H, not near it.Frame time did not move at Series S (60.0 against 57.9 ms median), but at Series X the same profile and route ran 88.9 ms median with the switch off and 69.0 ms with it on, and sat 864 MB over budget instead of 412 MB. One pair, so not proof — this card varies a lot between runs — but it is the case where the distance past the budget and the frame time moved together, which is what step 2 would act on.
Happy to run more configurations (texture room 88 %, frame generation off, ray tracing) if that helps.
@h9ddv7kk87-cloud on GitHub · 2026-12-01 11:01 UTC · original
Sharing two data points from an 8 GB Laptop GPU + 16 GB RAM setup (since most reports here seem to be 32 GB RAM):
System & Settings
7,344 MBv2026.11.28.03--series-s --res 1080to1440 --dlss performance --framegen 2 --fg-type dlss --fps 30,VICTORY_BVH_BUILDER=0,VICTORY_TEXTURE_ROOM_PERCENT=86,VICTORY_CARD_ROOM_FOR_TARGETS_MB=1200,VICTORY_LEVELS_ON_DEMAND=01. 35-min stable run telemetry
6,163 / 6,945 MB6,032 / 7,344 MB2. Immediate
0x8007000Ewhen loading a Vice City save5,276 / 6,842 MB), while Shared GPU Memory was at5,828 / 7,344 MB, then crashed with:Hope these 8 GB VRAM + 16 GB RAM telemetry numbers help with the budget/submit-thread work! Happy to test PR builds or specific switches if needed.
@Jesper-Andersson on GitHub · 2026-12-01 13:38 UTC · original
Thanks all, this is the kind of spread the plan needed.
card owner:line now prints the error's sign (f279fe874on #4745). Your Series X pair is noted in the post as one pair.0x8007000Eis E_OUTOFMEMORY, and it came with the card under its budget (5,276 of 6,842 MB) and shared memory high (5,828 of 7,344 MB), so on that PC the limit reached first may be RAM and commit rather than the card. #4289 (VICTORY_TEXTURE_COMMIT_FLOOR_MB, a lower texture line when the PC is short of commit) is aimed at that case; #4774 forced it on a 32 GB PC (card 8.4 → 7.25 GB) and expects it to help most on 16 GB PCs. That isn't something step 1 changes.Drafted with AI assistance (Claude Code).
@mcozcan on GitHub · 2026-12-01 13:40 UTC · original
@Jesper-Andersson @Remorce on the #4582 dead end in #4774: that run was the per-texture rule, and the result fits what it does. It let idle textures go from sparse blocks whether or not the block could empty, so with one member still in use the block stayed and the 5 MB came back as uploads.
#4582 now has a second rule for exactly this, behind
VICTORY_COMPACT_WHOLE=1(off by default):If, as the census says, the holders are mostly cold textures that slots pick by index, compaction alone won't free them. #4581's pressure mode is what lets those go, so the two together are the case to measure. I'll run three arms tonight on the 12 GB card and post the numbers on #4582: per-texture, whole blocks, and whole blocks with sampled eviction off (compaction alone).
@Jesper-Andersson on GitHub · 2026-12-01 15:29 UTC · original
A correction to our earlier numbers, a census on main's memory defaults, and replies.
Correction. Our census and owner sessions (the "What we see on an 8 GB card" table in the post and our census comments of 2026-12-01) did not run on main's memory defaults. Our launcher set
VICTORY_POOL_SMALL=0,VICTORY_SLOT_EVICT=0,VICTORY_TEXTURE_KEEP_FREE_MB=0(#4005 off),VICTORY_ROOM_BY_BLOCKS=1(#3754, not merged) andVICTORY_CARD_ROOM_FOR_TARGETS_MB=1280(main, unset: 2,560 MB on budgets up to 8 GiB). Main'sscripts\play-nvidia.ps1setsPOOL_SMALL=1andSLOT_EVICT=1, and the others are unset there (victory playon its own setsPOOL_SMALL=0; the script launchesvictory run, so that does not apply). WithPOOL_SMALL=0every texture of 64 KiB or less takes a whole 64 KiB piece. So "95 % of textures are one 64 KiB piece" and "textures up to 64 KB about 79 % cold (1.2 GB)" came from that setting, not from main. I'll correct the post.Census on main's defaults. One session of free play on my own save, 31 minutes in the world, same PC and same exe as before, with only the memory switches set back to main's (
POOL_SMALL=1,SLOT_EVICT=1,SAMPLED_EVICTunset): RTX 2070 SUPER 8 GB, driver 621.40, GPU clocks unlocked, ReBAR off, Ryzen 7 5800X, 32 GB RAM, Windows 11, Series S, DLSS Performance, FSR 3 frame generation, our fork's diag build. A memory measure, so no fps comparison. Not repeated.SAMPLED_EVICT(off by default). 530 MB of them had no shader read within their idle time at the end (1.4 GB at 1 minute).POOL_SMALL=1has had 0 device losses in 48 sessions on this card (2026-11-28 to 12-01); the one device loss in our logs from that time was aPOOL_SMALL=0session.Steps 3 and 4. @mcozcan, the whole-block rule in #4582 (
VICTORY_COMPACT_WHOLE=1, your comment) is the rule the post describes for step 3/4 (a block goes only when every member can, no refill, few spare blocks). So we won't write our own. We'll test #4582 withCOMPACT_WHOLE=1together with #4581 on this card and post on #4582. What step 3/4 adds on top is only the trigger (the target line from step 1), an age in seconds and ignoring menus; I'll reduce the step to that.@CuteBooty's 12 blocks vs our 0 blocks released. Your 12 is an upper bound, since your counter also counts blocks the sweep emptied. Your forced #4582 run had
SLOT_EVICT=1andSAMPLED_EVICT=1; our port runs had both off, so nothing could let go a texture a slot held, and #4582 only takes textures nothing holds. That is the most likely reason, but we haven't isolated it. Other differences: your run looked every 5 s (forced floor) while ours looked only over budget, and small textures were placed apart on yours.@nidea1, #4737 and #4738. The post's step 2 says #2361 "didn't stop the growth". If #2361 had the bugs #4737 fixes, that conclusion was about the buggy version, so I'll change it to "not yet measured with #4737". On our card the class #4737 is about looks small: copies a newer target took over were 45 MB at the end of the earlier session and 48 MB on main's defaults, against 400 MB and 385 MB of idle copies nobody took over. So we expect little from #4737 here, and will measure it rather than assume. #4738 is about CPU-visible buffer pools and spare blocks, which is the RAM side of this issue, not step 2. Its spare-block part has little to act on here: 2 empty blocks at most.
Spec dependence. May depend on our setup: block counts, cold shares and the over-budget sizes (8 GB, Series S, DLSS Performance, frame generation on). Untested: other GPU generations, AMD, 12–16 GB cards, Series X, ray tracing;
SAMPLED_EVICT, #4582COMPACT_WHOLE, #4737 and #4738 on this card.Drafted with AI assistance (Claude Code).
@mcozcan on GitHub · 2026-12-01 16:01 UTC · original
Thanks @Jesper-Andersson, and for the correction on the defaults; the main-defaults census is a much clearer picture.
Agreed on steps 3/4:
VICTORY_COMPACT_WHOLE=1in #4582 is meant to be that rule, so testing it together with #4581 on your card is the most useful thing. Two notes before you do:VICTORY_D3D12_DEBUG=1handy for those runs.SAMPLED_EVICT=0, with the kept-reason breakdown and the released-blocks line. I'll post them on #4582 as promised.@nidea1 on GitHub · 2026-12-01 16:07 UTC · original · edited 2026-12-01 16:41 UTC
Thanks @Jesper-Andersson for the thorough main-defaults census and for updating Step 2 to "not yet measured with
#4736" — measuring#4736directly against the actual 45–48 MB superseded-copy class makes complete sense.Good note on
#4737's spare-block cap as well (at most 2 empty blocks on your 8 GB run). Quick status update on the RAM side of#4737: following @POMXARK's paired 32 GB RAM / RTX 5080 16 GB Series X A/B (where 16 MiB CPU buffer blocks regressedprep_msand Commit compared to 64 MiB),cff7e115/b34c3740narrowed#4737's auto-16 MiB buffer block gating to< 24 GiBRAM or<= 32 GiBRAM paired with<= 9 GiBDXGI local VRAM (keeping 32 GB + 12–16+ GB VRAM rigs on 64 MiB) and hardened concurrent growth intake_from_with_limit(preventing duplicate sparse-block pinning and stale post-growthRipebudgets).@Jesper-Andersson on GitHub · 2026-12-01 18:36 UTC · original
Personal message (No AI): Due to large changes in main we are updating the plan to match, expect changes to post and steps. Our idea of a shared owner still stands with trustno1's newest update and should complement it well. A comment with changes will be added soon.