d3d12: XMemVirtualAlloc refused (~185 MB) then 0x80000003 on a PC with 31 GB of RAM #3337
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?
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T14:20:54Z.
What happens
A player with an RX 7800 XT and 31 GB of RAM (commit limit 91 GB), Series S, no frame generation,
-Log: the newest play log ends with anXMemVirtualAlloc refusedwarning for about 185 MB ("not enough memory resources"), followed byunhandled exception 0x80000003. Another player stopped with code 2147483651 (also0x80000003) the same day, without a log.Why it matters
With that much RAM and commit room, the refusal is more likely an address range already taken than memory running out. #3154 (reserving the title's address range) may cover it; not checked.
Needs
The full play log of an affected run (local), and a check of which range the refused allocation asked for.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T14:24:57Z.
Code reading at main
9039f6a31(no run):d3d12/crates/leonida-hle/src/modules/xmem.rs~266, only for a reserve (a refused commit goes tocommit_refusedinstead). The host call isVirtualAlloc2with address bounds fromaddress_range(~93-100): [0, 4 GiB) when the title asks for a 32-bit address, [4 GiB, 2^40) otherwise.ERROR_NOT_ENOUGH_MEMORY: for a bounded reserve that means no free range of that size in the bounds, not RAM or commit running out.DebugBreakis inleonida-loader/src/thunks.rsfor unimplemented imports, and logs it first). Most likely the title's own assert on the null return.To confirm: the full
XMemVirtualAlloc refusedline (kind=andflags=values) and theunhandled exception 0x80000003 at ...line of the same log. If the 32-bit flag (0x4) is set, a fix would be to also hold the free parts of the low 4 GiB at startup, before the driver loads, next to #3154's range; and the warning should log the bounds and the largest free block. AI-assisted (Claude Code).Imported from ubiquitarianism/leonida. Originally posted by azsekazvamdimitar on 2026-12-03T15:58:28Z.
A related case on Linux, with no
XMemVirtualAlloc refusedline, so not the same failure. It points at the same thing as the code reading above: the title's address range, not memory.Setup:
leonida.exebuilt ata5ea251f9(PR #3316 head, on maind9b618f101), Wine 11.0 Staging (GE-Proton) with DXVK dxgi and VKD3D-Proton 3.1, RTX 3090 24 GB, 61 GB RAM, Series S, fresh data and cache folders, no gta6rt settings in the environment. Two runs, one with #3316'splay-linux.shand one with main's, gave the same result.At start-up the held range is in 124 pieces:
The 16 GiB pair and the 1.3 GB block then don't fit in any piece, so they go to the host and land above 2^37:
The 185 MB
flags 0x7request from this issue was placed:protection 0x1, kind 0x42000, flags 0x7: 1 times, 185 MB, last 0x9470000+0xb900000. About 15 s later (15:19:06 to 15:19:21), at title frame 82 on the loading screen (still at 60 fps), both runs stop with:That is the same image offset as #3020 (Windows). There the fix was a fresh data folder; here the folders were fresh.
Reading: under Wine the held range is split into many pieces, so allocations of 16 GiB or more cannot be placed in it. Whether placement above 2^37, or the title's own check on the result, raises the 0x80000003 is not established. I have not run a Windows log beside it. The full local logs are available, and I can check a fix on this machine.
Data from a Linux run. AI-assisted (Claude Opus 5.5).