Pipelines: a pipeline D3D refuses for memory is tried 6 times, 1 to 16 s apart, then refused for the run (#4127) #4695
No reviewers
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!4695
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4694"
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?
@davemathews12 on GitHub · 2026-12-01 02:07 UTC · original
davemathews12:fix/driver-oom-retry-backoff→main· +81 −4 · 1 files · 4 commits · closed without mergingFixes #4127
What it changes
Since #2469, a pipeline that D3D refuses with
E_OUTOFMEMORYis deferred and tried again about every 250 ms (DRIVER_RETRY_INTERVAL_MS) for the whole run. A compute pipeline the driver always refuses is then compiled about 240 times a minute. nick0451's bisect in #4127 (227 commits, first-parent from41adb551toc71899d9, an 8-minute city run each) names97593f46(#2469) as the first commit with 1.7–2.0 GB/min of private-memory growth. Every bad run logshost pipeline not made: D3D12 returned E_OUTOFMEMORY(reachingso_far=1024in 8 minutes, compute only), and the good runs log none. The refusing driver isn't only 617.x (#4631): it's also an RTX 3090 on 610.88.This change:
driver_fails);driver_retry_delay_ms, at most a minute);settlestoresNone), which is what happened before #2469. A refusal that passes (memory short while loading, #2188) is still tried for about half a minute;VICTORY_DRIVER_TRIES=<n>to set the number of tries;0keeps #2469's unbounded retries, so one build can A/B it.The global 250 ms retry token and the memory guard's own deferral (
RETRY_AFTER_MS) are unchanged.How it was tested
VICTORY_DRIVER_TRIES=0, two rounds each, the same 8-minute city test as the bisect) and will post the numbers here.cargo testpassed for the crates it touches: not run (Windows-only module).cargo clippy -p victory-gpu --tests --target x86_64-pc-windows-msvc: no errors and no warnings inmake.rs, cross-checked from Linux. New testa_driver_refusal_backs_off_and_ends(delays, the bound,0= unbounded); the existingactual_driver_allocation_error_leaves_the_pipeline_retryablestill holds (the first retry is still after 1 s).Checked for overlap
DRIVER_RETRY, "pipeline retry E_OUTOFMEMORY"). None bounds these retries. Related: #2888 (retry a mesh pipeline after making room), #4472 (draws not held on memory-deferred retries), #4631 (driver 617.x troubleshooting).🤖 Generated with Claude Code
@nick0451 on GitHub · 2026-12-01 03:47 UTC · original
Tested in the game. I built
15637777; the only change since,22fd9e5a, is a doc comment. RTX 3090, driver 610.88, i9-14900K, 32 GB, Series S, DLSS performance, no frame generation or ray tracing. Release build with LTO off and its own cache dir, starts alternating, an 8-minute off-screen city run, private-memory growth from minute 4. Full details are in #4127.VICTORY_DRIVER_TRIES=0VICTORY_DRIVER_TRIES=0lifts the bound but keeps the backoff:deferusesdriver_retry_delay_mswheneverdriver_oomis set. So it reached onlyso_far=64in 8 minutes, against 1024 as shipped, and it isn't quite "#2469's unbounded retries" as the description says. The shipped rows above are the true "before".@nick0451 on GitHub · 2026-12-01 04:45 UTC · original
One more result from the same runs. The endless retry is also the stutter, not only the memory. From the per-second
frame timeslines, last 240 s of each 8-minute run, same machine and test as above:VICTORY_DRIVER_TRIES=0(backoff kept), round 1 / 2Frames over 50 ms barely move (about 1,600–2,000 in every arm); it's the over-100 ms spikes, one or two in most seconds, that come with the retries. So this PR should also take away much of the "small stutters, quick fps drops" reported on .03 on cards whose driver refuses these pipelines.
@YounesAH15 on GitHub · 2026-12-01 07:36 UTC · original
Confirmed on RTX 3050 8 GB (driver
610.88/32.0.16.1088), 40 GB RAM, 12-thread CPU, Windows 11, Series S, DLSS Performance, FSR 3 2x.>= 500 draws/frame)E_OUTOFMEMORYretriese1251c31+ local perf branches, without#4694)so_far=1024,0stopped35,625 MB(climbing)7.9 fps125.0 ms/204.0 ms#4694(15637777+22fd9e5acherry-picked)max so_far=32,8compute shaders gave up after 6 tries20,854 MB(20,797 MBlatest — flat)15.6 fps64.1 ms/72.0 ms(Note: the "With
#4694" build also included#3760and local--auto-fpstuning, so the FPS delta is not isolated to#4694alone; however, theE_OUTOFMEMORYretry loop stopping cleanly after 6 tries on all 8 refused compute shaders and committed RAM staying completely flat at20.8 GBover 16+ minutes vs climbing past35.6 GB— and46.8 GB/26.7 GBunnamed private bytes in an earlier Series X run one1251c31— directly confirms#4694eliminates the driver610.88leak on RTX 3050 8 GB.)cargo test -p victory-gpu --lib a_driver_refusal_backs_off_and_ends: 1 passed, 0 failed.@andrewpozdnakov7-jpg on GitHub · 2026-12-01 10:25 UTC · original
In
22fd9e5a,Pending::deferlogs the defaultRETRY_AFTER_MSeven whendriver_retry_delay_ms()schedules a longer pause. For example, the second driver refusal schedules 2,000 ms and the message reports 1,000 ms if that refusal is selected for logging.Proposed follow-up uses the same computed delay for the message and
retry_at. I cherry-picked both existing commits onto current main5fabb46, preserving their Git author. The follow-up only adjusts the delay reported by the log.cargo check --locked -p victory-gpu --jobs 2and the staged policy check passed.Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the follow-up into another commit.@davemathews12 on GitHub · 2026-12-01 12:37 UTC · original
Thanks all. Two more commits:
7eab55cb: VICTORY_DRIVER_TRIES=0 now also drops the back-off (flat RETRY_AFTER_MS), so it really is #2469 as shipped, as @nick0451 pointed out.38c4a9e5(@andrewpozdnakov7-jpg's 0c4bd9d, cherry-picked with authorship kept): the warning reports the real retry delay.Results so far: @nick0451 (RTX 3090, 610.88) 1.58/1.94 → 0.08/0.04 GB/min, 20.3/18.9 → 22.4/23.4 fps, frames over 100 ms 337/365 → 42/10; @YounesAH15 (RTX 3050, 610.88) 35.6 GB climbing → 20.8 GB flat over 16 min, 8 compute pipelines gave up after 6 tries (the fps there includes other changes).
@davemathews12 on GitHub · 2026-12-01 13:22 UTC · original
Ready for review: tested in game on three PCs, every run with the same before/after.
e1f2eb6level), page-ins 541/s, copy-back 12.2 ms@meonline42 measured ~5 GB/min on main
7d93ee07(RTX 3090, 64 GB) from the same refused compute pipelines (098fc28e44347a00, b3e7781d53ff8326), and none on builds before #2469. This growth is the extra ~15 GB on main in #2415's slowdown reports.@nick0451 on GitHub · 2026-12-01 16:32 UTC · original
@davemathews12 Rerun on the head up for review (
38c4a9e5), now thatVICTORY_DRIVER_TRIES=0is #2469 as shipped. Same PC (RTX 3090, driver 610.88, 32 GB, Series S, DLSS performance) and the same 8-minute city run as before: one build (LTO off) with its own fresh cache, runs alternating, growth measured from minute 4, frames over the last 240 s.so_far, highest logged)VICTORY_DRIVER_TRIES=0, round 1VICTORY_DRIVER_TRIES=0, round 2The
0arm now matches what v2026.11.30.03 did here (1.58 / 1.94 GB/min, 199 / 211 seconds with a >100 ms frame), so the switch is a faithful "before" on the same build. The defaults behave as on15637777: 9 pipelines per run end as "not tried again" after their tries, memory stays flat, and the stutter is gone. The new log line shows the real delays.@Dishairano on GitHub · 2026-12-01 16:45 UTC · original
Tested on Windows 10 19045, GTX 1660 SUPER (6 GB), NVIDIA 621.40, Series S, built from
38c4a9e.cargo test -p victory-gpu --lib pipeline::make: 38 passed, includinga_driver_refusal_backs_off_and_ends. The one failure,actual_driver_allocation_error_leaves_the_pipeline_retryable, fails the same way on main5fabb46here (a Windows 10 test binary gets no Shader Model 6.6), so it's unrelated.E_OUTOFMEMORY, 0not tried again, 0host pipeline not made. On 621.40 this card refuses nothing, so the give-up path itself wasn't exercised here.E_OUTOFMEMORY. So on this configuration a full card alone didn't cause driver refusals.@trustno1-coder on GitHub · 2026-12-01 18:34 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
@nick0451 on GitHub · 2026-12-01 18:35 UTC · original
For deciding whether to rewrite this against the new main: on v2026.12.01.01-test (RTX 3090, driver 610.88), the compute pipelines that .03 had refused on this card (
8080af82aaac33df,b3e7781d53ff8326,9aa4a785e0800cda) are made with no refusal. The log says "0 host pipelines failed", and an 8-minute idle run grew 0.02 GB/min, so the storm didn't start here. But the new main (7724fb03) still has #2469's unbounded retry:DRIVER_RETRY_INTERVAL_MS = 250,reserve_driver_retryand thedriver_oompath inrefused::failed, with no try limit. So on any card or driver that still getsE_OUTOFMEMORYfromCreateComputePipelineStateon the rework (#4631's 617.x cards, or the RTX 3050 on 610.88 above, if they still do), the leak and the stutter would come back as before. A check from someone who saw refusals on .03 would settle whether the rework alone is enough.Pull request closed