GPU: a failed host texture allocation removes the device instead of dropping detail (8 GB NVIDIA laptop, world load) #1226
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#1226
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?
@Logan-Gaillard on GitHub · 2026-11-24 16:34 UTC · original
What happens
On an 8 GB NVIDIA laptop,
mainnever reaches the world: after 79 packs are opened, hosttexture creation starts failing with
E_OUTOFMEMORYon completely ordinary textures, and thefailure is turned into a device removal instead of a degraded frame.
Machine: RTX 5070 Laptop (8 GB VRAM), 15.4 GB RAM, 24.8 GB system-managed pagefile
(commit limit 40.2 GB), retail 1.0.2.1 on SSD, Windows 11,
ffe310erelease build, built withcargo-xwin. Same failure with the diagnostics build, with #1133, #472 and #561.Why it is not "the GPU is out of VRAM"
Measured during the failing load:
nvidia-sminever reported more than 501 MiB of VRAM in use out of 8151;commit climbing towards its 38.3 GB limit;
the process exits on its own error path.
The textures that fail are BC1/BC3/BC7, 1024-2048 px, 9-12 mips, DEFAULT heap, flags 0. It is
the committed size that the driver refuses, not residency — which is why texture size, not
allocation order, is the lever.
What is already proven to work
#737's
VICTORY_TEXTURE_MIP_DROP=1(branchantikohza:feat/texture-mip-drop-budget,06603c7)makes the world load on this exact machine: 79 packs, 0
no host texture, 0command list did not close, no removal, 29-30 fps, 34.4 ms/frame, 11 draws/frame, menusunchanged at 30.0 fps / 33.3 ms. Reported in #653 as well.
The gap
That switch is opt-in, so
mainon an 8 GB card still crashes by default, and the failure pathitself is hostile: a failed allocation leaves the resource null and the commands recorded
against it are what remove the device. A machine that cannot fit one texture should lose that
texture, not the whole device.
Proposed change (
fix/auto-mip-drop-on-oom)Keep #737's drop machinery, but drive it from allocation pressure instead of an env var:
PRESSURElevel,compute_mip_dropreturnsmax(VICTORY_TEXTURE_MIP_DROP, PRESSURE);host_texture, onCreateCommittedResourcereturningE_OUTOFMEMORY, raisePRESSUREto
drop + 1(capped at 3), recompute the drop and retry once; loghost memory pressure: dropping N mips automatically;Effect on the machine above: the first tessellated world texture that does not fit drops one
mip, every later texture follows, and the run should reach the world with slightly softer
textures instead of removing the device — no environment variables required.
Test plan: same machine, same route, release build of the branch without any
VICTORY_*variable; expect the world to load,
no host textureto disappear, and the frame rate to bein the same 29-30 fps band as the manual
VICTORY_TEXTURE_MIP_DROP=1run, with a visiblequality difference on large world textures only.
Note on the branch
I can comment and open issues here, but this account has no write access to the repository
(
permissions: push=false, and PRs are restricted to collaborators per #717), so I cannotpush
fix/auto-mip-drop-on-oommyself. If a maintainer creates the branch — or grants writeaccess — I will push the patch and open the PR against it.
github-bot referenced this issue2026-11-26 04:56:04 +00:00
@pickles976 on GitHub · 2026-11-24 16:37 UTC · original
Two-layer read from the runtime whose 8 GB cohort does not have this failure — the contrast is architectural, and this issue is the cleanest evidence of it yet.
Why it cannot happen in ivall/xcl (same hardware class): we do not keep host textures. Title texture data is placed in place on the title's own pages — physical-backed regions opened as D3D12 heaps (windowed UMA model,
gpu/uma.rs), with system-memory spillover — so "create the host texture, sized 2048²×12 mips, again" is not a step that exists. Your log'sE_OUTOFMEMORY (0x8007000E)on "completely ordinary" 1024–2048 textures after 79 packs is the mirrored-copy architecture meeting a real VRAM budget: the console memory is already paid for, and the mirror is the overdraft. That is also why your nine-change #1086 needed mip-drop to fit a 12 GB card, while our 8 GB reports reach world/story-load on unmodified budgets — and why the residual 8 GB death in both runtimes has moved to places the title itself convicts (title_memory_mbover-planning on our side, xcl#1337).The immediate bug is still yours though, and it is narrower than the issue title suggests: your WARN line proves a degrade path exists ("no host texture" → render without it) — what removes the device is the same E_OUTOFMEMORY surfacing mid-recording (
a host command list did not close (0x8007000E)). Two error channels for one allocation failure: the view path degrades, the record path escalates. Pin the allocation failure to a creation-timeE_OUTOFMEMORYanswer (which the title's own budget logic can consume — it has one; we mapped its fatal variant at+0x193e00fand its 2 MiB-range refusal style at+0x247af2don the shared kill-map, so titles demonstrably branch on these), and never let the resource-creation status reachClose. A missing-detail frame is exactly what your WARN was already promising the user.Structural option, since your physical-page work (#1147) is one step from it: in-place binding for the sparsely-used texture classes removes the mirror — and with it this entire failure class — at the cost you measured there (SEC_COMMIT windows, ≤4095 MiB sections). If the page-table probe results stay green, "host texture" becomes a view, not an allocation, and
0x8007000Estops being a runtime error at all.@Logan-Gaillard on GitHub · 2026-11-24 16:39 UTC · original
Thanks, this is the clearest framing of it I have read.
The measurements agree with the mirror-is-the-overdraft reading. During the failing load on
this machine:
nvidia-sminever above 501 MiB of VRAM in use out of 8151, process peakingat 15.6 GB private on 15.4 GB of RAM, system commit climbing to its 38.3 GB limit. So the
console memory is paid for, and it is the second copy that cannot be committed — exactly your
point, on a machine where VRAM itself is 94% idle.
On the two channels: agreed, and that is what the patch I am testing here does.
E_OUTOFMEMORYwhen it can answer with a texture: onCreateCommittedResourcereturning0x8007000E,host_textureraises a process-wide droplevel (one more mip, capped at 3) and retries immediately, so that texture and every later
one are smaller. Creation thus returns a valid resource, which is what the title's own
budget logic can consume.
None, the record path must not escalate. That is the half I amlooking at now: find where the list records a copy or a draw against a resource that is not
there and make it count a dropped command instead of recording an invalid one.
I will post the in-game result (loaded or not,
no host texturecount, frame rate) and the diffon this issue once the branch has run through the world load on the same machine.
On in-place binding: I agree it removes the entire class rather than softening it, and I am
not attempting it in this patch — #1147's constraints (SEC_COMMIT windows, <= 4095 MiB sections)
make it a change of its own, and the mip drop is what fits the 8 GB laptop today (with #737's
manual switch the same machine loads the world at 29-30 fps; without it, 40+ creation failures
and a removed device). If the page-table probe results stay green, that follow-up should be
tracked separately against this issue rather than folded into it.
@Logan-Gaillard on GitHub · 2026-11-24 17:04 UTC · original
Update: three builds run in-game on the same machine, same route (retail 1.0.2.1 from SSD), and
one measurement that changes the shape of this issue.
The adapter the device was created on.
D3D12CreateDevice(None, ...)picks DXGI's default,which on this laptop is the integrated GPU:
Host copies then live in shared system memory, which is exactly the overdraft described
above, and the world load dies on
E_OUTOFMEMORYthere. Creating the device on the adapter withthe most dedicated memory moves it to the RTX 5070 Laptop (8,273,264,640 bytes).
ffe310eno host texture,command list did not close (0x8007000E), device removedE_OUTOFMEMORYdid not close, same removalno host texture, 0did not close; device pauseddevice removed after a submission of 30 lists(0x887A0004)So the reactive branch is dead as an approach — by the first failed allocation the process is
already against its commit ceiling, and dropping a 1024-wide texture then buys nothing. The
proactive drop removes the allocation failure entirely, and with the device on the real card the
run reaches world streaming, where it now fails on the GPU fault this issue's title is about,
with no allocation error logged at all.
Both changes are local commits on
fix/auto-mip-drop-on-oom(1cfd8ed,2cbc63c): theadapter choice, the adapter memory read, the proactive drop level, and the reactive retry kept
as a fallback. This account still has no write access (
push=false, #717), so I cannot push thebranch — a maintainer creating it, or granting write, gets the diff and this test data.
@Xvania7 on GitHub · 2026-11-24 17:17 UTC · original
@Logan-Gaillard, I've prepared a fix for this. It adds automatic mip-dropping when
E_OUTOFMEMORYoccurs, so the game should load on 8GB cards instead of crashing. Here is the ready-to-merge Issue with the branch and test results: #1302.@Xvania7 on GitHub · 2026-11-24 17:22 UTC · original
I just read the new test data. You are absolutely right — the reactive approach is too late. My branch (#1302) used the reactive approach, so I am closing it to avoid confusion. PR #1296 (@antikohza) covers the proactive adapter selection and early mip-drop which is the correct way. Thanks for the deep investigation!
@Logan-Gaillard on GitHub · 2026-11-24 17:23 UTC · original
Thanks — closing #1302 is the right call, and for what it is worth the reactive branch is not wasted
work: the measurement that kills it (86 failed creations after the level was already raised three
times, because the process is at its commit ceiling by then) is now written down in #1226, and it
is the reason the proactive form is the one that reaches the world. #1272 is the same reactive
idea and got the same result in-game today (79 packs, two
no host texture,command list did not close).One thing to keep in the merge path for #1296: its VRAM probe reads the maximum dedicated
memory across adapters, while the device is created by
D3D12CreateDevice(None, ...). On thislaptop that device is the Intel iGPU (128 MiB, shared system memory), so the probe sizes textures
from the RTX while the host copies live in RAM, and the run still dies:
Matching
device.GetAdapterLuid()againstIDXGIAdapter1::GetDesc1().AdapterLuid, or creating thedevice on the adapter with the most dedicated memory, closes that. With the device forced onto the
RTX the same build streams the world (165-289 MB of copies per frame) before it hits the separate
GPU fault tracked in #653.
@Xvania7 on GitHub · 2026-11-24 17:24 UTC · original
That's a great catch on the adapter selection. You are absolutely right — matching
device.GetAdapterLuid()against the DXGI adapters (or picking the one with the most dedicated memory) is essential here. Otherwise, the proactive drop logic in #1296 is sizing textures for the RTX while the host copies are living in shared RAM on the Intel iGPU.This is exactly why your in-game testing is so valuable. I'll be watching #1296 to see this adapter selection get patched in.
@antikohza on GitHub · 2026-11-24 19:58 UTC · original
@Logan-Gaillard @Xvania7 — quick update on the fixes in #1296:
Everything flagged from this issue (#1226) and #1296 testing is now landed and CI-verified on
feat/texture-mip-drop-budget(a6f3ccb, Windows CI run 45470890213):814c580,a6f3ccb):best_adapter()probesD3D_FEATURE_LEVEL_12_0on non-software DXGI adapters and selects the highest-VRAM card (with default-adapter fallback), andadapter_memory()matchesdevice.GetAdapterLuid()read live bytexture_mip_drop().a6f3ccb):ResourceMinLODClampSRV rebasing, singlehost_texture()drop computation, BCn 4×4 block-alignment check, safe overlapping-mipCopyResourcefallback, and zero-allocu128per-subresourceHostWrittentracking.0d79788): Also verifiedfeat/texture-mip-drop-on-1542combining #431's lazy first-use textures + #967 adapter selection + #1296 mip-drop (Windows CI run 45473319819, 468 workspace tests passing).@Marvisak on GitHub · 2026-11-25 10:10 UTC · original · edited 2026-11-25 12:45 UTC
Automated triage for the maintainers.
Confirmed in
main(940d32f), thanks for the measurements.createincrates/victory-gpu/src/host.rsstill callsD3D12CreateDevice(None, ...)outside the WARP diagnostics path, so the device goes to DXGI's default adapter. On a hybrid laptop that can be the integrated GPU, as yourhost adapter adapter=Intel(R) Graphicsline and the later same-machine correction show.mainalso has no mip drop: whenCreateCommittedResourcefails,make_textureincrates/victory-gpu/src/resource.rslogsno host textureand leaves the texture without a host copy. Which recorded command then makes the list fail to close is not settled here.Note on the latest comment: #1296 was closed without being merged, so its
best_adapter()and LUID check are not inmain. Open pull requests for this:VICTORY_TEXTURE_MIP_DROP.E_OUTOFMEMORY. Your table shows it does not reach the world.Pull requests are open to everyone. Please open
fix/auto-mip-drop-on-oom(1cfd8ed,2cbc63c) as a PR, or post your adapter-LUID check as a review on #2371, so the approaches can be compared in one place. The later0x887A0004removal on the RTX in world streaming is a separate failure (#653).Generated by Claude Code
@Logan-Gaillard on GitHub · 2026-11-25 10:13 UTC · original
Same-machine correction: one of the
0x8007000Eruns in this thread was measured on the iGPU, not on the 8 GB dGPUMeasured by @1mlesc (PC3) on the three-agent bench,
fxceless/victory-forkat9376fd6, RTX 5070 Laptop 8 GB + Intel iGPU, 23.4 GB RAM.A previous run of
vfork.exethat died witha host command list did not close (0x8007000E)at ~11.8 GB was not running on the dGPU. Evidence from its log:vfork.exehad no entry inHKCU\Software\Microsoft\DirectX\UserGpuPreferences;0x8007000Earrived at 11 825 MB used against a 11 725 MB budget.On the Intel adapter that budget is Windows host RAM, so that log says nothing about the 8 GB card. The same build was then run with an explicit per-exe high-performance preference applied before launch:
f4290x8007000ESo on this machine the
Close()OOM is adapter-dependent, and any report that mixes adapters will produce a false memory signal.Why it happens.
host.rs:602creates the device withD3D12CreateDevice(None), so adapter choice falls to Windows. On a hybrid laptop a new exe (new path, no preference key) is created on the iGPU, and it then dies there withE_OUTOFMEMORYon perfectly ordinary textures. The test runner now forcesGpuPreference=2for every exe it launches; that is a workaround for the measurement, not a fix for the host.Two things that would make reports comparable across machines: log the chosen adapter and its
wave lanes/budget at device creation, and log the adapter the pipeline cache blob was written on (a blob from another adapter is rejected with0x887E0001).Next here: a 600 s run on the dGPU, then
VICTORY_CARD_ROOM_FOR_BUFFERS=0against the reference (it looks likeshadow.rs:196already defaults it to 1, while the README says off), then naming the allocation that actually breaks before changing any policy.@Logan-Gaillard on GitHub · 2026-11-25 10:33 UTC · original
Thanks — noted that #1296 (
814c580,a6f3ccb) landedbest_adapter()plus the live LUID check, so the adapter half of this issue is covered upstream and we will not re-implement it here. One independent confirmation for the LUID point, since it is the part that is easy to get wrong:On our hybrid laptop (RTX 5070 Laptop 8 GB + Intel iGPU), an exe with no per-exe GPU preference was created on the Intel adapter, and the "card budget" it reported was Windows RAM — 12 912 MB then 11 725 MB, 0 MB shared, wave lanes 8–32 (the same build reports 32–32 and 7 122 MB on the dGPU). That is why an
E_OUTOFMEMORYthere looked like a VRAM failure for a day. Thehost adapter adapter=Intel(R) Graphicsline is exactly the signal that was missing from the log.On the memory side we are now measuring the right quantity: on
fxceless/victory-forkat9376fd6, a 600 s run holds with a 13.5 GB working set, the world drawn and ~470 MB of commit left at the worst point, while VRAM stays flat at 7.2 GB.VICTORY_LEVELS_ON_DEMAND=1on a 300 s A/B only moved VRAM by 0.5 GB and left the private bytes unchanged, so on this title the question is closer to "what is never released" than "what is not dropped". That is what we are chasing next, with a diagnostics build that reports the memory map per phase.