MASSIVE MEMORY LEAK/USAGE Exceeding AVAIL RAM? - Core Cause for ppl's Crashing? #4127
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#4127
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?
@ajmi982 on GitHub · 2026-11-30 16:25 UTC · original
I think Victory decides to try and use way more memory than a person's PC has, starts bloating up page files and when there is simple no more room... CRASH.
Can everyone who has been CRASHING check how much MEM is being USED vs how much u HAVE?
crashes.log
@rahmondg45 on GitHub · 2026-11-30 16:42 UTC · original
i have 8gb card rtx 4060
and within 15 minutes im getting vram overload and that regardless of model or resolution picked
when i open task manger it says victory is using about 15,500 mb which is 15.5 gb
and thats well over a 8gb card
@rahmondg45 on GitHub · 2026-11-30 16:45 UTC · original
before im of the loading screen before the world loads im already hitting 4gb in vram before im even able to do anything then within 10-15 minutes victory is using 15gb memory ...and task says thats 90% of my memory and its only using 50% cpu
@nick0451 on GitHub · 2026-11-30 20:12 UTC · original
Measured numbers for this. RTX 3090 24 GB, i9-14900K, 32 GB RAM, Windows 11. Series S, DLSS performance, RT and FG off. Private memory sampled every 30 s from Task Manager's counter (
PrivateMemorySize64), standing still.41adb551)c71899d9)victory.exeSo .02 still has it. On a 32 GB PC that means page-file growth within minutes and then a crash, which fits the reports here.
What it is not, from runs of .01:
victory playdefaults ofc71899d9. With all 14 switched off, .01 still grew 9 GB in under 5 min.ae3e45bc). .01 with that commit reverted grew 8.1 GB in about 5 min, against 8.4 GB with it, under the same build options.Where it is, from the game's own
process memory:line at the end of the 20-minute .01 run, against .05:So something in
41adb551..c71899d9allocates on the host side, in our heap or a D3D12 object in the driver, and never gives it back. I couldn't bisect by commit: intermediate commits in that range don't build alone (Rmw::SubE0599).🤖 Generated with Claude Code
@nick0451 on GitHub · 2026-11-30 21:06 UTC · original
Still there in v2026.11.30.03. With the official
victory.exe(SHA-256 matches the release notes), city street, standing, no card cap, 10 min: private memory went 27.4 → 44.4 GB between minute 1 and minute 10, about 1.9 GB a minute, with no levelling off. Same machine as above.🤖 Generated with Claude Code
@ajmi982 on GitHub · 2026-11-30 21:21 UTC · original
CRASH yet again and it must be because of this massive memory leak:
victory-nvidia-play-20261130-210457-26900.log
crashes.log
@davemathews12 on GitHub · 2026-11-30 21:49 UTC · original
@nick0451 Your range can be bisected. The Rmw::Sub error is one known break, and a 3-line step gets past it.
Why the commits don’t build: the first commit on main after
41adb551isd62c7d55, “Merge PR #1939”. That PR used Rmw::Sub, which main had already removed. It was reverted in87dd67e1, 118 commits later. So every commit in that stretch fails with:That is more than half of 41adb551..c71899d9.
The fix while bisecting: apply the shader half of that revert at each step. I checked that it applies cleanly to all 118 broken commits. On the middle one (
c60d6e7a), cargo check -p victory-shader fails with the E0599 above, and passes with it applied.Bisect along main only (--first-parent, git 2.29+). That’s 227 commits, so about 8 builds:
At each step:
Only crates/victory-shader is touched, and only to restore what was already on main, so the memory numbers aren’t affected.
One more lead from your numbers: about 35 GB extra and about 67k extra regions works out to roughly 0.5 MB per region. That’s about the size at which the Windows heap gives each allocation its own region, and also typical of a small D3D12 upload or readback buffer. So it’s probably something allocated many times a second and never released, rather than one cache growing. That’s an inference only; the bisect will say which.
@nick0451 on GitHub · 2026-11-30 21:56 UTC · original
@davemathews12 Thanks, that's what was missing.
git show 87dd67e -- crates/victory-shaderapplies cleanly toc60d6e7here too. I'll bisect along--first-parentwith that applied where needed, and post the commit.One more data point on the shape, since you inferred about 0.5 MB per region. I walked the process with
VirtualQueryEx(committedMEM_PRIVATE, grouped by allocation base) on the official v2026.11.30.03, at 93 s and 372 s into the world, city street:The six
toggled!switches added in the range (FLUSH_SIFT,FRONT_SIFT,HELPERS_RAISED,RANGE_MEMO,SLOT_EVICT_KEPT,SMALL_WHEN_FULL), all set to 0 together, don't change the rate (1.88 GB/min).🤖 Generated with Claude Code
@nick0451 on GitHub · 2026-11-30 22:00 UTC · original
@davemathews12 One correction from trying it. The shader half of
87dd67eisn't enough on its own. At the middle commit6b061883it buildsvictory-shader, butvictory-gputhen fails withE0425: cannot find function set_atomic_sub_loops in module victory_shader::emit(shader_cache.rs:133). The full revert,git show 87dd67e --format= | git apply, applies cleanly there. Besides the shader files it also touches:crates/victory-gpu/src/shader_cache.rs(−29);crates/victory-gpu/src/host.rs(−11);apps/victory/src/translate.rs(−6).All of that is #1939's atomic-subtraction switch, so the memory numbers still aren't affected.
I can't finish the bisect on this PC today. Its CPU has started failing: rustc access violations even at
-j 1on small crates (victory_formats,victory_loader), and a bluescreen while idle. Any build I made now would be suspect anyway. If you or someone with a stable machine can run it, here is the test I used:The probe on the official .03 also showed the thread count (≈180) and handle count (≈8,150) flat while private memory climbs, so it's not a thread leak, even though the leaked allocations are exactly the size of a default Rust stack.
🤖 Generated with Claude Code
@nick0451 on GitHub · 2026-12-01 01:46 UTC · original
@davemathews12 The bisect names #2469 ("Fix/driver pipeline retry after 2188", merge
97593f46) as the first bad commit.How it was run: first-parent from
41adb551(good) toc71899d9(bad), 227 commits. Each step had the full87dd67erevert applied where it applied, a release build with LTO off in a fresh target dir, its own fresh cache dir, and an 8-minute city run off-screen. Growth was measured from minute 4 to the end, after the shader compiles. RTX 3090, 32 GB RAM, Series S profile, DLSS performance, no frame generation.6b061883ee1748badb3a6aff7788c139f00f95072109e71824c38e0d97593f46(#2473 at step 91 only changes the shader crate's test host, so #2469 is the last runtime change in the range.)
What the logs show. Every bad run logs this, with the counter (logged only at powers of two) reaching
so_far=1024within the 8 minutes:That holds for steps 90, 91, 98 and 113, the official v2026.11.30.03, and the run I walked with
VirtualQueryEx. Steps 56, 84, 87 and 89 have none of these lines. It comes from compute pipelines only, a handful per run. Only the power-of-two lines name a hash, and the hashes differ between builds. Fromso_far=512to1024took 176 s, so about 3 attempts a second, which matchesDRIVER_RETRY_INTERVAL_MS = 250.My reading, not yet proven: before #2469, a D3D
E_OUTOFMEMORYfromCreateComputePipelineStatewent throughrefused::failedand the pipeline was refused for the run, so it was tried once. Since #2469,failedreturns true for a queued build, the key is deferred, and it is rebuilt about every 250 ms forever. If each refused driver compile leaves its working memory behind, that would explain the ~2 MB private allocations at host addresses that kept growing. If a pipeline never compiles here, it never stops retrying. Currentmainstill has this path, and there is no switch to turn it off.Causal check, running now: the v2026.11.30.03 source (
e1251c31) with one local test switch that passesNoneinstead ofSome(driver_oom)inPending::make, which is the pre-#2469 behaviour. The runs alternate between the shipped retry and refuse-once, two rounds each. I'll post those numbers in about 45 minutes, whichever way they come out.@davemathews12 on GitHub · 2026-12-01 01:59 UTC · original
@nick0451 Great bisect, thank you. That pins it.
A fix for that cause, if your check confirms it: https://github.com/davemathews12/VIctory-NVIDIA/tree/fix/driver-oom-retry-backoff (one commit on main,
pipeline/make.rs).VICTORY_DRIVER_TRIES=<n>sets the tries;0keeps #2469's unbounded retries, so the A/B is one switch on the same build.Not run in game (no Windows machine here); it builds for x86_64-pc-windows-msvc with no new warnings, and a unit test covers the timing. If your 8-minute test on it shows the growth gone (and
VICTORY_DRIVER_TRIES=0brings it back), I'll open it as a PR with your numbers, unless you'd rather open your own.@nick0451 on GitHub · 2026-12-01 02:01 UTC · original
@davemathews12 Thanks, I've read it, and the logic looks right to me:
gave_upturns the deferral into a recorded refusal, sosettlestoresNoneafter the sixth try. I'll run your branch (15637777) as you describe: default vsVICTORY_DRIVER_TRIES=0, one build, alternating starts, two rounds each, the same 8-minute city test. It runs right after my own refuse-once check on .03, which finishes in about 25 minutes. Please open the PR yourself; I'll post the numbers here and on it.One detail for the PR text: this card is an RTX 3090 on driver 610.88, older than 617.x, and it refuses these compute shaders too. So it isn't only 617.x.
github-bot referenced this issue2026-12-01 02:08:55 +00:00
@nick0451 on GitHub · 2026-12-01 02:24 UTC · original
@davemathews12 The causal check confirms it. This is the v2026.11.30.03 source (
e1251c31) with one local test switch that passesNoneinstead ofSome(driver_oom)toHostPipeline::buildinPending::make, so a driver OOM is refused for the run, as before #2469. One build (LTO off) with its own cache dir, starts alternating, 8-minute off-screen city run, growth from minute 4. RTX 3090, driver 610.88, 32 GB, Series S profile.D3D12 returned E_OUTOFMEMORYretry lineshost pipeline failed(once per key)so_farto 1024)So the endless retry of driver-refused compute pipelines is the leak, and stopping it also gives back about 2–4 fps. Your branch (
15637777) is building now: default vsVICTORY_DRIVER_TRIES=0, two rounds each, the same test. Those numbers follow in about 40 minutes.@nick0451 on GitHub · 2026-12-01 03:02 UTC · original
@davemathews12 Your branch (
15637777, on mainf5c3d243) removes the growth. One build (LTO off) with its own cache dir, starts alternating, the same 8-minute off-screen city run, growth from minute 4. RTX 3090, driver 610.88, 32 GB, Series S profile.so_far, logged at powers of two)VICTORY_DRIVER_TRIES=0, round 1so_farto 64)VICTORY_DRIVER_TRIES=0, round 2so_farto 64)One thing about
0. It removes the try limit but keeps the backoff.deferusesdriver_retry_delay_ms(fails)wheneverdriver_oomis set, whateverdriver_tries()is, so the waits keep doubling to 60 s. With0, the counter reached onlyso_far=64in 8 minutes, against 1024 on .03, and the growth is smaller in proportion. So0isn't quite "as #2469 had it", as the doc comment says. Either0could also restore the flatRETRY_AFTER_MS, or the comment could say "no limit, with backoff". It doesn't affect the fix itself.The faithful "before" for the PR is my .03 check above: unbounded 250 ms retries, 1.58 / 1.94 GB/min, against 0.07 / 0.12 with the pipeline refused once. With your defaults, 8 compute pipelines per run end as "not tried again" after about 30 s, and the rest of the run is flat.
What I didn't test: a load where memory really is short (the #2188 case your 30 s of retries is meant for), other cards and drivers, and frame generation or ray tracing.