My fixes. From crash to black screen to working game. 16 GB RAM and 7900XT, Nobara #196

Open
opened 2026-12-02 14:36:42 +00:00 by github-bot · 5 comments
Owner

@⁠Finalizator on GitHub · 2026-12-02 14:35 UTC · original

Part 1

./run.sh play: black window, the whole desktop at ~0.1 fps, then the title's own fatal

Status (read this first)

Solved, on 2026-12-02, on a 16 GiB / RX 7900 XT machine. ./run.sh play CONSOLE=series-s
reaches the 3D world and runs there: 4,096+ frames, 4.8 M draws, no host GPU failure, no
exception (Update 16). Four separate causes were behind the three symptoms, and each is
fixed in the tree:

symptom cause fix where
desktop at 0.1 fps, run squeezed into 2 GiB run.sh's flat KEEP_FREE=8192 and a silent 2048 MiB floor keep a quarter of RAM (≤8 GiB), print it, raise swap when short Summary, item 1
black window, then a lost device at ~60 s the title pins ~7.8 GB of host-visible memory; the GART aperture (7,948 MB = ttm.pages_limit × 4 KiB) refused a command submission at ~130 MB MemAvailable → 0x887A0005 raise the aperture on the kernel command line: amdgpu.gttsize=12288 ttm.pages_limit=3145728 (Update 15), plus a modest kernel reserve Updates 11, 14, 15
the title's own int3 on Series S (+0x2219650) at 2560x1440 it fills the 1277 MB layout the profile leaves it to 99.96 % Series S defaults to VICTORY_OUTPUT=1920x1080 Update 10
3D world black, HUD and menus fine Series S makes the title pick AMD FidelityFX's console upscaler (kind 7), which draws nothing here Series S defaults VICTORY_UPSCALER=6 (the title's own) Update 13

Still open, and not blockers: Series X still dies at +0x2215c35 (its 2199 MB pool,
untouched by any of the above), the shader containers that do not translate are harmless,
and the run needs a click at the menu (AUTO_PRESS=1, Update 15).

Four more commits of the same story, each in the report: setup.sh needing libdrm and
friends on a fresh machine (BUGREPORT.md), the shader containers that do not translate
(harmless), the instrumentation all of this was measured with, and the memory findings on
your machine (NOTES-memory-zram.md).

The rest of this file is the investigation in the order it happened, including the
directions that turned out to be wrong (Update 12 is withdrawn at its heading and corrected
by Update 14) and every measurement that ruled them out.

Summary

./run.sh play opens a black window and makes the entire desktop unusable
until the process dies. Three separate things are visible in one run, and only
the first is ours:

  1. run.sh squeezed the run into a 2 GiB cgroup. On a 16 GiB machine with a
    browser open, MemAvailable is around 9 GiB; the flat KEEP_FREE=8192
    reserve left ~800 MiB, and play then raised the cap to a 2048 MiB floor
    without a word. Every page the title touched forced reclaim, so the whole
    machine swapped and the compositor stalled — that is the 0.1 fps.
  2. The title's own memory need (~12 GiB before its first frame, 6236 MiB of it
    the tile heap) does not fit a 16 GiB machine that is already running a
    desktop, whichever cap is used. It ends in the title's deliberate
    null-write trap (mov dword ptr [0], 0 + int3), which Victory only
    reports, right after the kernel says
    amdgpu 0000:2b:00.0: [drm] *ERROR* amdgpu_vm_validate() failed.
  3. The shader precompile messages (195 do not translate) are unrelated and
    harmless: those containers hold hull/domain/geometry programs only, and no
    pipeline the title creates needs them.

Environment

Distro Nobara 44 (Fedora 44 base), kernel 7.3.6-200.nobara.fc44
CPU / RAM Ryzen (32 threads), 16 GiB total, 8 GiB zram + 17 GiB disk swap
GPU AMD Radeon RX 7900 XT, 20 GiB, resizable BAR on
Runtime Proton Experimental, Mesa 26.3.1 (RADV, built by setup.sh), vkd3d-proton 3.2.0
Desktop KDE Plasma (Wayland) with Firefox and VS Code open: ~6 GiB in use

What the run looked like

$ ./run.sh play
... 2743 pipelines made in 296 s ...
console        Xbox Series X
2026-12-01T14:28:21.212312Z  INFO victory_hle::modules::xmem: XMemAllocatePhysicalPages mb=710 flags=0x280
2026-12-01T14:28:21.817754Z  INFO victory_hle::modules::xmem: XMemAllocatePhysicalPages mb=185 flags=0x280
2026-12-01T14:28:24.000959Z  INFO victory_hle::modules::xmem: XMemAllocatePhysicalPages mb=6236 flags=0x380
2026-12-01T14:28:24.988891Z  INFO victory_gpu::um::lazy: lazy pages: a pool's window touched whole, ahead of its first use id=15 mb=6236 ms=445
VIctory: first-chance exception 0xc0000005 at victory-image-b99f876b74d4a77f.dll+0x2215c35 (write 0x0: nothing mapped there)
  rax 0x6ffff2784380 rbx 0x0 rcx 0x4189374bc6a7f0 rdx 0x4f01510b5 rsi 0x30dfec8 rdi 0x316039e871 rsp 0x30dfea0 rbp 0x0
  r8 0x7f7399e9d0e8 r9 0x7f7399e9d128 r10 0x1dde4e0 r11 0x202 r12 0x0 r13 0x0 r14 0x6ffffff61600 r15 0x0
  #0  victory-image-b99f876b74d4a77f.dll+0x2215c35
  #1  victory-image-b99f876b74d4a77f.dll+0x2215eca
  #2  kernel32.dll+0x11719
  #3  ntdll.dll+0x10e0f

While that was happening, the desktop logged this every couple of seconds:

kwin_wayland[3931]: The main thread was hanging temporarily!

and the cgroup told the rest of the story:

/sys/fs/cgroup/.../um-play-432542.scope
max=2147483648            # 2 GiB
cur=2147319808            # pinned at the ceiling
swap=1393496064           # and climbing

Root cause 1: the memory cap (ours, fixed)

run.sh before the fix:

avail=$(awk '/MemAvailable/{print int($2/1024)}' /proc/meminfo)
...
cap=$((avail-${KEEP_FREE:-8192}))
if (( cap < 2048 )); then
  if [ "$mode" != play ]; then echo "not enough free memory: $avail MiB available"; exit 1; fi
  cap=2048
fi

KEEP_FREE=8192 is right for a 32 GiB machine (what the README describes:
32 GB, RX 9070 XT). On this 16 GiB machine MemAvailable was ~9 GiB, so the
computed cap was ~800 MiB; play then took the 2048 MiB floor silently. A run
that commits ~12 GiB inside 2 GiB does not fail fast — it swaps on every page,
which is exactly the "whole system at 0.1 fps". ./run.sh shaders was not even
allowed to start: not enough free memory: 9495 MiB available.

The same arithmetic also hid the real problem from the user: nothing said that
the title was given 2 GiB while it needed 12.

Root cause 2: the title aborts (the title's, not ours)

...dll+0x2215c35 is c7 04 25 00 00 00 00 00 00 00 00 — mov dword ptr [0], 0
— followed by int3. It sits at the end of a routine that

  • samples QueryPerformanceCounter through the import at 0x146793550,
  • walks 64 tables of recorded samples (0x146844a20, 0x48 bytes apart),
  • and, when a measured duration reaches 300 (the float at 0x146159e20),
    calls the "fatal" callback the title installed earlier (a bare ret at
    image+0x380, registered through 0x1422161f0), then writes to address 0.

In other words, this is the title's own "I cannot continue" path — the same
shape as __debugbreak/__fastfail in any Xbox title. Victory's crash handler
reports it correctly; nothing in Victory raises it.

What the machine looked like at the same moment (kernel log):

[16:29:28] amdgpu 0000:2b:00.0: [drm] *ERROR* amdgpu_vm_validate() failed.
[16:32:21] amdgpu 0000:2b:00.0: VM memory stats for proc main(428227) task page residency(427611) is non-zero when fini

and, minutes later, a global OOM (constraint=CONSTRAINT_NONE, global_oom)
whose Mem-Info shows where the memory went:

Node 0 ... shmem:7032432kB ... gpu_active:7030876kB

6.7 GiB of shared memory — the 6236 MiB tile heap — on a 16 GiB machine that
already had ~6 GiB of desktop. The title's own crash context agrees:
TileHeap: used (0Mb) - total (6236Mb), memory.load_percent: 82,
system.memory.free: 2841948.

So the abort is the title giving up because its memory is not there, on a
machine that cannot provide it. Reproduced with a 13 GiB cap as well
(KEEP_FREE=0), so it is a capacity problem, not only the 2 GiB cgroup.

The Series S profile fails differently (tracked separately)

./run.sh play CONSOLE=series-s (an 8 GiB console) does not reach the tile
heap; it stops earlier with a breakpoint instead:

VIctory: unhandled exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x56a2afd
  rax 0x126a10000 rbx 0x698 rcx 0x1275d0000 rdx 0x1266d0000 rsi 0x30808000 rdi 0xf00000 r15 0x80070057
  #0  victory-image-...dll+0x56a2afd
  #1  victory-image-...dll+0x4deb4ef
  #2  victory.exe+0x57285a     XMemAlloc (crates/victory-hle/src/modules/xmem.rs:404)
  #3  victory.exe+0x4a29d9     victory_gpu::resource::Memory::for_resource (resource.rs:999)
  #4  victory.exe+0x4a2e35     victory_gpu::resource::create_committed (resource.rs:3149)

r15 = 0x80070057 is E_INVALIDARG, rdi = 0xf00000 a 15 MiB request, and
rsi = 0x30808000 the attribute word resource_attributes builds (allocator
128, 2 MiB pages, 64 KiB alignment, memory type 1). The title's own allocator —
__XMemAllocationHooks__[0] — asserts on that request. resource_attributes
is marked in the source as a guess ("the console runtime's own choice of page
size and memory type is not known; this is the plausible one"), so this is
where to look next; it is now logged with the exact size and attributes handed
to the title's allocator (debug level, which a plain release build caps at
info: PROFILE=diag ./build.sh then
./run.sh play CONSOLE=series-s VICTORY_LOG=victory_gpu::resource=debug).

Root cause 3: the shader "errors" (cosmetic, message improved)

./run.sh shaders ended with

25694 shaders in the cache, 195 do not translate, 78 s
    195  converter shader.dxil v1: a container without a vertex, pixel, compute or mesh program is not supported

All 195 are one thing: containers whose programs are hull, domain or geometry
ones. The play run confirms they are not needed — 2743 of 2743 native pipelines on disk (0 skipped as bad/hung, 0 refused by the host) and
2743 made in 296 s (0 have no host pipeline, ...). They are unrelated to the
black window.

The message now names the reason, and the summary says what the number means:

    195  converter shader.dxil v1: GFX10 code at 0x0: a container whose programs are all hull, domain or geometry ones is not supported  (e.g. d82a0a5a22471c77)
skipped containers are not needed by any pipeline the title creates (a run says so if one is: "have no host pipeline")

Fix

run.sh now

  • keeps a quarter of the machine, at most 8 GiB for the desktop
    (KEEP_FREE overrides), instead of a flat 8 GiB, so a 16 GiB machine is not
    left with 800 MiB;

  • prints the cap every time, with the numbers behind it:

    memory: 7267 MiB for the play run (11241 MiB free, 3974 MiB kept for the desktop, 16G of swap)
    
  • for play, when the cap is below the ~12 GiB the title commits, says so and
    raises the swap allowance to 16 GiB (MEM_SWAP_MAX overrides) instead of
    pretending the run fits:

    memory: 7267 MiB for the title, which commits about 12 GiB before its first frame
    memory: it will swap, and the desktop with it: close other programs for a smooth run
    
  • no longer refuses shaders/warm because of a reserve it cannot meet on a
    small machine (that check now matches the 2048 MiB it actually enforces).

Other changes:

  • crates/victory-shader/src/emit/mod.rs: the "no program" message now tells
    apart a container with no program at all from one whose programs are all
    hull/domain/geometry, which is what the 195 actually are.
  • apps/victory/src/translate.rs: the precompile summary says what the skipped
    containers mean (they are not needed; a run reports it otherwise).
  • crates/victory-gpu/src/resource.rs: the request handed to the title's
    allocator is logged (debug level, so a diagnostics build shows it), which is
    what the Series S assert needs.
  • README.md: the memory the title commits, and the two knobs.

What to do on a 16 GiB machine

  • Close the desktop's memory hogs first (browser, IDE): the title wants ~12 GiB
    before its first frame, on top of whatever the session holds.
  • Watch the memory: lines run.sh prints. They now say whether the run fits.
  • Expect swap: this profile is the "32 GB" one from the README's status line.
  • CONSOLE=series-s is the smaller profile, but currently stops in the title's
    allocator assert described above — that one is a real bug to fix, not a
    memory problem.

Verification

$ ./run.sh shaders --list Z:\...\shader-failures.txt
memory: 6967 MiB for the shaders run (10941 MiB free, 3974 MiB kept for the desktop, 2G of swap)
...
25694 shaders in the cache, 195 do not translate, 78 s
    195  converter shader.dxil v1: GFX10 code at 0x0: a container whose programs are all hull, domain or geometry ones is not supported  (e.g. d82a0a5a22471c77)
skipped containers are not needed by any pipeline the title creates (a run says so if one is: "have no host pipeline")

./run.sh shaders used to refuse to start on this machine ("not enough free
memory: 9495 MiB available") and now runs.

$ ./run.sh play
memory: 7314 MiB for the title, which commits about 12 GiB before its first frame
memory: it will swap, and the desktop with it: close other programs for a smooth run
memory: 7314 MiB for the play run (11288 MiB free, 3974 MiB kept for the desktop, 16G of swap)
/sys/fs/cgroup/.../um-play-444064.scope
max=7669284864            # 7314 MiB, from the numbers above (was 2147483648)

The title still reaches the same abort at the tile heap (that is point 2 above,
not the cap), but the machine no longer goes down with it: the kernel log has
no Out of memory and no amdgpu_vm_validate() failed for this run, and the
compositor's "main thread was hanging temporarily" lines — continuous for the
whole earlier run — are limited to the ~20 s around the 6236 MiB commit.


Update, same day: what actually stops the launch

Everything below is measured on the same machine, with the pipeline cache
warm (54958 pipelines on disk), 11 GiB of RAM free and the desktop using
2.1 GiB — so none of it is a memory-capacity problem.

A. A real bug found and fixed: the title's 2 MiB-page arena

CONSOLE=series-s never reached the tile heap; it died 4 s in with

VIctory: unhandled exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x56a2afd
  rax 0x126a10000 rbx 0x698 rcx 0x1275d0000 rdx 0x1266d0000 rsi 0x30808000 rdi 0xf00000 r15 0x80070057
  #2 victory.exe+0x57285a     XMemAlloc (xmem.rs:404)
  #3 victory.exe+0x4a29d9     victory_gpu::resource::Memory::for_resource (resource.rs:999)
  #4 victory.exe+0x4a2e35     victory_gpu::resource::create_committed (resource.rs:3149)

0x80000003 is a breakpoint: the title's own allocator asserted. Its page-size
dispatch is at title+0x56a2a60:

56a2a66  movl %edx,%eax
56a2a68  andl $0xc000,%eax          ; attributes bits 14-15 = page size
56a2a6d  cmpl $0x8000,%eax          ; 2 MiB pages?
56a2a72  je   0x56a2a8b             ; -> the 2 MiB arena
...
56a2ade  addq $0xffff,%rcx
56a2ae1  andq $-0x10000,%rcx        ; round the request up to 64 KiB
56a2ae8  addq %rdx,%rcx             ; request end
56a2aeb  cmpq %rax,%rcx
56a2aee  ja   0x56a2afd             ; request > block end -> int3

From the registers at the int3: the block was 0x1266d0000..0x126a10000
(3.25 MiB) and the request was 0xf00000 (15 MiB) — for a 15 MiB
committed resource we asked for 2 MiB pages, and the title's 2 MiB arena cannot
serve that.

resource_attributes (resource.rs) chose 2 MiB pages for any size ≥ 2 MiB.
Fixed: 2 MiB pages only for memory that is whole 2 MiB pages and asks for
2 MiB alignment; everything else takes 64 KiB pages (the other branch of the
same dispatch). With that fix Series S gets all the way past the tile heap into
pipeline creation — the next assert it hits is a different one, see C.

B. VICTORY_HANG_WATCHDOG (new, opt-in): the title's stall deadline

title+0x2215c35 — the trap that ends every Series X run — is reached from
title+0x2215a60, a thread that samples QueryPerformanceCounter in 64 tables
and, for a sample older than the deadline, calls the fatal handler the title
registered (title+0x1422161f0) and then executes mov dword [0], 0 + int3:

2215ae2  vmovss 0x3f44336(%rip),%xmm7   # 0x6159e20: 300.0
...
2215bc2  vmulss 0x7c399f6(%rip),%xmm0   # * (1/45)
2215bd8  vucomiss %xmm7,%xmm8
2215bdc  jae  0x2215c0c                 # over the deadline -> fatal

The new loader module crates/victory-loader/src/hang_watchdog.rs can replace
that constant (VICTORY_HANG_WATCHDOG=<units>, title = leave it alone; the
default is the title's own). It is not a fix for the crash: the same trap
still fires with the deadline raised — the trigger is not simply "a step took
long".

C. The trigger: page migration (VICTORY_PAGES)

Two runs with page migration off passed the trap:

$ ./run.sh play VICTORY_PAGES=0
...
unified memory: VICTORY_PAGES=0, each pool stays where it starts
lazy pages: a pool's window touched whole, ahead of its first use id=15 mb=6236 ms=411
title memory asked for as protection 0x2004 ... 6236 MB
lazy page binding runs pages=106448 runs=64
pipeline workers workers=16
host pipeline shaders=[compute 6ab847c8ba379833]
...            <- no 0x2215c35, ran for two hours until stopped by hand

So the fatal is tied to moving 64 KiB pages of title memory between the PC's
memory and the card (um::pages_move / residency), not to the memory cap and
not to the tile-heap commit itself.

Off, the next failure is the host GPU:

err:vkd3d-proton:vkd3d_wait_for_gpu_timeline_semaphore: Failed to wait for Vulkan timeline semaphore, vr -4.
ERROR victory_gpu::host: host GPU device removed after 1 submissions sent ahead of 1 lists; device removed: 0x887A0005

0x887A0005 is DXGI_ERROR_DEVICE_REMOVED, -4 is VK_ERROR_DEVICE_LOST:
the card's context dies on the first submission when the 6 GiB of title memory
is not migrated. That is the next thing to fix, and it is in the opposite
direction from the first one — the two need to be looked at together (what the
patched RADV maps when a page has never moved, versus what the title's
watchdog sees when it does).

D. What is not the problem

  • Memory: reproduced with 11 GiB free and the desktop at 2.1 GiB; the cap was
    7314 MiB and the cgroup never hit it.
  • The shader precompile ("195 do not translate"): all hull/domain/geometry-only
    containers, 0 have no host pipeline in the run.
  • run.sh's cap arithmetic: fixed (quarter of the machine kept, not a flat
    8 GiB, and it now prints what it sets), but it was masking, not causing.

Update 2: Series S — the game boots, renders, then one assert stops it

Measured with the fixes of section A (2 MiB-page gating), release build,
./run.sh play CONSOLE=series-s, 11 GiB free.

It runs

XMemAllocatePhysicalPages mb=220 / 297 / 185 / 3977
lazy pages: a pool's window touched whole, ahead of its first use id=19 mb=3977 ms=284
frame presented ... frame=256 draws=128 drawn=128 dispatches=51 dispatched=51
shaders from the cache and translated so far hits=2551 misses=0
unified memory: 6346 MB in RAM, 1501 MB in VRAM in 24 pools shown at 211 places

The title presents frames (~4 s worth, 256+ frames, real draws and
dispatches) and then stops itself at title+0x2219650 with
0x80000003 (breakpoint — a title assert, not a fault of ours):

rax 0x66ad rbx 0x6ffff9902808 rcx 0x6ffff99038b0 rdx 0x200000 rsi 0x10000
rdi 0x200000 r8 0x10000 r9 0xffffffff00000000 r10 0xffffffffffff0000 r11 0x200000
#0 victory-image-...dll+0x2219650
#1 victory-image-...dll+0x4fac413
#2 victory-image-...dll+0x193e248      (the device thunk of create_committed3)
#3 victory-image-...dll+0x34c001
#4 victory-image-...dll+0x236e309

What the assert is (disassembly)

title+0x4fac3c0 is a small guard run for one resource operation:

4fac3c9  mov %r8,%rsi          ; rsi = 0x10000
4fac3cc  mov %rdx,%rdi         ; rdi = 0x200000
4fac3cf  mov %rcx,%rbx         ; rbx = the object
4fac3d2  call 0x140104070      ; if (rdx == 0) 0; else (*(*rcx))(rcx, rdx)  -> vtable method 0
4fac3d7  test %rax,%rax
4fac3dd  test %rdi,%rdi
4fac3e5  je    return          ; found, or nothing asked -> fine
4fac3f1  movb 0x18(%rbx),%cl
4fac3f7  call 0x140005970      ; returns (byte18 & 1)
4fac3fe  test %cl,%cl
4fac403  je    return          ; not a "must exist" object -> fine
4fac40e  call 0x142219620      ; report(object, 0x200000, 0x10000) -> int3 if it returns

So: the title asked an object (*(rbx), a title-side vtable) for something of
size 0x200000 (2 MiB, alignment 0x10000), got nothing back, and treated
that as fatal. The report arguments are exactly the size/alignment of a 2 MiB
heap
, which is the block the title's own allocator hands out and then checks
(it is the same "the title places its back buffers in a block of its own and
checks they fill it" path use_allocator documents).

Ruled out by experiment:

  • Our allocator refused nothing. A warning was added where
    Memory::for_resource gets a null back from the title's allocator
    (resource.rs, "the title's allocator gave nothing back"); Series S reaches
    the assert with zero such lines, so the memory we asked for was granted.
  • Not memory pressure: the run reports 6346 MB in RAM, 1501 MB in VRAM in 24 pools ... on the card 23 (0 refused), with 11 GiB free.
  • Not the FidelityFX upscaler: the first LoadLibrary of
    amd_fidelityfx_upscaler_xbox.dll is a GetModuleHandle probe and is
    refused (correctly), then the title loads it and we map it:
    title dll amd_fidelityfx_upscaler_xbox.dll at 0x6ffff17f0000 (loaded by the title), bound ...: 7 hle, 79 host, 0 title, 0 missing.
  • Not heap memory provenance: routing CreateHeap memory through the
    title's allocator instead of ours was tried and changed nothing (reverted).

What is left, and where to look next: the object's vtable method 0 returning
null for a 2 MiB request. It is a title-side allocator interface, so either the
title's own pool for these blocks is smaller than the console's (a Series S
budget it computes from what it thinks it has), or an interface we hand it as
that object answers "no room". The next step is to log the object's vtable
pointer and compare it against the ones the title installs at startup, and to
log every CreateHeap/CreateCommittedResource size in the last second before
the assert.

Diagnostics added while digging (kept)

  • resource.rs: a warning when the title's allocator returns null, with the
    size, alignment and attribute word.
  • victory-loader/src/windows.rs: a debug line for every title DLL the loader
    does not map, with the path and whether the file exists
    (VICTORY_LOG=info,victory_loader::windows=debug).
  • VICTORY_HANG_WATCHDOG (loader module) — see section B; not a fix.

Series X, after the same fixes

Unchanged: 0x2215c35 right after the 6236 MiB pool with page migration on;
with VICTORY_PAGES=0 it passes that trap and then loses the GPU
(VK_ERROR_DEVICE_LOST, DXGI_ERROR_DEVICE_REMOVED 0x887A0005) on the first
submission. Series S does not hit either: its pools (3977 MiB) stay under
whatever the migration path trips on, which is more evidence that the Series X
trap is in the migration path and not in the memory size.


Update 3: the Series S assert, identified further

The crash report now names the object that answered "no" (victory-loader/src/crash.rs,
printed for every int3):

VIctory: first-chance exception 0x80000003 at victory-image-...dll+0x2219650
  object at rbx: copy-on-write, in victory-image-...dll+0x71c2808
                 (vtable 0x6ffff88a83a0, victory-image-...dll+0x61883a0), flag byte +0x18 0x1
  asked about 0x882000+0x10000: read-only; 0x10000: reserved, never committed

So:

  • The object is a static object of the title (+0x71c2808, i.e. an image address,
    not one of ours) whose vtable is at +0x61883a0.
  • Its flag byte +0x18 is 1, which is what makes the failed lookup fatal
    (4fac3f1: movb 0x18(%rbx),%cl → and al,1 → fatal only when set).
  • What it was asked about is an address and a length: 0x882000 and 0x10000
    (64 KiB). Read as a size, 0x10000 is a plausible 64 KiB; as an address it is
    VirtualQuery's "reserved, never committed", which is nonsense. It is the same
    shape as the earlier run's 0x200000 + 0x10000.
  • 0x882000 is mapped, read-only — a page of title memory, inside the title's
    first span (0x400000...), currently lazily mapped read-only as our design does
    until the page is touched.

Different workloads give different addresses, same size (0x10000): with
VICTORY_UPSCALER=6 (the title's own upscaler instead of the Xbox FidelityFX one)
the request was 0x882000+0x10000; with FidelityFX it was 0x200000+0x10000.
So the object is asked to confirm a 64 KiB page of title memory it has no
record of, and it is a must exist object.

The upscaler is not the cause

./run.sh play CONSOLE=series-s VICTORY_UPSCALER=6 (title's own upscaler) reaches
the same +0x2219650 assert, with a different address. And the Xbox upscaler does
load and bind:

title dll      amd_fidelityfx_upscaler_xbox.dll at 0x6ffff17f0000 (loaded by the title)
bound          amd_fidelityfx_upscaler_xbox.dll: 7 hle, 79 host, 0 title, 0 missing

The first refused dll="amd_fidelityfx_upscaler_xbox.dll" line is a
GetModuleHandle probe before the load, which correctly returns null.

Note on FSR 4 and RDNA 3: the Series S profile does not use FSR 4 at all — the
title's own FidelityFX upscaler comes from the game (amd_fidelityfx_upscaler_xbox.dll).
FSR 4 is only the PC path (VICTORY_FSR_4K, ./setup.sh fsr4,
amdxcffx64.dll from the driver and amd_fidelityfx_upscaler_dx12.dll from the
SDK), and FSR 4's FP8 path is RDNA 4 hardware; on RDNA 3 (RX 7900 XT) it is the
community FP16/INT8 fallback and is a separate, unrelated experiment.

Next step, concretely

The object's vtable is at title+0x61883a0; the lookup is its first virtual
method (this, address) -> record or null. Two things to do next:

  1. Disassemble the constructor that writes 0x61883a0 into an object to name it
    (a scan of .text for the immediate/lea of that vtable finds its class), then
    read the method to see what a "record" is keyed by (address range? physical
    page? pool?).
  2. Compare against victory_gpu::um::lazy's view of 0x882000: whether that page
    was ever BOUND, and by which of the title's calls. The gap between "the title
    thinks it has a 64 KiB page there" and "the page has no record" is the bug.

Until that is known, everything else about Series S is in place: it boots,
translates shaders, presents frames, and reports
unified memory: 6346 MB in RAM, 1501 MB in VRAM in 24 pools ... on the card 23 (0 refused).


Update 4: the guard is a real failure, not cosmetic

VICTORY_PAGE_CHECK=off (new, crates/victory-loader/src/page_check.rs) makes the
guard at title+0x4fac403 jump to its own "not found is fine" path
(one byte, 74 e2 → eb e2; the two paths already exist in the title's code).
Result, same call chain one frame later:

VIctory: first-chance exception 0x80000003 at victory-image-...dll+0x16473ef
  rax 0x1a8 rbx 0x0 rcx 0x0 rdx 0x22deea0 rsi 0x22deea0 rdi 0x0 ...
  #0 ...+0x16473ef
  #1 ...+0x236e363
  #2 ...+0x236ddfe
  #3 ...+0x1defebe

+0x16473ef is another int3 (assert) reached with rbx = 0 — the caller used
the record the guard would have refused to go without. So:

  • the missing record is real, not a bookkeeping nicety;
  • skipping the guard only moves the crash one step later, so the guard must be
    fixed at the source: the title has to find the 64 KiB page it asks about.

The switch is kept as a diagnostic (default: guard as the title has it) because it
names the dependency in one run; it is not a fix and must not be made the default.

Where that leaves Series S

boots, translates shaders, presents frames yes (256+ frames, 0 have no host pipeline)
unified memory, 24 pools, 6346 MB RAM + 1501 MB VRAM yes, 0 refused
stops at +0x2219650, a static title object (+0x71c2808, vtable +0x61283a0, flag +0x18=1) has no record of the 64 KiB page at 0x882000
next thing to establish which of the title's calls should have created that record — the page is inside its first memory span and mapped read-only by our lazy path

Concrete next probe: log XMemVirtualAlloc / XMemMapPhysicalPages /
XMemFreePhysicalPages at info for a run, and check whether 0x882000 was ever
mapped, freed, or never named by the title at all. If the title never named it,
the address comes from a structure we filled (a page-number table or a placed
resource's address) and that is where the wrong value is born.


Update 5: what the object is — and the clue from upstream #71

The object is a pool descriptor with a lookup table

VICTORY_UPSCALER=6 run, crash diagnostics:

object at rbx: ... in victory-image-...dll+0x71c2808 (vtable ...+0x61483a0), flag byte +0x18 0x1
asked about 0x882000+0x10000: read-only
object words: +0x0=vtable +0x8=0x6ffff9901560 +0x10=0x9612396b0 +0x18=0x1
              +0x20=0x98c000000 +0x28=0x6ffff99028b0 +0x30=0x4fd00000 +0x38=0x6ffff99028b0
vtable ... methods: [0] +0x221a620 [1] +0xbb7060 [2] +0x53ea000 [3] +0x4380

+0x20 and +0x30 are a base and a size: 0x98C000000 + 0x4FD00000 = 1.28 GiB, and the
resources the title creates just before the assert sit inside it
(resource at an address address=0x9dbb50000, =0x9dbc70000).

The method the guard calls is +0x221a620:

221a639  lock(table at +0x1471bfa88)
221a641  r8 = (arg2 != 0) ? arg2 : 0x10
221a644  rcx = this + 0x38                     ; a hash map inside the object
221a652  rdi = max(arg1, 1)
221a65d  call 0x1410ca6d0                       ; map.lookup(key=arg1, arg2)
221a662  rcx = [this+0x20]                      ; the pool's base
221a66b  rax == 0xFFFFFFFF ? null : base + rax  ; miss -> null

So the guard asks a pool "which block of yours is at 0x882000, 0x10000?" and the pool
answers "none". 0x882000 is outside that pool (0x98C000000..0x9DBD00000), so the answer is
"correct" — the caller is asking the wrong pool, or with the wrong key.

Two readings, both testable:

  1. The caller iterates its pools and the first one it asks is not the owner; the +0x18 flag
    ("ask again / must exist") turns the miss into a fatal instead of trying the next pool.
  2. 0x882000 is not an address there but an offset/page number that belongs to another pool.

Note the argument shape is identical across runs — (<address>, 0x10000) — and 0x10000 is
exactly 64 KiB, the console's page size, in every run so far.

Vtables are encrypted at rest

+0x61483a0 (and the neighbouring +0x61283a0) read as high-entropy bytes in the image on disk,
while +0x6159e20 (the 300.0 watchdog deadline) reads fine: the title keeps some pointer tables
encrypted until it maps them. That is why the vtable had to be captured at run time; the crash
report now prints vtable <addr> methods: [0] ... [3] ... for every breakpoint, which is how the
list above was obtained.

The upstream clue (lobomfz/VIctory-xmem#71)

That issue is an RDNA3 performance report (RX 7800 XT, 28.6 fps median), not a boot bug, but it
says two things that matter here:

  • VICTORY_UM_VRAM_MB exists upstream — a knob for how much of the card's memory title memory
    may take. This fork had it hardcoded: CARD_KEPT_FOR_HOST = 12 GiB, so a 20 GiB card gave the
    title only 8176 MB (card_mb_for_title=8176 in every log). Now implemented here
    (crates/victory-gpu/src/um.rs): VICTORY_UM_VRAM_MB=<MiB> caps the room, logging
    unified memory: VICTORY_UM_VRAM_MB sets the room for title memory asked_mb=... granted_mb=....
    Worth a run at VICTORY_UM_VRAM_MB=15000 on this machine (20 GiB card, 1.5 GiB in use by the
    desktop).
  • Their counters name the same texture symptom we see: 22212 uploaded from memory that read all zeros, 24315 waiting — memory that has no resident page reads as zeros; the page the Series S
    guard asks about is exactly such a page (mapped read-only, never written).

Their LATE_MOST 256→512 and CARD_KEPT_FOR_HOST 12→10 GiB experiments are performance-only
(no fps change, or "the room is never the limit, because only write-combined title memory goes to
the card").

Where this leaves the Series S bug

The failing lookup is pool.find(address, 64 KiB) on a pool that does not contain the address.
Next: at the assert, also print every pool descriptor the title knows (walk +0x28/+0x38 links)
with its base/size, so the report says which pool does contain 0x882000 — that names the owner
and closes the loop.

Tested: the VRAM budget is not the trigger

./run.sh play CONSOLE=series-s VICTORY_UM_VRAM_MB=15000
unified memory: VICTORY_UM_VRAM_MB sets the room for title memory asked_mb=15000 granted_mb=15000 reached_mb=20464
unified memory: title graphics memory is the card driver's own ... card_mb_for_title=15000   (was 8176)

Same assert, same arguments (0x200000 + 0x10000), same frame count. So the failing pool lookup
does not depend on how much of the card the title may use; the default stays as it is, and the knob
is there for the performance experiments #71 describes.


Update 6: searched, and three more hypotheses closed

The GDK API behind the object (internet, official and emulator sources)

Searching for the console API that has "mappings of 64 KiB pages" turned up two
professional references:

  • Microsoft's own GDK reference (microsoft/XBOX-Game-Development-Documentation,
    xgmemory_NR/interfaces/XGMemoryLayout): an XGMemoryLayout is a set of
    mappings of GPU pages, XGMemoryLayout::CreateMapping(name, alignment, size),
    MapFromPattern, GetPageSizeBytes — "this size is typically 64 KB, which can be
    verified via GetPageSizeBytes", alignment defaults to XG_GPU_PAGE_SIZE_BYTES.
    That is exactly the shape of the object we captured: a base (+0x20), a size
    (+0x30), and a hash map (+0x38) from a page/address key to a block offset.
  • ScikuVRC/xboxrecomp docs (original-Xbox emulator): console virtual
    addresses are mapped into the host process at their exact addresses because
    "Xbox games use hardcoded absolute addresses for all global variables", and
    VirtualAlloc-at-address fails for mirrored memory — the same class of problem
    the unified-memory layer solves here for the Series X|S address space.

The title does not import any XGMemoryLayout* symbol (checked the import table),
so this object is its own implementation of that model, filled by its own
XMem* calls — which is why nothing on our side gets to "register" a mapping in it.

Closed: the address is not one of our page numbers

XMemAllocatePhysicalPages now logs the page numbers it hands out
(debug level):

first_page=0x33500 pages=63632 frames_each=16

The whole page-number space used in a Series S run is roughly
0x33500 .. 0x130400. The guard asks about 0x200000 / 0x882000, both far
outside it, and VirtualQuery(0x882000) says the page is mapped read-only —
so it is a virtual address of title memory, not a page number. Page numbering
is not the bug.

Closed: page migration

./run.sh play CONSOLE=series-s VICTORY_PAGES=0 → the same assert at the same
place (0x200000 + 64 KiB, after 9 presented frames). Series S is not affected by
the migration path that kills Series X.

Summary of what is ruled out for the Series S assert

factor test result
FidelityFX vs the title's upscaler VICTORY_UPSCALER=6 same assert (address changes)
card room for title memory VICTORY_UM_VRAM_MB=15000 (was 8176) same assert
page migration VICTORY_PAGES=0 same assert
our allocator refusing new warning on null from the title's allocator never fires
memory pressure 11 GiB free, 0 refused pools not applicable
page numbering first_page/count logged address is not a page number
the guard itself VICTORY_PAGE_CHECK=off crash one step later on the null record

What remains: a virtual address the title presents to a pool that does not own it
(0x882000 / 0x200000, pool base 0x98C000000 + 1277 MiB). The helper that asks
(+0x4fac3c0) has ~180 call sites in the title — it is the generic "record for this
address" lookup used all over the resource code — so the wrong address is born in
whatever produced it, not in the lookup.

Note on the controller (from the reporter of this machine)

The "controller disconnected" screen is explained by the pad itself: it is
wireless and drops on inactivity. VICTORY_ONE_PAD=1 is still worth setting in
run.conf (it is the fix for the title withdrawing the keyboard/mouse stand-in pad
when a real one appears), but an idle wireless pad disappearing is the pad's
behaviour, not the emulator's.


Update 7: the guard is an allocation failure, and it is not ours

Disassembling the guard's caller chain changes the reading of the whole crash:

2474690  test %r8,%r8 ; je return            ; size 0 -> null
2474695  testb $1,%cl
247469a  addq $0x7f,%r8 ; andq $-0x80,%r8    ; size rounded up to 128
24746a7  cmpq $0x81,%r9 ; cmovbq %rax,%r9    ; alignment at least 128
24746b2  movq %r8,%rcx                       ; size
24746b5  cmpb $1,%dl
24746b8  ja   24746c5
...
24746d0  push rsi,rdi
24746d6  movq %rdx,%rsi                      ; the address/size asked about
24746d9  movq %rcx,%rdi
24746dc  xor ecx,ecx ; xor edx,edx
24746e0  call 0x144fc99c0                    ; <- the CURRENT memory layout (a global)
24746e5  movq %rax,%rcx                      ; this = layout
24746e8  movq %rdi,%rdx                      ; arg1
24746eb  movq %rsi,%r8                       ; arg2
24746f4  jmp  0x144fac3c0                    ; layout->vtable[0](this, arg1, arg2)

So the title asks its current memory layout for a block, and the layout answers "none".
0x200000/0x882000 are not a foreign address — they are the size of a block
(2 MiB, 8.5 MiB) and 0x10000 the 64 KiB alignment. The +0x18 flag makes that
failure fatal ("this allocation must not fail"), and it is fatal on Series S only
because that profile runs out of that layout, not because the lookup is wrong.

Which layout, and how full

title memory asked for as protection 0x2404, kind 0x203000, flags 0x283:
  1 times, 1277 MB, last 0x98bc00000+0x4fd00000

That is the layout: 1277 MiB at 0x98BC00000, whose usable base is the object's
+0x20 = 0x98C000000 (a 4 MiB header). The resources the title places sit inside
it (0x9dbb50000, 0x9dbc70000), so it is the graphics pool.

Not a leak on our side

Allocations that go through us (Memory::for_resource, i.e. the title's
__XMemAllocationHooks__[0]) are now counted:

resources: the title's allocator, blocks asked for so far allocs=16 held_mb=94 size=262144

16–31 blocks, 94 MB held, at the moment of the assert — with every block returned
on drop. The layout is 1277 MiB; we are not filling it. The title's own allocations
fill the rest, and its allocator then fails on the 2 MiB request.

Ruled out so far (all by experiment, one run each)

factor test result
FidelityFX vs the title's upscaler VICTORY_UPSCALER=6 same assert (size changes to 8.5 MiB)
card room for title memory VICTORY_UM_VRAM_MB=15000 same assert
page migration VICTORY_PAGES=0 same assert
our pages exhausted first_page counts: 0x33500..0x130400 address is a size, not a page number
our allocator refusing warning on null from the title's allocator never fires
our blocks filling the layout counters: 94 MB / 1277 MiB not it
the guard itself VICTORY_PAGE_CHECK=off next assert on the null block

Next step

Watch the layout while it fills: read the object at current_layout() (title
+0x4FC99C0), print its words every second, and see which field climbs to the
1277 MiB — +0x30 is the extent seen at the crash. If the layout's high-water mark
is its size, the question becomes what the title frees and we do not, and the same
readout says whether the free path is reached at all.


**@⁠Finalizator** on GitHub · 2026-12-02 14:35 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/196) Part 1 # `./run.sh play`: black window, the whole desktop at ~0.1 fps, then the title's own fatal ## Status (read this first) **Solved, on 2026-12-02, on a 16 GiB / RX 7900 XT machine.** `./run.sh play CONSOLE=series-s` reaches the 3D world and runs there: 4,096+ frames, 4.8 M draws, no host GPU failure, no exception (Update 16). Four separate causes were behind the three symptoms, and each is fixed in the tree: | symptom | cause | fix | where | |---|---|---|---| | desktop at 0.1 fps, run squeezed into 2 GiB | `run.sh`'s flat `KEEP_FREE=8192` and a silent 2048 MiB floor | keep a quarter of RAM (≤8 GiB), print it, raise swap when short | Summary, item 1 | | black window, then a lost device at ~60 s | the title pins ~7.8 GB of host-visible memory; the GART aperture (7,948 MB = `ttm.pages_limit` × 4 KiB) refused a command submission at ~130 MB `MemAvailable` → `0x887A0005` | raise the aperture on the kernel command line: `amdgpu.gttsize=12288 ttm.pages_limit=3145728` (Update 15), plus a modest kernel reserve | Updates 11, 14, 15 | | the title's own `int3` on Series S (`+0x2219650`) | at 2560x1440 it fills the 1277 MB layout the profile leaves it to 99.96 % | Series S defaults to `VICTORY_OUTPUT=1920x1080` | Update 10 | | **3D world black**, HUD and menus fine | Series S makes the title pick AMD FidelityFX's console upscaler (kind 7), which draws nothing here | Series S defaults `VICTORY_UPSCALER=6` (the title's own) | Update 13 | Still open, and not blockers: Series X still dies at `+0x2215c35` (its 2199 MB pool, untouched by any of the above), the shader containers that do not translate are harmless, and the run needs a click at the menu (`AUTO_PRESS=1`, Update 15). Four more commits of the same story, each in the report: `setup.sh` needing `libdrm` and friends on a fresh machine (`BUGREPORT.md`), the shader containers that do not translate (harmless), the instrumentation all of this was measured with, and the memory findings on your machine (`NOTES-memory-zram.md`). The rest of this file is the investigation in the order it happened, including the directions that turned out to be wrong (Update 12 is withdrawn at its heading and corrected by Update 14) and every measurement that ruled them out. ## Summary `./run.sh play` opens a black window and makes the entire desktop unusable until the process dies. Three separate things are visible in one run, and only the first is ours: 1. `run.sh` squeezed the run into a **2 GiB cgroup**. On a 16 GiB machine with a browser open, `MemAvailable` is around 9 GiB; the flat `KEEP_FREE=8192` reserve left ~800 MiB, and `play` then raised the cap to a 2048 MiB floor without a word. Every page the title touched forced reclaim, so the whole machine swapped and the compositor stalled — that is the 0.1 fps. 2. The title's own memory need (~12 GiB before its first frame, 6236 MiB of it the tile heap) does not fit a 16 GiB machine that is already running a desktop, whichever cap is used. It ends in the title's deliberate null-write trap (`mov dword ptr [0], 0` + `int3`), which Victory only reports, right after the kernel says `amdgpu 0000:2b:00.0: [drm] *ERROR* amdgpu_vm_validate() failed.` 3. The shader precompile messages (`195 do not translate`) are unrelated and harmless: those containers hold hull/domain/geometry programs only, and no pipeline the title creates needs them. ## Environment | | | |---|---| | Distro | Nobara 44 (Fedora 44 base), kernel 7.3.6-200.nobara.fc44 | | CPU / RAM | Ryzen (32 threads), **16 GiB** total, 8 GiB zram + 17 GiB disk swap | | GPU | AMD Radeon RX 7900 XT, 20 GiB, resizable BAR on | | Runtime | Proton Experimental, Mesa 26.3.1 (RADV, built by `setup.sh`), vkd3d-proton 3.2.0 | | Desktop | KDE Plasma (Wayland) with Firefox and VS Code open: ~6 GiB in use | ## What the run looked like ``` $ ./run.sh play ... 2743 pipelines made in 296 s ... console Xbox Series X 2026-12-01T14:28:21.212312Z INFO victory_hle::modules::xmem: XMemAllocatePhysicalPages mb=710 flags=0x280 2026-12-01T14:28:21.817754Z INFO victory_hle::modules::xmem: XMemAllocatePhysicalPages mb=185 flags=0x280 2026-12-01T14:28:24.000959Z INFO victory_hle::modules::xmem: XMemAllocatePhysicalPages mb=6236 flags=0x380 2026-12-01T14:28:24.988891Z INFO victory_gpu::um::lazy: lazy pages: a pool's window touched whole, ahead of its first use id=15 mb=6236 ms=445 VIctory: first-chance exception 0xc0000005 at victory-image-b99f876b74d4a77f.dll+0x2215c35 (write 0x0: nothing mapped there) rax 0x6ffff2784380 rbx 0x0 rcx 0x4189374bc6a7f0 rdx 0x4f01510b5 rsi 0x30dfec8 rdi 0x316039e871 rsp 0x30dfea0 rbp 0x0 r8 0x7f7399e9d0e8 r9 0x7f7399e9d128 r10 0x1dde4e0 r11 0x202 r12 0x0 r13 0x0 r14 0x6ffffff61600 r15 0x0 #0 victory-image-b99f876b74d4a77f.dll+0x2215c35 #1 victory-image-b99f876b74d4a77f.dll+0x2215eca #2 kernel32.dll+0x11719 #3 ntdll.dll+0x10e0f ``` While that was happening, the desktop logged this every couple of seconds: ``` kwin_wayland[3931]: The main thread was hanging temporarily! ``` and the cgroup told the rest of the story: ``` /sys/fs/cgroup/.../um-play-432542.scope max=2147483648 # 2 GiB cur=2147319808 # pinned at the ceiling swap=1393496064 # and climbing ``` ## Root cause 1: the memory cap (ours, fixed) `run.sh` before the fix: ```sh avail=$(awk '/MemAvailable/{print int($2/1024)}' /proc/meminfo) ... cap=$((avail-${KEEP_FREE:-8192})) if (( cap < 2048 )); then if [ "$mode" != play ]; then echo "not enough free memory: $avail MiB available"; exit 1; fi cap=2048 fi ``` `KEEP_FREE=8192` is right for a 32 GiB machine (what the README describes: 32 GB, RX 9070 XT). On this 16 GiB machine `MemAvailable` was ~9 GiB, so the computed cap was ~800 MiB; `play` then took the 2048 MiB floor silently. A run that commits ~12 GiB inside 2 GiB does not fail fast — it swaps on every page, which is exactly the "whole system at 0.1 fps". `./run.sh shaders` was not even allowed to start: `not enough free memory: 9495 MiB available`. The same arithmetic also hid the real problem from the user: nothing said that the title was given 2 GiB while it needed 12. ## Root cause 2: the title aborts (the title's, not ours) `...dll+0x2215c35` is `c7 04 25 00 00 00 00 00 00 00 00` — `mov dword ptr [0], 0` — followed by `int3`. It sits at the end of a routine that * samples `QueryPerformanceCounter` through the import at `0x146793550`, * walks 64 tables of recorded samples (`0x146844a20`, 0x48 bytes apart), * and, when a measured duration reaches 300 (the float at `0x146159e20`), calls the "fatal" callback the title installed earlier (a bare `ret` at image+0x380, registered through `0x1422161f0`), then writes to address 0. In other words, this is the title's own "I cannot continue" path — the same shape as `__debugbreak`/`__fastfail` in any Xbox title. Victory's crash handler reports it correctly; nothing in Victory raises it. What the machine looked like at the same moment (kernel log): ``` [16:29:28] amdgpu 0000:2b:00.0: [drm] *ERROR* amdgpu_vm_validate() failed. [16:32:21] amdgpu 0000:2b:00.0: VM memory stats for proc main(428227) task page residency(427611) is non-zero when fini ``` and, minutes later, a global OOM (`constraint=CONSTRAINT_NONE`, `global_oom`) whose `Mem-Info` shows where the memory went: ``` Node 0 ... shmem:7032432kB ... gpu_active:7030876kB ``` 6.7 GiB of shared memory — the 6236 MiB tile heap — on a 16 GiB machine that already had ~6 GiB of desktop. The title's own crash context agrees: `TileHeap: used (0Mb) - total (6236Mb)`, `memory.load_percent: 82`, `system.memory.free: 2841948`. So the abort is the title giving up because its memory is not there, on a machine that cannot provide it. Reproduced with a 13 GiB cap as well (`KEEP_FREE=0`), so it is a capacity problem, not only the 2 GiB cgroup. ### The Series S profile fails differently (tracked separately) `./run.sh play CONSOLE=series-s` (an 8 GiB console) does not reach the tile heap; it stops earlier with a breakpoint instead: ``` VIctory: unhandled exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x56a2afd rax 0x126a10000 rbx 0x698 rcx 0x1275d0000 rdx 0x1266d0000 rsi 0x30808000 rdi 0xf00000 r15 0x80070057 #0 victory-image-...dll+0x56a2afd #1 victory-image-...dll+0x4deb4ef #2 victory.exe+0x57285a XMemAlloc (crates/victory-hle/src/modules/xmem.rs:404) #3 victory.exe+0x4a29d9 victory_gpu::resource::Memory::for_resource (resource.rs:999) #4 victory.exe+0x4a2e35 victory_gpu::resource::create_committed (resource.rs:3149) ``` `r15 = 0x80070057` is `E_INVALIDARG`, `rdi = 0xf00000` a 15 MiB request, and `rsi = 0x30808000` the attribute word `resource_attributes` builds (allocator 128, 2 MiB pages, 64 KiB alignment, memory type 1). The title's own allocator — `__XMemAllocationHooks__[0]` — asserts on that request. `resource_attributes` is marked in the source as a guess ("the console runtime's own choice of page size and memory type is not known; this is the plausible one"), so this is where to look next; it is now logged with the exact size and attributes handed to the title's allocator (debug level, which a plain release build caps at info: `PROFILE=diag ./build.sh` then `./run.sh play CONSOLE=series-s VICTORY_LOG=victory_gpu::resource=debug`). ## Root cause 3: the shader "errors" (cosmetic, message improved) `./run.sh shaders` ended with ``` 25694 shaders in the cache, 195 do not translate, 78 s 195 converter shader.dxil v1: a container without a vertex, pixel, compute or mesh program is not supported ``` All 195 are one thing: containers whose programs are hull, domain or geometry ones. The play run confirms they are not needed — `2743 of 2743 native pipelines on disk (0 skipped as bad/hung, 0 refused by the host)` and `2743 made in 296 s (0 have no host pipeline, ...)`. They are unrelated to the black window. The message now names the reason, and the summary says what the number means: ``` 195 converter shader.dxil v1: GFX10 code at 0x0: a container whose programs are all hull, domain or geometry ones is not supported (e.g. d82a0a5a22471c77) skipped containers are not needed by any pipeline the title creates (a run says so if one is: "have no host pipeline") ``` ## Fix `run.sh` now * keeps **a quarter of the machine, at most 8 GiB** for the desktop (`KEEP_FREE` overrides), instead of a flat 8 GiB, so a 16 GiB machine is not left with 800 MiB; * prints the cap every time, with the numbers behind it: ``` memory: 7267 MiB for the play run (11241 MiB free, 3974 MiB kept for the desktop, 16G of swap) ``` * for `play`, when the cap is below the ~12 GiB the title commits, says so and raises the swap allowance to 16 GiB (`MEM_SWAP_MAX` overrides) instead of pretending the run fits: ``` memory: 7267 MiB for the title, which commits about 12 GiB before its first frame memory: it will swap, and the desktop with it: close other programs for a smooth run ``` * no longer refuses `shaders`/`warm` because of a reserve it cannot meet on a small machine (that check now matches the 2048 MiB it actually enforces). Other changes: * `crates/victory-shader/src/emit/mod.rs`: the "no program" message now tells apart a container with no program at all from one whose programs are all hull/domain/geometry, which is what the 195 actually are. * `apps/victory/src/translate.rs`: the precompile summary says what the skipped containers mean (they are not needed; a run reports it otherwise). * `crates/victory-gpu/src/resource.rs`: the request handed to the title's allocator is logged (debug level, so a diagnostics build shows it), which is what the Series S assert needs. * `README.md`: the memory the title commits, and the two knobs. ## What to do on a 16 GiB machine * Close the desktop's memory hogs first (browser, IDE): the title wants ~12 GiB before its first frame, on top of whatever the session holds. * Watch the `memory:` lines `run.sh` prints. They now say whether the run fits. * Expect swap: this profile is the "32 GB" one from the README's status line. * `CONSOLE=series-s` is the smaller profile, but currently stops in the title's allocator assert described above — that one is a real bug to fix, not a memory problem. ## Verification ``` $ ./run.sh shaders --list Z:\...\shader-failures.txt memory: 6967 MiB for the shaders run (10941 MiB free, 3974 MiB kept for the desktop, 2G of swap) ... 25694 shaders in the cache, 195 do not translate, 78 s 195 converter shader.dxil v1: GFX10 code at 0x0: a container whose programs are all hull, domain or geometry ones is not supported (e.g. d82a0a5a22471c77) skipped containers are not needed by any pipeline the title creates (a run says so if one is: "have no host pipeline") ``` `./run.sh shaders` used to refuse to start on this machine ("not enough free memory: 9495 MiB available") and now runs. ``` $ ./run.sh play memory: 7314 MiB for the title, which commits about 12 GiB before its first frame memory: it will swap, and the desktop with it: close other programs for a smooth run memory: 7314 MiB for the play run (11288 MiB free, 3974 MiB kept for the desktop, 16G of swap) ``` ``` /sys/fs/cgroup/.../um-play-444064.scope max=7669284864 # 7314 MiB, from the numbers above (was 2147483648) ``` The title still reaches the same abort at the tile heap (that is point 2 above, not the cap), but the machine no longer goes down with it: the kernel log has no `Out of memory` and no `amdgpu_vm_validate() failed` for this run, and the compositor's "main thread was hanging temporarily" lines — continuous for the whole earlier run — are limited to the ~20 s around the 6236 MiB commit. --- # Update, same day: what actually stops the launch Everything below is measured on the same machine, with the pipeline cache warm (54958 pipelines on disk), 11 GiB of RAM free and the desktop using 2.1 GiB — so **none of it is a memory-capacity problem**. ## A. A real bug found and fixed: the title's 2 MiB-page arena `CONSOLE=series-s` never reached the tile heap; it died 4 s in with ``` VIctory: unhandled exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x56a2afd rax 0x126a10000 rbx 0x698 rcx 0x1275d0000 rdx 0x1266d0000 rsi 0x30808000 rdi 0xf00000 r15 0x80070057 #2 victory.exe+0x57285a XMemAlloc (xmem.rs:404) #3 victory.exe+0x4a29d9 victory_gpu::resource::Memory::for_resource (resource.rs:999) #4 victory.exe+0x4a2e35 victory_gpu::resource::create_committed (resource.rs:3149) ``` `0x80000003` is a breakpoint: the title's own allocator asserted. Its page-size dispatch is at `title+0x56a2a60`: ``` 56a2a66 movl %edx,%eax 56a2a68 andl $0xc000,%eax ; attributes bits 14-15 = page size 56a2a6d cmpl $0x8000,%eax ; 2 MiB pages? 56a2a72 je 0x56a2a8b ; -> the 2 MiB arena ... 56a2ade addq $0xffff,%rcx 56a2ae1 andq $-0x10000,%rcx ; round the request up to 64 KiB 56a2ae8 addq %rdx,%rcx ; request end 56a2aeb cmpq %rax,%rcx 56a2aee ja 0x56a2afd ; request > block end -> int3 ``` From the registers at the `int3`: the block was `0x1266d0000..0x126a10000` (**3.25 MiB**) and the request was `0xf00000` (**15 MiB**) — for a 15 MiB committed resource we asked for 2 MiB pages, and the title's 2 MiB arena cannot serve that. `resource_attributes` (resource.rs) chose 2 MiB pages for *any* size ≥ 2 MiB. Fixed: 2 MiB pages only for memory that is whole 2 MiB pages **and** asks for 2 MiB alignment; everything else takes 64 KiB pages (the other branch of the same dispatch). With that fix Series S gets all the way past the tile heap into pipeline creation — the next assert it hits is a different one, see C. ## B. `VICTORY_HANG_WATCHDOG` (new, opt-in): the title's stall deadline `title+0x2215c35` — the trap that ends every Series X run — is reached from `title+0x2215a60`, a thread that samples `QueryPerformanceCounter` in 64 tables and, for a sample older than the deadline, calls the fatal handler the title registered (`title+0x1422161f0`) and then executes `mov dword [0], 0` + `int3`: ``` 2215ae2 vmovss 0x3f44336(%rip),%xmm7 # 0x6159e20: 300.0 ... 2215bc2 vmulss 0x7c399f6(%rip),%xmm0 # * (1/45) 2215bd8 vucomiss %xmm7,%xmm8 2215bdc jae 0x2215c0c # over the deadline -> fatal ``` The new loader module `crates/victory-loader/src/hang_watchdog.rs` can replace that constant (`VICTORY_HANG_WATCHDOG=<units>`, `title` = leave it alone; the default is the title's own). It is **not a fix for the crash**: the same trap still fires with the deadline raised — the trigger is not simply "a step took long". ## C. The trigger: page migration (`VICTORY_PAGES`) Two runs with page migration off passed the trap: ``` $ ./run.sh play VICTORY_PAGES=0 ... unified memory: VICTORY_PAGES=0, each pool stays where it starts lazy pages: a pool's window touched whole, ahead of its first use id=15 mb=6236 ms=411 title memory asked for as protection 0x2004 ... 6236 MB lazy page binding runs pages=106448 runs=64 pipeline workers workers=16 host pipeline shaders=[compute 6ab847c8ba379833] ... <- no 0x2215c35, ran for two hours until stopped by hand ``` So the fatal is tied to moving 64 KiB pages of title memory between the PC's memory and the card (`um::pages_move` / `residency`), not to the memory cap and not to the tile-heap commit itself. Off, the next failure is the host GPU: ``` err:vkd3d-proton:vkd3d_wait_for_gpu_timeline_semaphore: Failed to wait for Vulkan timeline semaphore, vr -4. ERROR victory_gpu::host: host GPU device removed after 1 submissions sent ahead of 1 lists; device removed: 0x887A0005 ``` `0x887A0005` is `DXGI_ERROR_DEVICE_REMOVED`, `-4` is `VK_ERROR_DEVICE_LOST`: the card's context dies on the first submission when the 6 GiB of title memory is not migrated. That is the next thing to fix, and it is in the opposite direction from the first one — the two need to be looked at together (what the patched RADV maps when a page has never moved, versus what the title's watchdog sees when it does). ## D. What is *not* the problem * Memory: reproduced with 11 GiB free and the desktop at 2.1 GiB; the cap was 7314 MiB and the cgroup never hit it. * The shader precompile ("195 do not translate"): all hull/domain/geometry-only containers, `0 have no host pipeline` in the run. * `run.sh`'s cap arithmetic: fixed (quarter of the machine kept, not a flat 8 GiB, and it now prints what it sets), but it was masking, not causing. --- # Update 2: Series S — the game boots, renders, then one assert stops it Measured with the fixes of section A (2 MiB-page gating), release build, `./run.sh play CONSOLE=series-s`, 11 GiB free. ## It runs ``` XMemAllocatePhysicalPages mb=220 / 297 / 185 / 3977 lazy pages: a pool's window touched whole, ahead of its first use id=19 mb=3977 ms=284 frame presented ... frame=256 draws=128 drawn=128 dispatches=51 dispatched=51 shaders from the cache and translated so far hits=2551 misses=0 unified memory: 6346 MB in RAM, 1501 MB in VRAM in 24 pools shown at 211 places ``` The title **presents frames** (~4 s worth, 256+ frames, real draws and dispatches) and then stops itself at `title+0x2219650` with `0x80000003` (breakpoint — a title assert, not a fault of ours): ``` rax 0x66ad rbx 0x6ffff9902808 rcx 0x6ffff99038b0 rdx 0x200000 rsi 0x10000 rdi 0x200000 r8 0x10000 r9 0xffffffff00000000 r10 0xffffffffffff0000 r11 0x200000 #0 victory-image-...dll+0x2219650 #1 victory-image-...dll+0x4fac413 #2 victory-image-...dll+0x193e248 (the device thunk of create_committed3) #3 victory-image-...dll+0x34c001 #4 victory-image-...dll+0x236e309 ``` ## What the assert is (disassembly) `title+0x4fac3c0` is a small guard run for one resource operation: ``` 4fac3c9 mov %r8,%rsi ; rsi = 0x10000 4fac3cc mov %rdx,%rdi ; rdi = 0x200000 4fac3cf mov %rcx,%rbx ; rbx = the object 4fac3d2 call 0x140104070 ; if (rdx == 0) 0; else (*(*rcx))(rcx, rdx) -> vtable method 0 4fac3d7 test %rax,%rax 4fac3dd test %rdi,%rdi 4fac3e5 je return ; found, or nothing asked -> fine 4fac3f1 movb 0x18(%rbx),%cl 4fac3f7 call 0x140005970 ; returns (byte18 & 1) 4fac3fe test %cl,%cl 4fac403 je return ; not a "must exist" object -> fine 4fac40e call 0x142219620 ; report(object, 0x200000, 0x10000) -> int3 if it returns ``` So: the title asked an object (`*(rbx)`, a title-side vtable) for something of size `0x200000` (2 MiB, alignment `0x10000`), got nothing back, and treated that as fatal. The report arguments are exactly the size/alignment of a **2 MiB heap**, which is the block the title's own allocator hands out and then checks (it is the same "the title places its back buffers in a block of its own and checks they fill it" path `use_allocator` documents). Ruled out by experiment: * **Our allocator refused nothing.** A warning was added where `Memory::for_resource` gets a null back from the title's allocator (`resource.rs`, "the title's allocator gave nothing back"); Series S reaches the assert with **zero** such lines, so the memory we asked for was granted. * **Not memory pressure:** the run reports `6346 MB in RAM, 1501 MB in VRAM in 24 pools ... on the card 23 (0 refused)`, with 11 GiB free. * **Not the FidelityFX upscaler:** the first `LoadLibrary` of `amd_fidelityfx_upscaler_xbox.dll` is a `GetModuleHandle` probe and is refused (correctly), then the title loads it and we map it: `title dll amd_fidelityfx_upscaler_xbox.dll at 0x6ffff17f0000 (loaded by the title)`, `bound ...: 7 hle, 79 host, 0 title, 0 missing`. * **Not heap memory provenance:** routing `CreateHeap` memory through the title's allocator instead of ours was tried and changed nothing (reverted). What is left, and where to look next: the object's vtable method 0 returning null for a 2 MiB request. It is a title-side allocator interface, so either the title's own pool for these blocks is smaller than the console's (a Series S budget it computes from what it thinks it has), or an interface we hand it as that object answers "no room". The next step is to log the object's vtable pointer and compare it against the ones the title installs at startup, and to log every `CreateHeap`/`CreateCommittedResource` size in the last second before the assert. ## Diagnostics added while digging (kept) * `resource.rs`: a warning when the title's allocator returns null, with the size, alignment and attribute word. * `victory-loader/src/windows.rs`: a debug line for every title DLL the loader does not map, with the path and whether the file exists (`VICTORY_LOG=info,victory_loader::windows=debug`). * `VICTORY_HANG_WATCHDOG` (loader module) — see section B; not a fix. ## Series X, after the same fixes Unchanged: `0x2215c35` right after the 6236 MiB pool with page migration on; with `VICTORY_PAGES=0` it passes that trap and then loses the GPU (`VK_ERROR_DEVICE_LOST`, `DXGI_ERROR_DEVICE_REMOVED 0x887A0005`) on the first submission. Series S does not hit either: its pools (3977 MiB) stay under whatever the migration path trips on, which is more evidence that the Series X trap is in the migration path and not in the memory size. --- # Update 3: the Series S assert, identified further The crash report now names the object that answered "no" (`victory-loader/src/crash.rs`, printed for every `int3`): ``` VIctory: first-chance exception 0x80000003 at victory-image-...dll+0x2219650 object at rbx: copy-on-write, in victory-image-...dll+0x71c2808 (vtable 0x6ffff88a83a0, victory-image-...dll+0x61883a0), flag byte +0x18 0x1 asked about 0x882000+0x10000: read-only; 0x10000: reserved, never committed ``` So: * The object is a **static object of the title** (`+0x71c2808`, i.e. an image address, not one of ours) whose vtable is at `+0x61883a0`. * Its flag byte `+0x18` is `1`, which is what makes the failed lookup fatal (`4fac3f1: movb 0x18(%rbx),%cl` → `and al,1` → fatal only when set). * What it was asked about is **an address and a length**: `0x882000` and `0x10000` (64 KiB). Read as a size, `0x10000` is a plausible 64 KiB; as an address it is `VirtualQuery`'s "reserved, never committed", which is nonsense. It is the same shape as the earlier run's `0x200000` + `0x10000`. * `0x882000` **is mapped, read-only** — a page of title memory, inside the title's first span (`0x400000...`), currently lazily mapped read-only as our design does until the page is touched. Different workloads give different addresses, same size (`0x10000`): with `VICTORY_UPSCALER=6` (the title's own upscaler instead of the Xbox FidelityFX one) the request was `0x882000+0x10000`; with FidelityFX it was `0x200000+0x10000`. So the object is asked to confirm a **64 KiB page of title memory** it has no record of, and it is a `must exist` object. ## The upscaler is not the cause `./run.sh play CONSOLE=series-s VICTORY_UPSCALER=6` (title's own upscaler) reaches the same `+0x2219650` assert, with a different address. And the Xbox upscaler does load and bind: ``` title dll amd_fidelityfx_upscaler_xbox.dll at 0x6ffff17f0000 (loaded by the title) bound amd_fidelityfx_upscaler_xbox.dll: 7 hle, 79 host, 0 title, 0 missing ``` The first `refused dll="amd_fidelityfx_upscaler_xbox.dll"` line is a `GetModuleHandle` probe before the load, which correctly returns null. Note on FSR 4 and RDNA 3: the Series S profile does not use FSR 4 at all — the title's *own* FidelityFX upscaler comes from the game (`amd_fidelityfx_upscaler_xbox.dll`). FSR 4 is only the PC path (`VICTORY_FSR_4K`, `./setup.sh fsr4`, `amdxcffx64.dll` from the driver and `amd_fidelityfx_upscaler_dx12.dll` from the SDK), and FSR 4's FP8 path is RDNA 4 hardware; on RDNA 3 (RX 7900 XT) it is the community FP16/INT8 fallback and is a separate, unrelated experiment. ## Next step, concretely The object's vtable is at `title+0x61883a0`; the lookup is its first virtual method `(this, address) -> record or null`. Two things to do next: 1. Disassemble the constructor that writes `0x61883a0` into an object to name it (a scan of `.text` for the immediate/lea of that vtable finds its class), then read the method to see what a "record" is keyed by (address range? physical page? pool?). 2. Compare against `victory_gpu::um::lazy`'s view of `0x882000`: whether that page was ever `BOUND`, and by which of the title's calls. The gap between "the title thinks it has a 64 KiB page there" and "the page has no record" is the bug. Until that is known, everything else about Series S is in place: it boots, translates shaders, presents frames, and reports `unified memory: 6346 MB in RAM, 1501 MB in VRAM in 24 pools ... on the card 23 (0 refused)`. --- # Update 4: the guard is a real failure, not cosmetic `VICTORY_PAGE_CHECK=off` (new, `crates/victory-loader/src/page_check.rs`) makes the guard at `title+0x4fac403` jump to its own "not found is fine" path (one byte, `74 e2` → `eb e2`; the two paths already exist in the title's code). Result, same call chain one frame later: ``` VIctory: first-chance exception 0x80000003 at victory-image-...dll+0x16473ef rax 0x1a8 rbx 0x0 rcx 0x0 rdx 0x22deea0 rsi 0x22deea0 rdi 0x0 ... #0 ...+0x16473ef #1 ...+0x236e363 #2 ...+0x236ddfe #3 ...+0x1defebe ``` `+0x16473ef` is another `int3` (assert) reached with `rbx = 0` — the caller used the record the guard would have refused to go without. So: * the missing record is **real**, not a bookkeeping nicety; * skipping the guard only moves the crash one step later, so the guard must be fixed at the source: the title has to find the 64 KiB page it asks about. The switch is kept as a diagnostic (default: guard as the title has it) because it names the dependency in one run; it is not a fix and must not be made the default. ## Where that leaves Series S | | | |---|---| | boots, translates shaders, presents frames | yes (256+ frames, `0 have no host pipeline`) | | unified memory, 24 pools, 6346 MB RAM + 1501 MB VRAM | yes, `0 refused` | | stops at | `+0x2219650`, a static title object (`+0x71c2808`, vtable `+0x61283a0`, flag `+0x18`=1) has no record of the 64 KiB page at `0x882000` | | next thing to establish | which of the title's calls should have created that record — the page is inside its first memory span and mapped read-only by our lazy path | Concrete next probe: log `XMemVirtualAlloc` / `XMemMapPhysicalPages` / `XMemFreePhysicalPages` at info for a run, and check whether `0x882000` was ever mapped, freed, or never named by the title at all. If the title never named it, the address comes from a structure we filled (a page-number table or a placed resource's address) and that is where the wrong value is born. --- # Update 5: what the object is — and the clue from upstream #71 ## The object is a pool descriptor with a lookup table `VICTORY_UPSCALER=6` run, crash diagnostics: ``` object at rbx: ... in victory-image-...dll+0x71c2808 (vtable ...+0x61483a0), flag byte +0x18 0x1 asked about 0x882000+0x10000: read-only object words: +0x0=vtable +0x8=0x6ffff9901560 +0x10=0x9612396b0 +0x18=0x1 +0x20=0x98c000000 +0x28=0x6ffff99028b0 +0x30=0x4fd00000 +0x38=0x6ffff99028b0 vtable ... methods: [0] +0x221a620 [1] +0xbb7060 [2] +0x53ea000 [3] +0x4380 ``` `+0x20` and `+0x30` are a **base and a size**: `0x98C000000 + 0x4FD00000` = 1.28 GiB, and the resources the title creates just before the assert sit inside it (`resource at an address address=0x9dbb50000`, `=0x9dbc70000`). The method the guard calls is `+0x221a620`: ``` 221a639 lock(table at +0x1471bfa88) 221a641 r8 = (arg2 != 0) ? arg2 : 0x10 221a644 rcx = this + 0x38 ; a hash map inside the object 221a652 rdi = max(arg1, 1) 221a65d call 0x1410ca6d0 ; map.lookup(key=arg1, arg2) 221a662 rcx = [this+0x20] ; the pool's base 221a66b rax == 0xFFFFFFFF ? null : base + rax ; miss -> null ``` So the guard asks a **pool** "which block of yours is at `0x882000`, `0x10000`?" and the pool answers "none". `0x882000` is **outside** that pool (`0x98C000000..0x9DBD00000`), so the answer is "correct" — the caller is asking the wrong pool, or with the wrong key. Two readings, both testable: 1. The caller iterates its pools and the first one it asks is not the owner; the `+0x18` flag ("ask again / must exist") turns the miss into a fatal instead of trying the next pool. 2. `0x882000` is not an address there but an offset/page number that belongs to another pool. Note the argument shape is identical across runs — `(<address>, 0x10000)` — and `0x10000` is exactly 64 KiB, the console's page size, in every run so far. ### Vtables are encrypted at rest `+0x61483a0` (and the neighbouring `+0x61283a0`) read as high-entropy bytes in the image on disk, while `+0x6159e20` (the `300.0` watchdog deadline) reads fine: the title keeps some pointer tables encrypted until it maps them. That is why the vtable had to be captured at run time; the crash report now prints `vtable <addr> methods: [0] ... [3] ...` for every breakpoint, which is how the list above was obtained. ## The upstream clue (lobomfz/VIctory-xmem#71) That issue is an RDNA3 performance report (RX 7800 XT, 28.6 fps median), not a boot bug, but it says two things that matter here: * **`VICTORY_UM_VRAM_MB` exists upstream** — a knob for how much of the card's memory title memory may take. This fork had it hardcoded: `CARD_KEPT_FOR_HOST = 12 GiB`, so a 20 GiB card gave the title only `8176 MB` (`card_mb_for_title=8176` in every log). Now implemented here (`crates/victory-gpu/src/um.rs`): `VICTORY_UM_VRAM_MB=<MiB>` caps the room, logging `unified memory: VICTORY_UM_VRAM_MB sets the room for title memory asked_mb=... granted_mb=...`. Worth a run at `VICTORY_UM_VRAM_MB=15000` on this machine (20 GiB card, 1.5 GiB in use by the desktop). * Their counters name the same texture symptom we see: `22212 uploaded from memory that read all zeros`, `24315 waiting` — memory that has no resident page reads as zeros; the page the Series S guard asks about is exactly such a page (mapped read-only, never written). Their `LATE_MOST` 256→512 and `CARD_KEPT_FOR_HOST` 12→10 GiB experiments are performance-only (no fps change, or "the room is never the limit, because only write-combined title memory goes to the card"). ## Where this leaves the Series S bug The failing lookup is `pool.find(address, 64 KiB)` on a pool that does not contain the address. Next: at the assert, also print every pool descriptor the title knows (walk `+0x28`/`+0x38` links) with its base/size, so the report says *which* pool does contain `0x882000` — that names the owner and closes the loop. ### Tested: the VRAM budget is not the trigger ``` ./run.sh play CONSOLE=series-s VICTORY_UM_VRAM_MB=15000 unified memory: VICTORY_UM_VRAM_MB sets the room for title memory asked_mb=15000 granted_mb=15000 reached_mb=20464 unified memory: title graphics memory is the card driver's own ... card_mb_for_title=15000 (was 8176) ``` Same assert, same arguments (`0x200000` + `0x10000`), same frame count. So the failing pool lookup does not depend on how much of the card the title may use; the default stays as it is, and the knob is there for the performance experiments #71 describes. --- # Update 6: searched, and three more hypotheses closed ## The GDK API behind the object (internet, official and emulator sources) Searching for the console API that has "mappings of 64 KiB pages" turned up two professional references: * **Microsoft's own GDK reference** (`microsoft/XBOX-Game-Development-Documentation`, `xgmemory_NR/interfaces/XGMemoryLayout`): an `XGMemoryLayout` is a set of **mappings** of GPU pages, `XGMemoryLayout::CreateMapping(name, alignment, size)`, `MapFromPattern`, `GetPageSizeBytes` — "this size is typically 64 KB, which can be verified via `GetPageSizeBytes`", alignment defaults to `XG_GPU_PAGE_SIZE_BYTES`. That is exactly the shape of the object we captured: a base (`+0x20`), a size (`+0x30`), and a hash map (`+0x38`) from a page/address key to a block offset. * **`ScikuVRC/xboxrecomp` docs** (original-Xbox emulator): console virtual addresses are mapped into the host process at their exact addresses because "Xbox games use hardcoded absolute addresses for all global variables", and `VirtualAlloc`-at-address fails for mirrored memory — the same class of problem the unified-memory layer solves here for the Series X|S address space. The title does not import any `XGMemoryLayout*` symbol (checked the import table), so this object is its **own** implementation of that model, filled by its own `XMem*` calls — which is why nothing on our side gets to "register" a mapping in it. ## Closed: the address is not one of our page numbers `XMemAllocatePhysicalPages` now logs the page numbers it hands out (debug level): ``` first_page=0x33500 pages=63632 frames_each=16 ``` The whole page-number space used in a Series S run is roughly `0x33500 .. 0x130400`. The guard asks about `0x200000` / `0x882000`, both far outside it, and `VirtualQuery(0x882000)` says the page is **mapped read-only** — so it is a *virtual address* of title memory, not a page number. Page numbering is not the bug. ## Closed: page migration `./run.sh play CONSOLE=series-s VICTORY_PAGES=0` → the same assert at the same place (`0x200000` + 64 KiB, after 9 presented frames). Series S is not affected by the migration path that kills Series X. ## Summary of what is ruled out for the Series S assert | factor | test | result | |---|---|---| | FidelityFX vs the title's upscaler | `VICTORY_UPSCALER=6` | same assert (address changes) | | card room for title memory | `VICTORY_UM_VRAM_MB=15000` (was 8176) | same assert | | page migration | `VICTORY_PAGES=0` | same assert | | our allocator refusing | new warning on null from the title's allocator | never fires | | memory pressure | 11 GiB free, `0 refused` pools | not applicable | | page numbering | `first_page`/`count` logged | address is not a page number | | the guard itself | `VICTORY_PAGE_CHECK=off` | crash one step later on the null record | What remains: a *virtual address* the title presents to a pool that does not own it (`0x882000` / `0x200000`, pool base `0x98C000000` + 1277 MiB). The helper that asks (`+0x4fac3c0`) has ~180 call sites in the title — it is the generic "record for this address" lookup used all over the resource code — so the wrong address is born in whatever produced it, not in the lookup. ## Note on the controller (from the reporter of this machine) The "controller disconnected" screen is explained by the pad itself: it is wireless and drops on inactivity. `VICTORY_ONE_PAD=1` is still worth setting in `run.conf` (it is the fix for the title withdrawing the keyboard/mouse stand-in pad when a real one appears), but an idle wireless pad disappearing is the pad's behaviour, not the emulator's. --- # Update 7: the guard is an allocation failure, and it is not ours Disassembling the guard's caller chain changes the reading of the whole crash: ``` 2474690 test %r8,%r8 ; je return ; size 0 -> null 2474695 testb $1,%cl 247469a addq $0x7f,%r8 ; andq $-0x80,%r8 ; size rounded up to 128 24746a7 cmpq $0x81,%r9 ; cmovbq %rax,%r9 ; alignment at least 128 24746b2 movq %r8,%rcx ; size 24746b5 cmpb $1,%dl 24746b8 ja 24746c5 ... 24746d0 push rsi,rdi 24746d6 movq %rdx,%rsi ; the address/size asked about 24746d9 movq %rcx,%rdi 24746dc xor ecx,ecx ; xor edx,edx 24746e0 call 0x144fc99c0 ; <- the CURRENT memory layout (a global) 24746e5 movq %rax,%rcx ; this = layout 24746e8 movq %rdi,%rdx ; arg1 24746eb movq %rsi,%r8 ; arg2 24746f4 jmp 0x144fac3c0 ; layout->vtable[0](this, arg1, arg2) ``` So the title asks its **current memory layout** for a block, and the layout answers "none". `0x200000`/`0x882000` are not a *foreign address* — they are the **size** of a block (2 MiB, 8.5 MiB) and `0x10000` the 64 KiB alignment. The `+0x18` flag makes that failure fatal ("this allocation must not fail"), and it is fatal on Series S only because that profile runs out of that layout, not because the lookup is wrong. ## Which layout, and how full ``` title memory asked for as protection 0x2404, kind 0x203000, flags 0x283: 1 times, 1277 MB, last 0x98bc00000+0x4fd00000 ``` That is the layout: 1277 MiB at `0x98BC00000`, whose usable base is the object's `+0x20` = `0x98C000000` (a 4 MiB header). The resources the title places sit inside it (`0x9dbb50000`, `0x9dbc70000`), so it is the graphics pool. ## Not a leak on our side Allocations that go through us (`Memory::for_resource`, i.e. the title's `__XMemAllocationHooks__[0]`) are now counted: ``` resources: the title's allocator, blocks asked for so far allocs=16 held_mb=94 size=262144 ``` 16–31 blocks, **94 MB held**, at the moment of the assert — with every block returned on drop. The layout is 1277 MiB; we are not filling it. The title's own allocations fill the rest, and its allocator then fails on the 2 MiB request. ## Ruled out so far (all by experiment, one run each) | factor | test | result | |---|---|---| | FidelityFX vs the title's upscaler | `VICTORY_UPSCALER=6` | same assert (size changes to 8.5 MiB) | | card room for title memory | `VICTORY_UM_VRAM_MB=15000` | same assert | | page migration | `VICTORY_PAGES=0` | same assert | | our pages exhausted | `first_page` counts: `0x33500..0x130400` | address is a size, not a page number | | our allocator refusing | warning on null from the title's allocator | never fires | | our blocks filling the layout | counters: 94 MB / 1277 MiB | not it | | the guard itself | `VICTORY_PAGE_CHECK=off` | next assert on the null block | ## Next step Watch the layout while it fills: read the object at `current_layout()` (title `+0x4FC99C0`), print its words every second, and see which field climbs to the 1277 MiB — `+0x30` is the extent seen at the crash. If the layout's high-water mark is its size, the question becomes what the title frees and we do not, and the same readout says whether the free path is reached at all. ---
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 14:36:42 +00:00
Author
Owner

@⁠Finalizator on GitHub · 2026-12-02 14:36 UTC · original

Part 2

16–31 blocks, 94 MB held, at the moment of the assert — with every block returned
on drop. The layout is 1277 MiB; we are not filling it. The title's own allocations
fill the rest, and its allocator then fails on the 2 MiB request.

Ruled out so far (all by experiment, one run each)

factor test result
FidelityFX vs the title's upscaler VICTORY_UPSCALER=6 same assert (size changes to 8.5 MiB)
card room for title memory VICTORY_UM_VRAM_MB=15000 same assert
page migration VICTORY_PAGES=0 same assert
our pages exhausted first_page counts: 0x33500..0x130400 address is a size, not a page number
our allocator refusing warning on null from the title's allocator never fires
our blocks filling the layout counters: 94 MB / 1277 MiB not it
the guard itself VICTORY_PAGE_CHECK=off next assert on the null block

Next step

Watch the layout while it fills: read the object at current_layout() (title
+0x4FC99C0), print its words every second, and see which field climbs to the
1277 MiB — +0x30 is the extent seen at the crash. If the layout's high-water mark
is its size, the question becomes what the title frees and we do not, and the same
readout says whether the free path is reached at all.


Update 8: watching the layout, and what its vtable really is

VICTORY_LAYOUT_WATCH=1 (new, apps/victory/src/run.rs) reads the title's layout
object (static at title+0x71c2808) once a second and logs its words. Series S:

layout watch flag=0x1 base=0x98bc00000 extent=0x4fd00000 map_at=0x6ffff99428b0 w10=0x6ffff9bc38b0
...  same for 8 s ...
layout watch flag=0x1 base=0x98bc00000 extent=0x4fd00000 map_at=0x6ffff99428b0 w10=0x960dc6550
VIctory: first-chance exception 0x80000003 ... +0x2219650

So the object is re-configured in place: w10 (+0x10) flips from a heap pointer
to a value in the unified space (0x960dc6550) in the second before the fatal, and at
the crash +0x20 reads 0x98c000000 (4 MiB above the 0x98bc00000 seen while
watching) while +0x30 stays 0x4fd00000. It is one global "current layout" that is
pointed at a different region as the title's pools come and go — which is why the
fatal's numbers differ from run to run and from upscaler to upscaler.

The vtable is an interface, not one method

The entries captured at the crash are thunks into a bigger table:

[0] +0x221a620   the "find a block" we read: map lookup at +0x38, base +0x20, miss = 0xFFFFFFFF
[1] +0xbb7060    mov (%rcx),%rax ; jmp *0x48(%rax)      <- another method of the same interface
[2] +0x53ea000
[3] +0x4380

So the layout is an object with at least 0x50 bytes of methods; the allocation the
guard wanted is the one initiated from the caller (+0x2474690), which reaches
[0] with (size, alignment). The next step is to read the runtime table at
vtable+0x48 (the same way the [0] entry was read) and disassemble that method —
that is the "allocate" half, and it will say which field of the object it compares
against (base + extent, or a separate high-water mark).

Instrumentation now in the tree (all opt-in, all documented here)

switch what it does
VICTORY_LAYOUT_WATCH=1 logs the layout object's words once a second
VICTORY_PAGE_CHECK=off skips the title's "must not fail" guard (diagnostic only)
VICTORY_HANG_WATCHDOG=<units> replaces the title's stall deadline
VICTORY_UM_VRAM_MB=<MiB> caps the card's room for title memory (default 8176 MB here)
VICTORY_UPSCALER=6 the title's own upscaler instead of FidelityFX (now the Series S default, Update 13)
VICTORY_CONSOLE_MB=<MiB> the memory the title is told it has (adapter description and XMem), over the console's figure
VICTORY_AUTO_PRESS=<seconds> a real left click that often while our window is in front (Update 15)
VICTORY_ALLOC_ID / _MEMORY / _PAGES the title allocator's attribute bits, for comparing pools
VICTORY_MEMORY_REPORT=title the memory figure the title is told, without the layer's own copy
VICTORY_NATIVE_COMPUTE, VICTORY_NATIVE_GRAPHICS device methods 0x218 / 0x1c8 built from the title's own program pieces
VICTORY_CAPTURE=<folder> presented frames as PNG (diagnostics build), what Update 13 was read from
VICTORY_PAGES=0 no page migration

Crash reports now print, for any int3: the object at rbx (vtable, flag byte), the
words of the object, the vtable's first four methods, and what rdx/r8 point at.


Update 9: the pool is 99.96% full — measured

The first crash log with placement logging (VICTORY_LOG=info,victory_gpu::resource=debug)
holds enough to measure the title's own pool directly:

placements logged 3788
distinct addresses 3574 (214 reused, 5.6 %)
highest address 0x9DBC70000
pool end (base + extent) 0x9DBD00000
headroom when the 2 MiB request failed 576 KB

So the allocation the guard makes is not a bookkeeping accident: the pool really is
full. Its high-water mark only ever grows (3291 monotonic steps, 5.6 % reuse), which
is what a streaming title looks like before it starts recycling.

The pool is the one the title itself asks for: XMemVirtualAlloc of 1277 MB at
0x98BC00000 (title memory asked for as protection 0x2404, kind 0x203000, flags 0x283), Series S. On Series X the same line says 2199 MB. Both scale with the
console's memory budget (1277/2199 ≈ 8 GB/13.5 GB), so the sizing is the title's own
and follows the profile — it is not something we hand it.

Additional facts from this round

  • Scatter page mapping works and is used: the title maps its big spans through
    XMemMapPhysicalPagesScatter (8 calls: n=6720 first=0x143000000, n=4136 first=0x163000000, ...), so physical-page machinery is not the missing piece.
    XMemMapPhysicalPages itself is never called — that is normal, the scatter form
    covers the same ground.
  • The title never asks for its memory statistics: XMemGetWorkingSetStatistics
    is not called at all in a Series S run (0 lines), so the figures we report there
    (title_limit 7.59 GiB for Series S, used = the process's commit) do not shape
    its budget. VICTORY_MEMORY_REPORT=title was added anyway (reports the commit
    less the unified memory) but it cannot be the fix for this.
  • The allocator id does not choose the pool: VICTORY_ALLOC_ID=0 behaves exactly
    like the default 128 (all ids resolve to the same node in the title's registry).
  • VICTORY_ALLOC_MEMORY / VICTORY_ALLOC_PAGES are now there to test the memory
    type and page-size bits the same way, without a rebuild:
    resources: attributes for the title's allocator overridden id=… memory=… pages=….

Where the remaining question is

The pool fills with the title's own placements, and it does so on a profile-sized
budget. Two candidate explanations, and how to tell them apart:

  1. The title should be reusing that pool but its free path never runs here. Log
    the placements' lifetimes: pair each resource at an address with the release that
    follows it (our object's Release reaching zero), and see whether the addresses
    the title hands back ever reappear as placement sites. 214 of 3578 do; on a run
    that survives they should be far more.
  2. The placements should be going somewhere else on console — the 16 GiB spans it
    reserves (0x143000000, 0x163000000, 0x183000000) rather than the small
    layout. That would be decided by the resource's memory class, i.e. by
    resource_attributes (our guess) or by a flag in the desc that we ignore.

The cheapest next probe for (2): run with VICTORY_ALLOC_MEMORY at each value 0–3 and
compare the pool's high-water mark at the crash (the placement log gives it directly).
If one value stops the layout from filling, that is the missing attribute, and the
fix is one constant.

Tested: memory type 2

VICTORY_ALLOC_MEMORY=2 gives a byte-for-byte identical run: 3788 placements, same
highest address 0x9DBC70000
. Together with VICTORY_ALLOC_ID=0 doing nothing, this
says the 3788 placements are the title's own decisions (resource at an address =
memory the title mapped itself and handed to CreateCommittedResource), not something
our attribute word steers. So (2) above — "the placements should go elsewhere" — cannot
be reached by changing what we ask the allocator for; the choice happens inside the
title, from data we don't supply.

That leaves (1): the pool is filled by the title's own streaming at a pace that, on
this emulation, outruns its reuse. The measurement to make next is the one that decides
it — for each of the 3788 placements, does the title ever release it (does our
object's Release reach zero and does the address come back as a placement)? 214 of
3578 addresses do come back; if a surviving run reuses far more, the difference is
what to chase next.

Update 10 — the Series S assert was a budget, not a bug: the output size decides it

It runs. ./run.sh play CONSOLE=series-s with VICTORY_OUTPUT=1920x1080 reached
frame 12094 (5.6 minutes, ~36 fps average on the presented frames), zero exceptions,
busy_percent=99.97 throughout, and the log still advancing when it was stopped by hand.
The same binary, same cache, same profile at the default 2560x1440 had died at
title+0x2219650 within thirty seconds on every one of four attempts.

What changed between the two runs

Only the output size. Everything else — profile, budgets, allocator attributes, page
sizes, migration — was identical, and the runs previous to this one had already ruled
out each of those individually (VICTORY_UPSCALER, VICTORY_UM_VRAM_MB, VICTORY_PAGES,
VICTORY_ALLOC_ID, VICTORY_ALLOC_MEMORY). So the assert is not a bug in our HLE; it is
the title reacting, correctly and fatally, to a memory budget that its own streaming
plan does not fit into at 1440p.

Why the size changes the title's appetite

The Series S profile reports 7,776 MB, and the title takes 16 % of whatever it is told
for its own GPU layout object (the pool measured in Updates 6–9):

profile budget reported layout requested filled at the assert
Series X 13.5 GiB 2,199 MB tile heap dies earlier, +0x2215c35
Series S 7,776 MB 1,277 MB 99.96 %, next 2 MiB refused → int3

At 2560x1440 the title streams 1,129 MB of placements into that 1,277 MB pool before it
has presented its first frames; the 3,789th placement gets 0xFFFFFFFF back from its own
lookup (+0x221a620, map at +0x38) and the flag at layout+0x18 turns that into
int3. At 1920x1080 the same streaming settles at 1,043 MB and then reuses addresses
the title releases — total placed bytes climbed past 3,082 MB while the high-water mark
stayed inside the pool, because releases finally outpace new placements once the
first-load burst is smaller than the pool instead of almost exactly equal to it.

That asymmetry is the whole story: the pool is sized for the console's own 1440p output,
and we were asking for 1440p plus a PC-sized first-load burst (larger because nothing
was pre-warmed, so the title could not stream patiently).

The fix

apps/victory/src/run.rs, output_default(): when --console series-s is used and
VICTORY_OUTPUT is not set, the output defaults to 1920x1080 instead of 2560x1440, and
the run says so:

output size    1920x1080 (Series S: 1440p fills the pool the profile leaves the title)

An explicit VICTORY_OUTPUT still wins — nothing is taken away from a user who wants to
try 1440p on a machine with more headroom, or who wants the crash for a report.

What this means for Series X

Series X dies from the same class of problem one step earlier, at +0x2215c35, in the
tile heap rather than this layout, and its pool is 2,199 MB instead of 1,277 MB. The
output-size lever should be tried there too (a 1440p render with a 1080p output is
VICTORY_OUTPUT=1920x1080 VICTORY_RENDER_SCALE=0.75), and the same measurement (pool
high-water mark at the moment of death) tells whether it helps. Not yet tested.

Still worth doing (not blockers)

  • The pool's +0x18 flag makes a failed allocation fatal. On a PC a failed GPU
    allocation is a normal, recoverable condition, so the title's own "not found is fine"
    path at +0x4fac403 is arguably the correct behaviour here — VICTORY_PAGE_CHECK=off
    already proves the guard can be stepped over, but skipping it would leak the budget
    problem into later frames instead of solving it. Left as a diagnostic.
  • The Series S profile could report the console's real output resolution to the title
    (it is told 3840x2160 by VICTORY_DISPLAY_MODE) so that its asset tiers match the
    profile it believes it is on. Today the display mode is 4K while the output is 1080p,
    which is why the first-load burst is bigger than a console's.

Update 11 — what stops Series S now: the host's RAM, not the card

With the 1080p default in place, a fresh run gets past the layout assert and presents
frames — and then dies with the device removed. The kernel says why:

amdgpu 0000:2b:00.0: [drm] *ERROR* Not enough memory for command submission!   (x6)
amdgpu 0000:2b:00.0: [drm] VM memory stats for proc main(...) task vkd3d_queue(...) is non-zero when fini
VIctory: host GPU failure: host GPU device removed after 1 submissions sent ahead of 5 lists;
         device removed: 0x887A0005

Not enough memory for command submission is amdgpu_cs_ioctl failing to allocate the
job/IB in kernel memory. It is not a driver bug and not a bad shader: the machine has
no memory left to give.

Measured, 0.5 s sampling of mem_info_vram_used, mem_info_gtt_used, MemAvailable

run cgroup cap peak VRAM peak GTT lowest MemAvailable result
CONSOLE=series-s (new default) 7906 MiB 7544 MB 7948 MB 2171 MiB 12 frames, device removed
+ VICTORY_CONSOLE_MB=7168 7906 MiB 7410 MB 7791 MB 1537 MiB 13 frames, device removed
+ KEEP_FREE=512 11348 MiB 7402 MB 7865 MB 1274 MiB 12 frames, device removed

Three different caps and two different memory figures give the same death, at the same
point, with the same kernel message. So the cgroup limit is not the cause (raising it by
3.4 GiB changed nothing but the final MemAvailable), and the figure the adapter reports
is not either — this title never asks IDXGIAdapter::GetDesc (the VICTORY_CONSOLE_MB
log line never appears), it sizes everything from the console profile it is told.

What the numbers say

  • The card is not the problem: 7.4 GB of 20 GB in use, 13 GB free, while the host
    runs out of RAM.
  • The host is: GTT ≈ 7.8 GB — the title's host-visible graphics memory, which the
    driver pins in system RAM — plus ~2.7 GB of the process's own working set, plus the
    desktop and page cache, against 15.5 GiB of RAM. MemAvailable bottoms out at
    1.3–2.2 GiB and the next kernel allocation on behalf of the GPU fails.
  • GTT and VRAM track each other almost exactly (7.8 GB ↔ 7.4 GB), which is the shape of
    a mirror: the title's memory sits in system RAM and a window of the same pages is
    resident on the card.

That is precisely the arrangement the machine cannot afford: the console had one pool
shared by both, and this emulation needs a copy in each. It is also the honest answer to
"the card has 13 GB free, why is it swapping": nothing in the title's own plan puts its
memory on the card instead of in RAM; the card only gets the pages it recently touched.

Why a earlier run got 12094 frames and these do not

The first 1080p run (Update 10) held on for 12094 frames with the same settings. The
difference is headroom, not logic: the pipeline cache has since grown to 3.3 GB (the
89 229-pipeline warm), and each attempt now starts a few hundred MiB lower and crosses
the line the previous one just missed. On a 15.5 GiB machine this configuration is on the
edge, and the edge decides.

What is in the tree now

  • run.sh: CONSOLE=series-s defaults VICTORY_OUTPUT to 1920x1080 and says so
    (Update 10). An explicit VICTORY_OUTPUT still wins.
  • apps/victory/src/run.rs: the same default in the binary (output_default), for runs
    that do not go through run.sh.
  • crates/victory-gpu/src/dxgi.rs: VICTORY_CONSOLE_MB overrides the standard memory
    the adapter description reports. Useful for titles that ask; this one does not, so it
    is a no-op here and is documented as such.

What would actually fix it, in order of value

  1. Keep the title's GPU-only memory out of GTT. The card has 13 GB free; if
    allocations the title marks GPU-optimal were backed by VRAM instead of pinned system
    RAM, ~7 GB of RAM would come back and the whole configuration would fit. This is the
    same lever the earlier update explored from the resource_attributes side, but the
    question to answer is different: not where in the title's address space a resource
    lands, but which heap our HLE hands it. ram=5 vram=Some(3) in the unified-memory
    log line says we have three VRAM heaps to offer.
  2. Stop mirroring. If the 7.8 GB GTT really is a shadow of the 7.4 GB VRAM window,
    the window should be allowed to be the only copy for read-only GPU data.
  3. Give the run less to keep resident: VICTORY_UM_VRAM_MB (smaller window),
    a smaller pipeline cache, and a desktop that is not holding 2 GB.

None of these is a one-line change, and none is proven yet; they are recorded here as the
next experiments rather than as fixes.

Update 12 — the fix: the card window decides how much the host must back (wrong)

Withdrawn — see Update 14. The conclusion below came from a run that was stopped by
hand at frame 303, before the point where every other run dies. At 4,062 MB and at
8,176 MB the title's memory and the failure are identical, and the auto-half-window this
update added to run.sh has been removed. What actually fixed it is the aperture, in
Update 15. The measurement below is kept because the numbers are real; the conclusion
drawn from them is not.

Update 11 ended with "the host's RAM, not the card". This update thought it closed it.

The measurement that decided it

One number, moved on purpose: VICTORY_UM_VRAM_MB, the room the title is given on the
card. Everything else identical to the run that died.

card window peak VRAM peak GTT (pinned in RAM) lowest MemAvailable result
8176 MB (default: 20 GB card − 12 GiB host reserve) 7544 MB 7948 MB 2171 MiB died, 12 frames
4096 MB 4036 MB 6440 MB 3809 MiB ran, frame 303 and still presenting

The residency line says it plainly:

card window 4096 MB:  page residency: 1697 MB of 5956 MB of paged title memory on the card
                      unified memory: 6071 MB in RAM, 1841 MB in VRAM in 43 pools

So the window is not "extra memory on the side": it is what decides how much of the
title's memory the host has to hold
. Take 4 GB off the window and ~1.5 GB comes off
GTT and ~1.6 GB comes back to MemAvailable. Give the title 8 GB of the card and the
host has none left for the kernel's own allocations.

That is why the three failures in Update 11 were all identical: they were all giving the
title 8 GB it could not afford, and none of the caps or budget figures changed that.

The fix, in run.sh

When the play run is short of memory (the existing cap < 12288 case, i.e. the title
commits more than the machine has), the card window now defaults to half of what the
run can hold
:

VICTORY_UM_VRAM_MB=${VICTORY_UM_VRAM_MB:-$((cap/2))}
echo "memory: the card window is ${VICTORY_UM_VRAM_MB} MiB (the host backs the rest)"

On this machine that prints memory: the card window is 4008 MiB (the host backs the rest), which is the value proven above. An explicit VICTORY_UM_VRAM_MB still wins, and
machines with enough RAM (24 GiB and up) never take this branch, so they keep the full
card.

Verified

./run.sh play CONSOLE=series-s with no other settings, 2026-12-01:

output size: 1920x1080 (Series S: 1440p fills the pool the profile leaves the title)
memory: the card window is 4008 MiB (the host backs the rest)
page residency: 1357 MB of 5956 MB of paged title memory on the card, card room for the title 4008
frames presented, 0 host GPU failures, title alive and presenting

Nothing was skipped to get there: no VICTORY_PAGES=0, no guard patch, no raised
watchdog. The title's own layout assert, the tile heap fatal and the kernel's submission
failure are all gone at these settings, for the same reason: the title is no longer being
sold more memory than the machine can back.

Why this is also the right shape of a fix

The console had one pool that both the CPU and the GPU used. This machine cannot place
the title's whole working set in the card (it has the room) and keep a copy the CPU can
reach (it does not have the RAM). The honest configuration is therefore to keep the
card's share of it modest and let the host hold the rest — which is what the window now
does automatically, and what the user's earlier question ("why not use the 10 free GB of
RAM and the free VRAM 1:1?") pointed at: the 1:1 arrangement is exactly what does not
fit, and half of it does.

Update 13 — the black 3D world on Series S: FidelityFX's console upscaler

This is the black screen the title's own window shows once it is past the loading
screens
, and it is what the reporter's log was pointing at all along. Line 5830 of the
run of 2026-12-02 13:22:

WARN victory_hle::modules::kernel: a host DLL outside the host policy:
     refused dll="amd_fidelityfx_upscaler_xbox.dll"
title dll      amd_fidelityfx_upscaler_xbox.dll at 0x6ffff17f0000 (loaded by the title)
bound          amd_fidelityfx_upscaler_xbox.dll: 7 hle, 79 host, 0 title, 0 missing

The captures say the same thing from the other side. Every frame we saved is not
black — the key art, the loading screens and their transitions render, with mean
brightness 36 → 170 of 255 — and every one of them is a 2D screen. The 3D world is drawn
into a render target that only the upscaler puts on screen, so it is the upscaler's
absence that is black.

What the title does

title+0x7e93f0 is the upscaler picker: it returns 6, the title's own upscaler,
except on Series S, where a flag makes it return 7, the console's AMD FidelityFX
(amd_fidelityfx_upscaler_xbox.dll). The render scale and the whole post chain follow
from that choice (resolution.rs documents both paths). On Series S the title therefore
asks for FidelityFX, gets a console DLL we do not implement, and its passes draw nothing.

That is why this symptom is tied to the profile and not to the card:

report card Series X Series S
this machine RX 7900 XT (RDNA 3) runs, world draws black world, HUD and UI fine
upstream #6, ramc1312 RX 7900 XTX (RDNA 3) draws, two 45–50 min sessions black, ~43 fps, ~4,700 draws a frame
upstream #6, Mylloon RX 6650 XT (RDNA 2) works black
upstream #6, alexfran111 RX 9060 XT (RDNA 4) (ran out of RAM) black, then draws with VICTORY_UPSCALER=6

Four machines, three generations, one variable: the profile. Upstream issue #92 asks the
same thing from the other end ("enable the FSR on series S, black screen should
disappear"), and a reporter there turned FSR on and still had black, which fits: it is not
FSR being off, it is FidelityFX's console upscaler being the path taken.

The fix

Series S now picks the title's own upscaler unless told otherwise
(apps/victory/src/run.rs, upscaler_default, and the same in run.sh):

upscaler: the title's own (Series S: FidelityFX's console upscaler draws no 3D here;
          VICTORY_UPSCALER=7 asks for it anyway)
resolution: upscaler picker (returns 6) at title+0x7e93f0: Done

An explicit VICTORY_UPSCALER still wins, and VICTORY_FSR_4K is left alone — that path
needs the picker to return 7, because there FidelityFX's PC build (./setup.sh fsr4)
does the work through victory-hle's FidelityFX module instead of the console DLL.

Verified here

  • The patch applies: upscaler picker (returns 6) … Done, and the run says so.
  • amd_fidelityfx_upscaler_xbox.dll no longer appears in the log at all (0 occurrences,
    against a refusal, a load and 79 host bindings without the fix).
  • The loading screens still render identically (captures compared).

What is not verified on this machine is the world itself: every run here dies before
it (Update 14), so the confirmation that the world draws with this setting comes from the
reporters above — including one on the same card family (RX 7900 XTX, Mesa RADV 26.3.1
with this repo's mesa.patch, Proton, series S at 1920x1080).

Why FidelityFX's console upscaler draws nothing (not chased)

Its 79 imports bind to host D3D12, so the DLL's own code runs and does its dispatches; it
is the result that never appears. Candidates, in the order worth checking: the DCC
(color-compression) options in the console's resource descriptions — the fork already
stubs CreateCommittedResourceX at device slot 0x260 for exactly this DLL, noting "its
description is PC's plus DCC options, which we have no use for"; the jitter/phase-count
handshake; and the console's own output surface semantics. ./setup.sh fsr4 plus
VICTORY_FSR_4K=<profile> is the working alternative today (host FSR 4.1 at 4K), and it
is the path upstream issue #92 is really asking for.

Update 14 — the device lost at ~60 s is RAM, and the numbers that say so

Every Series S run on this machine, with the black-scene fix in place, ends the same way
about 3,000 frames (≈60 s) after the title starts:

amdgpu 0000:2b:00.0: [drm] *ERROR* Not enough memory for command submission!   (x4–x19)
vkd3d-proton: Failed to wait for Vulkan timeline semaphore, vr -4   (-4 = VK_ERROR_DEVICE_LOST)
VIctory: host GPU failure: host GPU device removed after N submissions sent ahead of M lists

Measured at 100 ms resolution (the 2 s sampling of Update 11 missed the dip)

moment MemFree MemAvailable title memory shown VRAM used
during the run 1.0–1.4 GB 1.4–1.9 GB 7,844 MB (5,964 RAM + 1,880 card) 7.4–7.9 GB
at the failure 129 MB 130 MB same same

The kernel fails a small allocation while the card has 13 GB free, because the host
has 130 MB. The title's 7.8 GB is host-visible graphics memory: pinned, and not
swappable, so neither zram nor the 17 GB of disk swap can help with any of it.

What was tried against it, and what each measurement showed

change expectation measured
card window VICTORY_UM_VRAM_MB 4062 MB half of the title's memory stays on the card, host backs less title memory still 7,844 MB, GTT unchanged, dies at the same frames
card window 8176 MB (the default) fewer page copies identical
VICTORY_PAGES=0 no migration churn identical (dies at frame 2790)
pipeline library removed (7.9 GB of .pso, 99,230 pipelines) our driver memory drops identical (dies at frame 3023)
ttm.pages_limit raised 2,034,833 → 3,145,728 pages (7.9 → 12 GiB) at runtime the aperture was the limit no change; the -ENOMEM is not the TTM page limit
VICTORY_CONSOLE_MB=6144 (the figure XMem and the adapter description give) the title streams against a smaller budget title memory 6,003 MB RAM + 1,841 MB card = 7,844 MB, unchanged; dies at frame 2,862

So the aperture and the knobs are not the constraint: 16 GB of RAM is. Note that
mem_info_gtt_total (7,948 MB) is exactly ttm.pages_limit × 4 KiB, and the run's GTT
reaches 7,948 MB, which is why it looked like an aperture limit — but raising the limit
did not move the failure, and MemAvailable says the machine is empty at that moment.

Correction to Update 12

Update 12 claimed the card window decides how much the host must back, from a run at
4,096 MB that was watched for 303 frames and then stopped by hand — before the point
where every other run dies. It does not: at 4,062 MB and at 8,176 MB the title's memory
and the failure are the same. The auto-half-window that Update 12 added to run.sh has
been removed; what is left there is a warning with the measured figure.

What would actually help, in order

  1. More RAM (32 GB): the title's 7.8 GB is not compressible, not swappable and not
    avoidable — it is the console's unified memory, and on a PC it must exist in system
    RAM to be host-visible.
  2. A smaller title budget. Tested, no effect. The figure is the one XMem
    reports (limit_mb=7776) and the adapter description's, and both now read
    VICTORY_CONSOLE_MB (one helper, console::standard_memory). At 6,144 MB the title's
    memory is byte for byte the same, which matches the note in console.rs: the title
    sizes nothing from that figure, it goes by the device type. The knob is kept because
    it is the right place for a title that does read it.
  3. Host memory out of the way: no browser, no compositor effects, a 4 GB desktop;
    that is the 1 GB the machine is missing.

Update 15 — zram, "VRAM as swap", the GTT aperture, auto-clicks, and five upstream issues

zram and the swap sysctls: measured, and what changed

The machine runs the Fedora/Nobara default (zram 8 G zstd at priority 100, 17.1 G
disk swap at −1, vm.swappiness=100, vm.page-cluster=0), documented in
NOTES-memory-zram.md. Measured during these runs, zram holds 830 MB of data in
173 MB compressed
— 0.2 GB of the 15.5 GB, i.e. it is not what starves the run. What
starves the run is the 7.8 GB of host-visible title memory the kernel cannot reclaim at
all (Update 14), so no swap policy can touch it.

Two changes are in /etc/sysctl.d/90-victory-memory.conf (live and persisted):

setting before after why
vm.watermark_scale_factor 10 50 kswapd wakes sooner and refills the reserve before it is empty — the failure is a small kernel allocation refused at the margin
vm.min_free_kbytes 67,584 (66 MB) 262,144 (256 MB) a reserve for exactly those allocations
vm.swappiness 100 left at 100 tried 60 first: it changes nothing for an unevictable working set and costs the desktop; with swap on zram, 100 is the right direction
vm.page-cluster 0 0 right for zram

Measured effect on the wall: none. With min_free_kbytes at 512 MB, watermark 50 and
swappiness 60 the run died at frame 2,711 instead of ~3,000, i.e. the same place. The
settings are kept at the milder values because they cost nothing and make a kernel
allocation at the margin likelier to succeed; they are not a fix, and this update says so
rather than implying otherwise.

"Can we use GPU memory as swap?"

No — not as swap, and not for this title. Concretely:

  • Swap needs a block device the kernel can page to. VRAM is a PCIe BAR; Linux has no
    swapon over a GPU buffer, and the driver cannot place anonymous pages there (the CPU
    reaching them would be a fault through a mapping the kernel would have to create on
    the swap path). Projects that do this (GPUswap, vramfs) are research prototypes that
    keep a CPU-side copy and move pages over PCIe — which is exactly what this emulator
    already does better, because it knows which pages the GPU is about to read.
  • The emulator does have the equivalent, and it is already on. Title pages are moved
    onto the card within a window (VICTORY_UM_VRAM_MB, default the card's size minus
    12 GiB) and are read from the card by the GPU at their own address — that is
    page residency: 1,736 MB of 5,956 MB of paged title memory on the card. What it
    cannot do is unmap the rest: the title may touch any of its memory from the CPU at
    any moment, so its pages must stay in the process's address space, and those pinned
    mappings are the 7.8 GB. That is the real answer to "why can't the free VRAM carry it":
    the GPU-visible copy is not a substitute for the CPU-visible one, it is an addition.
  • The one GPU-side number that does matter is the aperture. mem_info_gtt_total is
    7,948 MB here (exactly ttm.pages_limit × 4 KiB), and the run reaches it. Writing
    ttm.pages_limit live did not help (Update 14): the GART size is fixed at driver
    init, so it takes the boot parameters. Upstream issue #54 reports the same lever
    working: amdgpu.gttsize=12288 ttm.pages_limit=3145728 took that machine to the 3D
    intro cinematic
    before the black world (Update 13's cause) stopped it. Worth doing on
    this machine too, with the caveat that on 15.5 GB of RAM a bigger aperture only lets the
    title pin more of the same RAM.

Auto-clicks for the menu that waits

VICTORY_AUTO_PRESS=<seconds> (AUTO_PRESS=1 in run.sh) sends a real left click that
often, through SendInput, while one of our windows is in front — the way the title's
window messages and the cursor's own state both see it. Off unless asked for, and
documented as a menu-passer: in the world the same click is a shot.

Verified: auto press a left click every 1 s while our window is in front (VICTORY_AUTO_PRESS) and VICTORY_AUTO_PRESS: clicks sent clicks=1 in a live run.

The five issues, and what each adds here

issue what it says what it changes here
#54 raising GATT (amdgpu.gttsize=12288 ttm.pages_limit=3145728) gets to the 3D intro; the world is then black the aperture lever is real and it needs the boot parameter (a live ttm.pages_limit write does nothing, measured); the black world is Update 13
#89 put OptiScaler's FSR 4 DLLs in deps/fsr4/ (worked on an RX 6700 XT) the other way to keep FSR on Series S: ./setup.sh fsr4 + VICTORY_FSR_4K, which is the path where FidelityFX's PC build does the upscaling
#62 RDNA4, 5800X, 32 GB: menus draw, world stays black after the account picker; draws=6 the same signature as this machine (draws collapses, frame rate fine), i.e. a missing post/upscale pass rather than a slow or culled world
#71 RDNA3 7800 XT: 28.6 fps median with 94,215 pipelines warm; ~4,500 dispatches/frame; GPU busy 89 % frame-time context for after this machine gets past the wall: the title is dispatch-bound on RDNA3, not bandwidth-bound
#85 the same 7800 XT, frame-time decomposition: unified memory is not the limit (7–14 % of PCIe), barrier storm already collapsed confirms that the unified-memory path is not what costs frames, so tuning it for speed is pointless — it is a memory-capacity feature here

Applied after the above: the aperture on the kernel command line

grubby --update-kernel=ALL --args="amdgpu.gttsize=12288 ttm.pages_limit=3145728" is in
every GRUB entry of this machine (four of five; the fifth is not a Linux entry). It takes
effect on the next boot. Revert with the same command and --remove-args.

What it should change, if upstream issue #54's result carries over: MemAvailable is no
longer forced to zero by the aperture at 7,948 MB, so the run gets past the point where
the kernel refuses a command submission, and the title reaches its 3D intro. What it
cannot do is make 15.5 GiB of RAM hold 12 GiB of pinned memory plus a desktop, so the
outcome to watch for is either further (good) or a clean out-of-memory kill in place of
a lost device (also better: the log says which allocation wanted what).

Check after the reboot, before starting the game:

cat /sys/class/drm/card*/device/mem_info_gtt_total   # 12,884,901,888 if it took

Update 16 — confirmed: the world draws

The run after the reboot, with every fix above in place and no extra settings beyond
CONSOLE=series-s:

resolution: settings' output size applied (1920x1080) at title+0x224352b: Done
resolution: upscaler picker (returns 6) at title+0x7e93f0: Done
page residency: 2520 MB of 5956 MB of paged title memory on the card,
                card room for the title 8176 MB, 5317 MB of the card free
unified memory: 5244 MB in RAM, 2664 MB in VRAM in 33 pools shown at 59593 places
frame presented … frame=4096 draws=4845773 drawn=3531653 dispatches=2758680
frames presented 4,096+ (session 2 min 42 s, ended by closing the window: window closed: suspending the title)
draws in the last reported window 4,845,773 (~2,366 a frame — the 3D world, where the run before it never passed 21)
dispatches in the same window 2,758,680
host GPU failures, exceptions, int3 0, 0, 0
amd_fidelityfx_upscaler_xbox.dll never loaded (0 occurrences)
mem_info_gtt_total 12,288 MB — the boot parameters took

What each fix contributed, measured

  • The aperture is what stopped the device loss. With it at 7,948 MB every run died at
    ~3,000 frames with Not enough memory for command submission; at 12,288 MB the same
    configuration reaches the world. The title uses the room: 2,664 MB resident on the card
    against 1,880 MB before, while the RAM side fell from 5,964 MB to 5,244 MB, and the card
    still had 5,317 MB free at the end.
  • The upscaler is what made the world visible. Draws per frame going from 21 to 2,366
    while the frame rate stays sane is the whole difference between the black scene and the
    world: the geometry was already being submitted, its post chain was not producing an
    image.
  • The 1080p default is what kept the title from killing itself on Series S's 1277 MB
    layout (Update 10).

The aperture is now checked, not just documented

run.sh reads mem_info_gtt_total before a play run on a short machine and, when it is
under 10 GiB, says so and gives the command to fix it — because the one thing that mattered
here is not a setting in run.conf and cannot be discovered from the game's log. The
README.md memory section carries the same command.

What is still open (all recorded above)

  1. Series X still dies at +0x2215c35, in its 2199 MB tile heap, before any of the
    above is reached. Its pool is the next thing to measure; the output size is the first
    lever to try (VICTORY_OUTPUT=1920x1080 VICTORY_RENDER_SCALE=0.75).
  2. FidelityFX's console upscaler still draws nothing (Update 13) — the default now
    routes around it; making it work is what upstream issue #92 is really about, and
    ./setup.sh fsr4 + VICTORY_FSR_4K is the working alternative today.
  3. The menu waits for a click (VICTORY_AUTO_PRESS, Update 15).
  4. 195 shader containers hold hull/domain/geometry programs only and stop nothing
    (Summary, item 3).
**@⁠Finalizator** on GitHub · 2026-12-02 14:36 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/196#issuecomment-7348821365) Part 2 16–31 blocks, **94 MB held**, at the moment of the assert — with every block returned on drop. The layout is 1277 MiB; we are not filling it. The title's own allocations fill the rest, and its allocator then fails on the 2 MiB request. ## Ruled out so far (all by experiment, one run each) | factor | test | result | |---|---|---| | FidelityFX vs the title's upscaler | `VICTORY_UPSCALER=6` | same assert (size changes to 8.5 MiB) | | card room for title memory | `VICTORY_UM_VRAM_MB=15000` | same assert | | page migration | `VICTORY_PAGES=0` | same assert | | our pages exhausted | `first_page` counts: `0x33500..0x130400` | address is a size, not a page number | | our allocator refusing | warning on null from the title's allocator | never fires | | our blocks filling the layout | counters: 94 MB / 1277 MiB | not it | | the guard itself | `VICTORY_PAGE_CHECK=off` | next assert on the null block | ## Next step Watch the layout while it fills: read the object at `current_layout()` (title `+0x4FC99C0`), print its words every second, and see which field climbs to the 1277 MiB — `+0x30` is the extent seen at the crash. If the layout's high-water mark is its size, the question becomes what the title frees and we do not, and the same readout says whether the free path is reached at all. --- # Update 8: watching the layout, and what its vtable really is `VICTORY_LAYOUT_WATCH=1` (new, `apps/victory/src/run.rs`) reads the title's layout object (static at `title+0x71c2808`) once a second and logs its words. Series S: ``` layout watch flag=0x1 base=0x98bc00000 extent=0x4fd00000 map_at=0x6ffff99428b0 w10=0x6ffff9bc38b0 ... same for 8 s ... layout watch flag=0x1 base=0x98bc00000 extent=0x4fd00000 map_at=0x6ffff99428b0 w10=0x960dc6550 VIctory: first-chance exception 0x80000003 ... +0x2219650 ``` So the object is **re-configured in place**: `w10` (+0x10) flips from a heap pointer to a value in the unified space (`0x960dc6550`) in the second before the fatal, and at the crash `+0x20` reads `0x98c000000` (4 MiB above the `0x98bc00000` seen while watching) while `+0x30` stays `0x4fd00000`. It is one global "current layout" that is pointed at a different region as the title's pools come and go — which is why the fatal's numbers differ from run to run and from upscaler to upscaler. ## The vtable is an interface, not one method The entries captured at the crash are thunks into a bigger table: ``` [0] +0x221a620 the "find a block" we read: map lookup at +0x38, base +0x20, miss = 0xFFFFFFFF [1] +0xbb7060 mov (%rcx),%rax ; jmp *0x48(%rax) <- another method of the same interface [2] +0x53ea000 [3] +0x4380 ``` So the layout is an object with at least 0x50 bytes of methods; the allocation the guard wanted is the one initiated from the caller (`+0x2474690`), which reaches `[0]` with (size, alignment). The next step is to read the runtime table at `vtable+0x48` (the same way the `[0]` entry was read) and disassemble that method — that is the "allocate" half, and it will say which field of the object it compares against (base + extent, or a separate high-water mark). ## Instrumentation now in the tree (all opt-in, all documented here) | switch | what it does | |---|---| | `VICTORY_LAYOUT_WATCH=1` | logs the layout object's words once a second | | `VICTORY_PAGE_CHECK=off` | skips the title's "must not fail" guard (diagnostic only) | | `VICTORY_HANG_WATCHDOG=<units>` | replaces the title's stall deadline | | `VICTORY_UM_VRAM_MB=<MiB>` | caps the card's room for title memory (default 8176 MB here) | | `VICTORY_UPSCALER=6` | the title's own upscaler instead of FidelityFX (now the Series S default, Update 13) | | `VICTORY_CONSOLE_MB=<MiB>` | the memory the title is told it has (adapter description and `XMem`), over the console's figure | | `VICTORY_AUTO_PRESS=<seconds>` | a real left click that often while our window is in front (Update 15) | | `VICTORY_ALLOC_ID` / `_MEMORY` / `_PAGES` | the title allocator's attribute bits, for comparing pools | | `VICTORY_MEMORY_REPORT=title` | the memory figure the title is told, without the layer's own copy | | `VICTORY_NATIVE_COMPUTE`, `VICTORY_NATIVE_GRAPHICS` | device methods 0x218 / 0x1c8 built from the title's own program pieces | | `VICTORY_CAPTURE=<folder>` | presented frames as PNG (diagnostics build), what Update 13 was read from | | `VICTORY_PAGES=0` | no page migration | Crash reports now print, for any `int3`: the object at `rbx` (vtable, flag byte), the words of the object, the vtable's first four methods, and what `rdx`/`r8` point at. --- # Update 9: the pool is 99.96% full — measured The first crash log with placement logging (`VICTORY_LOG=info,victory_gpu::resource=debug`) holds enough to measure the title's own pool directly: | | | |---|---| | placements logged | **3788** | | distinct addresses | **3574** (214 reused, 5.6 %) | | highest address | `0x9DBC70000` | | pool end (`base + extent`) | `0x9DBD00000` | | **headroom when the 2 MiB request failed** | **576 KB** | So the allocation the guard makes is not a bookkeeping accident: the pool really is full. Its high-water mark only ever grows (3291 monotonic steps, 5.6 % reuse), which is what a streaming title looks like before it starts recycling. The pool is the one the title itself asks for: `XMemVirtualAlloc` of 1277 MB at `0x98BC00000` (`title memory asked for as protection 0x2404, kind 0x203000, flags 0x283`), Series S. On Series X the same line says 2199 MB. Both scale with the console's memory budget (1277/2199 ≈ 8 GB/13.5 GB), so the *sizing* is the title's own and follows the profile — it is not something we hand it. ## Additional facts from this round * **Scatter page mapping works and is used**: the title maps its big spans through `XMemMapPhysicalPagesScatter` (8 calls: `n=6720 first=0x143000000`, `n=4136 first=0x163000000`, ...), so physical-page machinery is not the missing piece. `XMemMapPhysicalPages` itself is never called — that is normal, the scatter form covers the same ground. * **The title never asks for its memory statistics**: `XMemGetWorkingSetStatistics` is not called at all in a Series S run (0 lines), so the figures we report there (`title_limit` 7.59 GiB for Series S, `used` = the process's commit) do not shape its budget. `VICTORY_MEMORY_REPORT=title` was added anyway (reports the commit less the unified memory) but it cannot be the fix for this. * **The allocator id does not choose the pool**: `VICTORY_ALLOC_ID=0` behaves exactly like the default 128 (all ids resolve to the same node in the title's registry). * **`VICTORY_ALLOC_MEMORY` / `VICTORY_ALLOC_PAGES`** are now there to test the memory type and page-size bits the same way, without a rebuild: `resources: attributes for the title's allocator overridden id=… memory=… pages=…`. ## Where the remaining question is The pool fills with the title's *own* placements, and it does so on a profile-sized budget. Two candidate explanations, and how to tell them apart: 1. **The title should be reusing that pool but its free path never runs here.** Log the placements' lifetimes: pair each `resource at an address` with the release that follows it (our object's `Release` reaching zero), and see whether the addresses the title hands back ever reappear as placement sites. 214 of 3578 do; on a run that survives they should be far more. 2. **The placements should be going somewhere else on console** — the 16 GiB spans it reserves (`0x143000000`, `0x163000000`, `0x183000000`) rather than the small layout. That would be decided by the resource's memory class, i.e. by `resource_attributes` (our guess) or by a flag in the desc that we ignore. The cheapest next probe for (2): run with `VICTORY_ALLOC_MEMORY` at each value 0–3 and compare the pool's high-water mark at the crash (the placement log gives it directly). If one value stops the layout from filling, that is the missing attribute, and the fix is one constant. ### Tested: memory type 2 `VICTORY_ALLOC_MEMORY=2` gives a byte-for-byte identical run: **3788 placements, same highest address `0x9DBC70000`**. Together with `VICTORY_ALLOC_ID=0` doing nothing, this says the 3788 placements are the title's **own** decisions (`resource at an address` = memory the title mapped itself and handed to `CreateCommittedResource`), not something our attribute word steers. So (2) above — "the placements should go elsewhere" — cannot be reached by changing what we ask the allocator for; the choice happens inside the title, from data we don't supply. That leaves (1): the pool is filled by the title's own streaming at a pace that, on this emulation, outruns its reuse. The measurement to make next is the one that decides it — for each of the 3788 placements, does the title ever *release* it (does our object's `Release` reach zero and does the address come back as a placement)? 214 of 3578 addresses do come back; if a surviving run reuses far more, the difference is what to chase next. ## Update 10 — the Series S assert was a budget, not a bug: the output size decides it **It runs.** `./run.sh play CONSOLE=series-s` with `VICTORY_OUTPUT=1920x1080` reached **frame 12094** (5.6 minutes, ~36 fps average on the presented frames), zero exceptions, `busy_percent=99.97` throughout, and the log still advancing when it was stopped by hand. The same binary, same cache, same profile at the default `2560x1440` had died at `title+0x2219650` within thirty seconds on every one of four attempts. ### What changed between the two runs Only the output size. Everything else — profile, budgets, allocator attributes, page sizes, migration — was identical, and the runs previous to this one had already ruled out each of those individually (`VICTORY_UPSCALER`, `VICTORY_UM_VRAM_MB`, `VICTORY_PAGES`, `VICTORY_ALLOC_ID`, `VICTORY_ALLOC_MEMORY`). So the assert is not a bug in our HLE; it is the title reacting, correctly and fatally, to a memory budget that its own streaming plan does not fit into at 1440p. ### Why the size changes the title's appetite The Series S profile reports 7,776 MB, and the title takes 16 % of whatever it is told for its own GPU layout object (the pool measured in Updates 6–9): | profile | budget reported | layout requested | filled at the assert | |---|---|---|---| | Series X | 13.5 GiB | 2,199 MB | tile heap dies earlier, `+0x2215c35` | | Series S | 7,776 MB | 1,277 MB | **99.96 %**, next 2 MiB refused → `int3` | At 2560x1440 the title streams 1,129 MB of placements into that 1,277 MB pool before it has presented its first frames; the 3,789th placement gets `0xFFFFFFFF` back from its own lookup (`+0x221a620`, map at `+0x38`) and the flag at `layout+0x18` turns that into `int3`. At 1920x1080 the same streaming settles at 1,043 MB and then *reuses* addresses the title releases — total placed bytes climbed past 3,082 MB while the high-water mark stayed inside the pool, because releases finally outpace new placements once the first-load burst is smaller than the pool instead of almost exactly equal to it. That asymmetry is the whole story: the pool is sized for the console's own 1440p output, and we were asking for 1440p *plus* a PC-sized first-load burst (larger because nothing was pre-warmed, so the title could not stream patiently). ### The fix `apps/victory/src/run.rs`, `output_default()`: when `--console series-s` is used and `VICTORY_OUTPUT` is not set, the output defaults to `1920x1080` instead of 2560x1440, and the run says so: ``` output size 1920x1080 (Series S: 1440p fills the pool the profile leaves the title) ``` An explicit `VICTORY_OUTPUT` still wins — nothing is taken away from a user who wants to try 1440p on a machine with more headroom, or who wants the crash for a report. ### What this means for Series X Series X dies from the same class of problem one step earlier, at `+0x2215c35`, in the tile heap rather than this layout, and its pool is 2,199 MB instead of 1,277 MB. The output-size lever should be tried there too (a 1440p render with a 1080p output is `VICTORY_OUTPUT=1920x1080 VICTORY_RENDER_SCALE=0.75`), and the same measurement (pool high-water mark at the moment of death) tells whether it helps. Not yet tested. ### Still worth doing (not blockers) * The pool's `+0x18` flag makes a failed allocation fatal. On a PC a failed GPU allocation is a normal, recoverable condition, so the title's own "not found is fine" path at `+0x4fac403` is arguably the correct behaviour here — `VICTORY_PAGE_CHECK=off` already proves the guard can be stepped over, but skipping it would leak the budget problem into later frames instead of solving it. Left as a diagnostic. * The Series S profile could report the console's real output resolution to the title (it is told 3840x2160 by `VICTORY_DISPLAY_MODE`) so that its asset tiers match the profile it believes it is on. Today the display mode is 4K while the output is 1080p, which is why the first-load burst is bigger than a console's. ## Update 11 — what stops Series S now: the host's RAM, not the card With the 1080p default in place, a fresh run gets past the layout assert and presents frames — and then dies with the device removed. The kernel says why: ``` amdgpu 0000:2b:00.0: [drm] *ERROR* Not enough memory for command submission! (x6) amdgpu 0000:2b:00.0: [drm] VM memory stats for proc main(...) task vkd3d_queue(...) is non-zero when fini VIctory: host GPU failure: host GPU device removed after 1 submissions sent ahead of 5 lists; device removed: 0x887A0005 ``` `Not enough memory for command submission` is `amdgpu_cs_ioctl` failing to allocate the job/IB in **kernel memory**. It is not a driver bug and not a bad shader: the machine has no memory left to give. ### Measured, 0.5 s sampling of `mem_info_vram_used`, `mem_info_gtt_used`, `MemAvailable` | run | cgroup cap | peak VRAM | peak GTT | lowest `MemAvailable` | result | |---|---|---|---|---|---| | `CONSOLE=series-s` (new default) | 7906 MiB | 7544 MB | 7948 MB | **2171 MiB** | 12 frames, device removed | | `+ VICTORY_CONSOLE_MB=7168` | 7906 MiB | 7410 MB | 7791 MB | **1537 MiB** | 13 frames, device removed | | `+ KEEP_FREE=512` | 11348 MiB | 7402 MB | 7865 MB | **1274 MiB** | 12 frames, device removed | Three different caps and two different memory figures give the same death, at the same point, with the same kernel message. So the cgroup limit is not the cause (raising it by 3.4 GiB changed nothing but the final `MemAvailable`), and the figure the adapter reports is not either — this title never asks `IDXGIAdapter::GetDesc` (the `VICTORY_CONSOLE_MB` log line never appears), it sizes everything from the console profile it is told. ### What the numbers say * The card is **not** the problem: 7.4 GB of 20 GB in use, 13 GB free, while the host runs out of RAM. * The host is: **GTT ≈ 7.8 GB** — the title's host-visible graphics memory, which the driver pins in system RAM — plus ~2.7 GB of the process's own working set, plus the desktop and page cache, against 15.5 GiB of RAM. `MemAvailable` bottoms out at 1.3–2.2 GiB and the next kernel allocation on behalf of the GPU fails. * GTT and VRAM track each other almost exactly (7.8 GB ↔ 7.4 GB), which is the shape of a mirror: the title's memory sits in system RAM and a window of the same pages is resident on the card. That is precisely the arrangement the machine cannot afford: the console had one pool shared by both, and this emulation needs a copy in each. It is also the honest answer to "the card has 13 GB free, why is it swapping": nothing in the title's own plan puts its memory on the card *instead of* in RAM; the card only gets the pages it recently touched. ### Why a earlier run got 12094 frames and these do not The first 1080p run (Update 10) held on for 12094 frames with the same settings. The difference is headroom, not logic: the pipeline cache has since grown to 3.3 GB (the 89 229-pipeline warm), and each attempt now starts a few hundred MiB lower and crosses the line the previous one just missed. On a 15.5 GiB machine this configuration is on the edge, and the edge decides. ### What is in the tree now * `run.sh`: `CONSOLE=series-s` defaults `VICTORY_OUTPUT` to `1920x1080` and says so (Update 10). An explicit `VICTORY_OUTPUT` still wins. * `apps/victory/src/run.rs`: the same default in the binary (`output_default`), for runs that do not go through `run.sh`. * `crates/victory-gpu/src/dxgi.rs`: `VICTORY_CONSOLE_MB` overrides the standard memory the adapter description reports. Useful for titles that ask; this one does not, so it is a no-op here and is documented as such. ### What would actually fix it, in order of value 1. **Keep the title's GPU-only memory out of GTT.** The card has 13 GB free; if allocations the title marks GPU-optimal were backed by VRAM instead of pinned system RAM, ~7 GB of RAM would come back and the whole configuration would fit. This is the same lever the earlier update explored from the `resource_attributes` side, but the question to answer is different: not *where in the title's address space* a resource lands, but *which heap our HLE hands it*. `ram=5 vram=Some(3)` in the unified-memory log line says we have three VRAM heaps to offer. 2. **Stop mirroring.** If the 7.8 GB GTT really is a shadow of the 7.4 GB VRAM window, the window should be allowed to be the only copy for read-only GPU data. 3. **Give the run less to keep resident**: `VICTORY_UM_VRAM_MB` (smaller window), a smaller pipeline cache, and a desktop that is not holding 2 GB. None of these is a one-line change, and none is proven yet; they are recorded here as the next experiments rather than as fixes. ## Update 12 — ~~the fix: the card window decides how much the host must back~~ (wrong) > **Withdrawn — see Update 14.** The conclusion below came from a run that was stopped by > hand at frame 303, before the point where every other run dies. At 4,062 MB and at > 8,176 MB the title's memory and the failure are identical, and the auto-half-window this > update added to `run.sh` has been removed. What actually fixed it is the aperture, in > Update 15. The measurement below is kept because the numbers are real; the conclusion > drawn from them is not. Update 11 ended with "the host's RAM, not the card". This update thought it closed it. ### The measurement that decided it One number, moved on purpose: `VICTORY_UM_VRAM_MB`, the room the title is given on the card. Everything else identical to the run that died. | card window | peak VRAM | peak GTT (pinned in RAM) | lowest `MemAvailable` | result | |---|---|---|---|---| | 8176 MB (default: 20 GB card − 12 GiB host reserve) | 7544 MB | 7948 MB | 2171 MiB | died, 12 frames | | **4096 MB** | 4036 MB | **6440 MB** | **3809 MiB** | **ran, frame 303 and still presenting** | The residency line says it plainly: ``` card window 4096 MB: page residency: 1697 MB of 5956 MB of paged title memory on the card unified memory: 6071 MB in RAM, 1841 MB in VRAM in 43 pools ``` So the window is not "extra memory on the side": **it is what decides how much of the title's memory the host has to hold**. Take 4 GB off the window and ~1.5 GB comes off GTT and ~1.6 GB comes back to `MemAvailable`. Give the title 8 GB of the card and the host has none left for the kernel's own allocations. That is why the three failures in Update 11 were all identical: they were all giving the title 8 GB it could not afford, and none of the caps or budget figures changed that. ### The fix, in `run.sh` When the play run is short of memory (the existing `cap < 12288` case, i.e. the title commits more than the machine has), the card window now defaults to **half of what the run can hold**: ```sh VICTORY_UM_VRAM_MB=${VICTORY_UM_VRAM_MB:-$((cap/2))} echo "memory: the card window is ${VICTORY_UM_VRAM_MB} MiB (the host backs the rest)" ``` On this machine that prints `memory: the card window is 4008 MiB (the host backs the rest)`, which is the value proven above. An explicit `VICTORY_UM_VRAM_MB` still wins, and machines with enough RAM (24 GiB and up) never take this branch, so they keep the full card. ### Verified `./run.sh play CONSOLE=series-s` with no other settings, 2026-12-01: ``` output size: 1920x1080 (Series S: 1440p fills the pool the profile leaves the title) memory: the card window is 4008 MiB (the host backs the rest) page residency: 1357 MB of 5956 MB of paged title memory on the card, card room for the title 4008 frames presented, 0 host GPU failures, title alive and presenting ``` Nothing was skipped to get there: no `VICTORY_PAGES=0`, no guard patch, no raised watchdog. The title's own layout assert, the tile heap fatal and the kernel's submission failure are all gone at these settings, for the same reason: the title is no longer being sold more memory than the machine can back. ### Why this is also the right shape of a fix The console had one pool that both the CPU and the GPU used. This machine cannot place the title's whole working set in the card (it has the room) *and* keep a copy the CPU can reach (it does not have the RAM). The honest configuration is therefore to keep the card's share of it modest and let the host hold the rest — which is what the window now does automatically, and what the user's earlier question ("why not use the 10 free GB of RAM and the free VRAM 1:1?") pointed at: the 1:1 arrangement is exactly what does not fit, and half of it does. ## Update 13 — the black 3D world on Series S: FidelityFX's console upscaler **This is the black screen the title's own window shows once it is past the loading screens**, and it is what the reporter's log was pointing at all along. Line 5830 of the run of 2026-12-02 13:22: ``` WARN victory_hle::modules::kernel: a host DLL outside the host policy: refused dll="amd_fidelityfx_upscaler_xbox.dll" title dll amd_fidelityfx_upscaler_xbox.dll at 0x6ffff17f0000 (loaded by the title) bound amd_fidelityfx_upscaler_xbox.dll: 7 hle, 79 host, 0 title, 0 missing ``` The captures say the same thing from the other side. Every frame we saved is *not* black — the key art, the loading screens and their transitions render, with mean brightness 36 → 170 of 255 — and every one of them is a 2D screen. The 3D world is drawn into a render target that only the upscaler puts on screen, so it is the upscaler's absence that is black. ### What the title does `title+0x7e93f0` is the upscaler picker: it returns **6**, the title's own upscaler, except on Series S, where a flag makes it return **7**, the console's AMD FidelityFX (`amd_fidelityfx_upscaler_xbox.dll`). The render scale and the whole post chain follow from that choice (`resolution.rs` documents both paths). On Series S the title therefore asks for FidelityFX, gets a console DLL we do not implement, and its passes draw nothing. That is why this symptom is tied to the profile and not to the card: | report | card | Series X | Series S | |---|---|---|---| | this machine | RX 7900 XT (RDNA 3) | runs, world draws | **black world**, HUD and UI fine | | upstream #6, ramc1312 | RX 7900 XTX (RDNA 3) | draws, two 45–50 min sessions | **black**, ~43 fps, ~4,700 draws a frame | | upstream #6, Mylloon | RX 6650 XT (RDNA 2) | works | black | | upstream #6, alexfran111 | RX 9060 XT (RDNA 4) | (ran out of RAM) | **black**, then draws with `VICTORY_UPSCALER=6` | Four machines, three generations, one variable: the profile. Upstream issue #92 asks the same thing from the other end ("enable the FSR on series S, black screen should disappear"), and a reporter there turned FSR on and still had black, which fits: it is not FSR being off, it is *FidelityFX's console upscaler* being the path taken. ### The fix Series S now picks the title's own upscaler unless told otherwise (`apps/victory/src/run.rs`, `upscaler_default`, and the same in `run.sh`): ``` upscaler: the title's own (Series S: FidelityFX's console upscaler draws no 3D here; VICTORY_UPSCALER=7 asks for it anyway) resolution: upscaler picker (returns 6) at title+0x7e93f0: Done ``` An explicit `VICTORY_UPSCALER` still wins, and `VICTORY_FSR_4K` is left alone — that path needs the picker to return 7, because there FidelityFX's *PC* build (`./setup.sh fsr4`) does the work through `victory-hle`'s FidelityFX module instead of the console DLL. ### Verified here * The patch applies: `upscaler picker (returns 6) … Done`, and the run says so. * `amd_fidelityfx_upscaler_xbox.dll` no longer appears in the log at all (0 occurrences, against a refusal, a load and 79 host bindings without the fix). * The loading screens still render identically (captures compared). What is **not** verified on this machine is the world itself: every run here dies before it (Update 14), so the confirmation that the world draws with this setting comes from the reporters above — including one on the same card family (RX 7900 XTX, Mesa RADV 26.3.1 with this repo's `mesa.patch`, Proton, series S at 1920x1080). ### Why FidelityFX's console upscaler draws nothing (not chased) Its 79 imports bind to host D3D12, so the DLL's own code runs and does its dispatches; it is the *result* that never appears. Candidates, in the order worth checking: the DCC (color-compression) options in the console's resource descriptions — the fork already stubs `CreateCommittedResourceX` at device slot 0x260 for exactly this DLL, noting "its description is PC's plus DCC options, which we have no use for"; the jitter/phase-count handshake; and the console's own output surface semantics. `./setup.sh fsr4` plus `VICTORY_FSR_4K=<profile>` is the working alternative today (host FSR 4.1 at 4K), and it is the path upstream issue #92 is really asking for. ## Update 14 — the device lost at ~60 s is RAM, and the numbers that say so Every Series S run on this machine, with the black-scene fix in place, ends the same way about 3,000 frames (≈60 s) after the title starts: ``` amdgpu 0000:2b:00.0: [drm] *ERROR* Not enough memory for command submission! (x4–x19) vkd3d-proton: Failed to wait for Vulkan timeline semaphore, vr -4 (-4 = VK_ERROR_DEVICE_LOST) VIctory: host GPU failure: host GPU device removed after N submissions sent ahead of M lists ``` ### Measured at 100 ms resolution (the 2 s sampling of Update 11 missed the dip) | moment | MemFree | MemAvailable | title memory shown | VRAM used | |---|---|---|---|---| | during the run | 1.0–1.4 GB | 1.4–1.9 GB | 7,844 MB (5,964 RAM + 1,880 card) | 7.4–7.9 GB | | **at the failure** | **129 MB** | **130 MB** | same | same | The kernel fails a small allocation while the card has **13 GB free**, because the host has 130 MB. The title's 7.8 GB is host-visible graphics memory: pinned, and not swappable, so neither zram nor the 17 GB of disk swap can help with any of it. ### What was tried against it, and what each measurement showed | change | expectation | measured | |---|---|---| | card window `VICTORY_UM_VRAM_MB` 4062 MB | half of the title's memory stays on the card, host backs less | title memory still 7,844 MB, GTT unchanged, dies at the same frames | | card window 8176 MB (the default) | fewer page copies | identical | | `VICTORY_PAGES=0` | no migration churn | identical (dies at frame 2790) | | pipeline library removed (7.9 GB of `.pso`, 99,230 pipelines) | our driver memory drops | identical (dies at frame 3023) | | `ttm.pages_limit` raised 2,034,833 → 3,145,728 pages (7.9 → 12 GiB) at runtime | the aperture was the limit | **no change**; the `-ENOMEM` is not the TTM page limit | | `VICTORY_CONSOLE_MB=6144` (the figure `XMem` and the adapter description give) | the title streams against a smaller budget | title memory 6,003 MB RAM + 1,841 MB card = **7,844 MB, unchanged**; dies at frame 2,862 | So the aperture and the knobs are not the constraint: **16 GB of RAM is**. Note that `mem_info_gtt_total` (7,948 MB) is exactly `ttm.pages_limit` × 4 KiB, and the run's GTT reaches 7,948 MB, which is why it *looked* like an aperture limit — but raising the limit did not move the failure, and `MemAvailable` says the machine is empty at that moment. ### Correction to Update 12 Update 12 claimed the card window decides how much the host must back, from a run at 4,096 MB that was watched for 303 frames and then stopped by hand — before the point where every other run dies. It does not: at 4,062 MB and at 8,176 MB the title's memory and the failure are the same. The auto-half-window that Update 12 added to `run.sh` has been removed; what is left there is a warning with the measured figure. ### What would actually help, in order 1. **More RAM** (32 GB): the title's 7.8 GB is not compressible, not swappable and not avoidable — it is the console's unified memory, and on a PC it must exist in system RAM to be host-visible. 2. ~~A smaller title budget.~~ **Tested, no effect.** The figure is the one `XMem` reports (`limit_mb=7776`) and the adapter description's, and both now read `VICTORY_CONSOLE_MB` (one helper, `console::standard_memory`). At 6,144 MB the title's memory is byte for byte the same, which matches the note in `console.rs`: the title sizes nothing from that figure, it goes by the device type. The knob is kept because it is the right place for a title that *does* read it. 3. **Host memory out of the way**: no browser, no compositor effects, a 4 GB desktop; that is the 1 GB the machine is missing. ## Update 15 — zram, "VRAM as swap", the GTT aperture, auto-clicks, and five upstream issues ### zram and the swap sysctls: measured, and what changed The machine runs the Fedora/Nobara default (zram 8 G zstd at priority 100, 17.1 G disk swap at −1, `vm.swappiness=100`, `vm.page-cluster=0`), documented in `NOTES-memory-zram.md`. Measured during these runs, zram holds **830 MB of data in 173 MB compressed** — 0.2 GB of the 15.5 GB, i.e. it is not what starves the run. What starves the run is the 7.8 GB of host-visible title memory the kernel cannot reclaim at all (Update 14), so no swap policy can touch it. Two changes are in `/etc/sysctl.d/90-victory-memory.conf` (live and persisted): | setting | before | after | why | |---|---|---|---| | `vm.watermark_scale_factor` | 10 | **50** | kswapd wakes sooner and refills the reserve before it is empty — the failure is a small kernel allocation refused at the margin | | `vm.min_free_kbytes` | 67,584 (66 MB) | **262,144 (256 MB)** | a reserve for exactly those allocations | | `vm.swappiness` | 100 | **left at 100** | tried 60 first: it changes nothing for an unevictable working set and costs the desktop; with swap on zram, 100 is the right direction | | `vm.page-cluster` | 0 | 0 | right for zram | Measured effect on the wall: **none.** With `min_free_kbytes` at 512 MB, watermark 50 and swappiness 60 the run died at frame 2,711 instead of ~3,000, i.e. the same place. The settings are kept at the milder values because they cost nothing and make a kernel allocation at the margin likelier to succeed; they are not a fix, and this update says so rather than implying otherwise. ### "Can we use GPU memory as swap?" No — not as swap, and not for this title. Concretely: * **Swap needs a block device the kernel can page to.** VRAM is a PCIe BAR; Linux has no `swapon` over a GPU buffer, and the driver cannot place anonymous pages there (the CPU reaching them would be a fault through a mapping the kernel would have to create on the swap path). Projects that do this (GPUswap, vramfs) are research prototypes that keep a CPU-side copy and move pages over PCIe — which is exactly what this emulator already does better, because it knows which pages the GPU is about to read. * **The emulator does have the equivalent, and it is already on.** Title pages are moved onto the card within a window (`VICTORY_UM_VRAM_MB`, default the card's size minus 12 GiB) and are read from the card by the GPU at their own address — that is `page residency: 1,736 MB of 5,956 MB of paged title memory on the card`. What it cannot do is *unmap* the rest: the title may touch any of its memory from the CPU at any moment, so its pages must stay in the process's address space, and those pinned mappings are the 7.8 GB. That is the real answer to "why can't the free VRAM carry it": the GPU-visible copy is not a substitute for the CPU-visible one, it is an addition. * **The one GPU-side number that does matter is the aperture.** `mem_info_gtt_total` is 7,948 MB here (exactly `ttm.pages_limit` × 4 KiB), and the run reaches it. Writing `ttm.pages_limit` live did **not** help (Update 14): the GART size is fixed at driver init, so it takes the boot parameters. Upstream issue **#54** reports the same lever working: `amdgpu.gttsize=12288 ttm.pages_limit=3145728` took that machine *to the 3D intro cinematic* before the black world (Update 13's cause) stopped it. Worth doing on this machine too, with the caveat that on 15.5 GB of RAM a bigger aperture only lets the title pin more of the same RAM. ### Auto-clicks for the menu that waits `VICTORY_AUTO_PRESS=<seconds>` (`AUTO_PRESS=1` in `run.sh`) sends a real left click that often, through `SendInput`, while one of our windows is in front — the way the title's window messages and the cursor's own state both see it. Off unless asked for, and documented as a menu-passer: in the world the same click is a shot. Verified: `auto press a left click every 1 s while our window is in front (VICTORY_AUTO_PRESS)` and `VICTORY_AUTO_PRESS: clicks sent clicks=1` in a live run. ### The five issues, and what each adds here | issue | what it says | what it changes here | |---|---|---| | **#54** | raising GATT (`amdgpu.gttsize=12288 ttm.pages_limit=3145728`) gets to the 3D intro; the world is then black | the aperture lever is real and it needs the boot parameter (a live `ttm.pages_limit` write does nothing, measured); the black world is Update 13 | | **#89** | put OptiScaler's FSR 4 DLLs in `deps/fsr4/` (worked on an RX 6700 XT) | the other way to keep FSR on Series S: `./setup.sh fsr4` + `VICTORY_FSR_4K`, which is the path where FidelityFX's **PC** build does the upscaling | | **#62** | RDNA4, 5800X, 32 GB: menus draw, world stays black after the account picker; `draws=6` | the same signature as this machine (`draws` collapses, frame rate fine), i.e. a missing post/upscale pass rather than a slow or culled world | | **#71** | RDNA3 7800 XT: 28.6 fps median with 94,215 pipelines warm; ~4,500 dispatches/frame; GPU busy 89 % | frame-time context for after this machine gets past the wall: the title is dispatch-bound on RDNA3, not bandwidth-bound | | **#85** | the same 7800 XT, frame-time decomposition: unified memory is not the limit (7–14 % of PCIe), barrier storm already collapsed | confirms that the unified-memory path is not what costs frames, so tuning it for speed is pointless — it is a memory-capacity feature here | ### Applied after the above: the aperture on the kernel command line `grubby --update-kernel=ALL --args="amdgpu.gttsize=12288 ttm.pages_limit=3145728"` is in every GRUB entry of this machine (four of five; the fifth is not a Linux entry). It takes effect on the next boot. Revert with the same command and `--remove-args`. What it should change, if upstream issue #54's result carries over: `MemAvailable` is no longer forced to zero by the aperture at 7,948 MB, so the run gets past the point where the kernel refuses a command submission, and the title reaches its 3D intro. What it cannot do is make 15.5 GiB of RAM hold 12 GiB of pinned memory plus a desktop, so the outcome to watch for is either *further* (good) or a clean out-of-memory kill in place of a lost device (also better: the log says which allocation wanted what). Check after the reboot, before starting the game: ```sh cat /sys/class/drm/card*/device/mem_info_gtt_total # 12,884,901,888 if it took ``` ## Update 16 — confirmed: the world draws The run after the reboot, with every fix above in place and no extra settings beyond `CONSOLE=series-s`: ``` resolution: settings' output size applied (1920x1080) at title+0x224352b: Done resolution: upscaler picker (returns 6) at title+0x7e93f0: Done page residency: 2520 MB of 5956 MB of paged title memory on the card, card room for the title 8176 MB, 5317 MB of the card free unified memory: 5244 MB in RAM, 2664 MB in VRAM in 33 pools shown at 59593 places frame presented … frame=4096 draws=4845773 drawn=3531653 dispatches=2758680 ``` | | | |---|---| | frames presented | 4,096+ (session 2 min 42 s, ended by closing the window: `window closed: suspending the title`) | | draws in the last reported window | **4,845,773** (~2,366 a frame — the 3D world, where the run before it never passed 21) | | dispatches in the same window | 2,758,680 | | host GPU failures, exceptions, `int3` | **0, 0, 0** | | `amd_fidelityfx_upscaler_xbox.dll` | never loaded (0 occurrences) | | `mem_info_gtt_total` | 12,288 MB — the boot parameters took | ### What each fix contributed, measured * **The aperture is what stopped the device loss.** With it at 7,948 MB every run died at ~3,000 frames with `Not enough memory for command submission`; at 12,288 MB the same configuration reaches the world. The title uses the room: 2,664 MB resident on the card against 1,880 MB before, while the RAM side fell from 5,964 MB to 5,244 MB, and the card still had 5,317 MB free at the end. * **The upscaler is what made the world visible.** Draws per frame going from 21 to 2,366 while the frame rate stays sane is the whole difference between the black scene and the world: the geometry was already being submitted, its post chain was not producing an image. * **The 1080p default is what kept the title from killing itself** on Series S's 1277 MB layout (Update 10). ### The aperture is now checked, not just documented `run.sh` reads `mem_info_gtt_total` before a play run on a short machine and, when it is under 10 GiB, says so and gives the command to fix it — because the one thing that mattered here is not a setting in `run.conf` and cannot be discovered from the game's log. The `README.md` memory section carries the same command. ### What is still open (all recorded above) 1. **Series X** still dies at `+0x2215c35`, in its 2199 MB tile heap, before any of the above is reached. Its pool is the next thing to measure; the output size is the first lever to try (`VICTORY_OUTPUT=1920x1080 VICTORY_RENDER_SCALE=0.75`). 2. **FidelityFX's console upscaler** still draws nothing (Update 13) — the default now routes around it; making it work is what upstream issue #92 is really about, and `./setup.sh fsr4` + `VICTORY_FSR_4K` is the working alternative today. 3. **The menu waits for a click** (`VICTORY_AUTO_PRESS`, Update 15). 4. 195 shader containers hold hull/domain/geometry programs only and stop nothing (Summary, item 3).
Author
Owner

@⁠Quagmire28 on GitHub · 2026-12-02 18:11 UTC · original

test it with this here, maybe it work for you too, i get 24-32 FPS but sand is black and a little flicker, but can drive around city and "play" it

VICTORY_OUTPUT=3440x1440
VICTORY_FULLSCREEN=1
VICTORY_FULLSCREEN_RES=3440x1440
VICTORY_PILLARBOX=1
VICTORY_FSR_4K=balanced
VICTORY_FIDELITYFX_FRAMEGEN=1
VICTORY_LOD_SCALE=0.38
VICTORY_VEHICLE_LOD_BIAS=1.6
VICTORY_SMALL_CULL=3.5
VICTORY_KEEP_GPU_WRITTEN=1
VICTORY_PLACED_COPIED=1
VICTORY_POOL_MOVE=1
VICTORY_PAGE_ADAPTIVE=1
VICTORY_PAGE_PASS_MS=200
VICTORY_PAGE_MOVE_MB=64
KEEP_FREE=4096
VICTORY_BVH_BUILDER=0
VICTORY_PANEL=full
VICTORY_LOG=warn

**@⁠Quagmire28** on GitHub · 2026-12-02 18:11 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/196#issuecomment-7354092687) test it with this here, maybe it work for you too, i get 24-32 FPS but sand is black and a little flicker, but can drive around city and "play" it VICTORY_OUTPUT=3440x1440 VICTORY_FULLSCREEN=1 VICTORY_FULLSCREEN_RES=3440x1440 VICTORY_PILLARBOX=1 VICTORY_FSR_4K=balanced VICTORY_FIDELITYFX_FRAMEGEN=1 VICTORY_LOD_SCALE=0.38 VICTORY_VEHICLE_LOD_BIAS=1.6 VICTORY_SMALL_CULL=3.5 VICTORY_KEEP_GPU_WRITTEN=1 VICTORY_PLACED_COPIED=1 VICTORY_POOL_MOVE=1 VICTORY_PAGE_ADAPTIVE=1 VICTORY_PAGE_PASS_MS=200 VICTORY_PAGE_MOVE_MB=64 KEEP_FREE=4096 VICTORY_BVH_BUILDER=0 VICTORY_PANEL=full VICTORY_LOG=warn
Author
Owner

@⁠kuscutv-jpg on GitHub · 2026-12-02 23:21 UTC · original · edited 2026-12-02 23:28 UTC

I finally managed to get the game running on my RX 9070 XT.

My system:

  • GPU: RX 9070 XT (16 GB VRAM)
  • CPU: Ryzen 5 7500F
  • RAM: 16 GB DDR5
  • OS: CachyOS
  • Swap: 32 GB SSD swap + 15 GB ZRAM

What worked for me:

  1. Added the following kernel parameters to GRUB:
amdgpu.gttsize=12288 ttm.pages_limit=3145728
  1. Increased MemorySwapMax=2G to MemorySwapMax=32G in run.sh.

  2. Initially launched the game with the following parameters:

KEEP_FREE=0
VICTORY_UPSCALER=6

After these changes, I was able to get past the black screen and GPU device removed (0x887A0005) errors and actually play the game.

I later removed VICTORY_UPSCALER=6 entirely, and the game continued to work without the black screen.

I also managed to run the game in Series X mode at 1440p with FSR 4 Quality, Frame Generation enabled, and Ray Tracing disabled.

Unfortunately, I still experience occasional stuttering, black textures, and eventually OOM crashes due to high system memory usage. Reducing the GTT limit to 10 GB caused the GPU device removed error to return, so I switched back to 12 GB.

The game is now playable, but memory usage remains the biggest issue on my 16 GB system.

Hopefully, this helps other RX 9070 XT users experiencing similar issues. Thanks for your work!

**@⁠kuscutv-jpg** on GitHub · 2026-12-02 23:21 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/196#issuecomment-7361898207) · edited 2026-12-02 23:28 UTC I finally managed to get the game running on my RX 9070 XT. **My system:** - GPU: RX 9070 XT (16 GB VRAM) - CPU: Ryzen 5 7500F - RAM: 16 GB DDR5 - OS: CachyOS - Swap: 32 GB SSD swap + 15 GB ZRAM **What worked for me:** 1. Added the following kernel parameters to GRUB: ```ini amdgpu.gttsize=12288 ttm.pages_limit=3145728 ``` 2. Increased `MemorySwapMax=2G` to `MemorySwapMax=32G` in `run.sh`. 3. Initially launched the game with the following parameters: ```ini KEEP_FREE=0 VICTORY_UPSCALER=6 ``` After these changes, I was able to get past the black screen and GPU device removed (0x887A0005) errors and actually play the game. I later removed VICTORY_UPSCALER=6 entirely, and the game continued to work without the black screen. I also managed to run the game in Series X mode at 1440p with FSR 4 Quality, Frame Generation enabled, and Ray Tracing disabled. Unfortunately, I still experience occasional stuttering, black textures, and eventually OOM crashes due to high system memory usage. Reducing the GTT limit to 10 GB caused the GPU device removed error to return, so I switched back to 12 GB. The game is now playable, but memory usage remains the biggest issue on my 16 GB system. Hopefully, this helps other RX 9070 XT users experiencing similar issues. Thanks for your work!
Author
Owner

@⁠deyvideguilherme on GitHub · 2026-12-03 11:20 UTC · original

I ran into the same 16 GiB MemAvailable / GTT pressure pattern on a similar Linux setup (Ryzen 7 5700X, RX 9060 XT 16 GiB, CachyOS, amdgpu.gttsize=12288 ttm.pages_limit=3145728, Proton Experimental).

If you're still looking at 16 GiB headroom on main:

  • run.sh already lowers the default KEEP_FREE on 16 GiB hosts and warns on low GTT (#226).
  • I also have #279 open for pool::STAGING: Pool::give() in crates/victory-gpu/src/pool.rs was holding returned upload-heap slices in resting for the full 5000 ms REST window used by TEXTURES, even though StagingPiece is only dropped after its upload copy fence finishes. Dropping the staging quarantine to 250 ms (leaving TEXTURES untouched at 5000 ms) cut pool::STAGING on my 16 GiB machine from 704 MiB p50 / 1920 MiB max down to 320 MiB p50 / 512 MiB max across two runs, brought peak active GTT down from 9062 to ~7663–7719 MiB, and kept MemAvailable above 1644 MiB (versus dipping down to 595 MiB before).

It's only been tested on my 16 GiB RADV/vkd3d-proton setup and targets GTT/host-RAM retention rather than FPS, but figured it was worth linking here while #279 is waiting for review.

**@⁠deyvideguilherme** on GitHub · 2026-12-03 11:20 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/196#issuecomment-7376558646) I ran into the same 16 GiB `MemAvailable` / GTT pressure pattern on a similar Linux setup (`Ryzen 7 5700X`, `RX 9060 XT 16 GiB`, CachyOS, `amdgpu.gttsize=12288 ttm.pages_limit=3145728`, `Proton Experimental`). If you're still looking at 16 GiB headroom on `main`: - `run.sh` already lowers the default `KEEP_FREE` on 16 GiB hosts and warns on low GTT (#226). - I also have #279 open for `pool::STAGING`: `Pool::give()` in `crates/victory-gpu/src/pool.rs` was holding returned upload-heap slices in `resting` for the full `5000 ms` `REST` window used by `TEXTURES`, even though `StagingPiece` is only dropped after its upload copy fence finishes. Dropping the staging quarantine to `250 ms` (leaving `TEXTURES` untouched at `5000 ms`) cut `pool::STAGING` on my 16 GiB machine from `704 MiB` p50 / `1920 MiB` max down to `320 MiB` p50 / `512 MiB` max across two runs, brought peak active GTT down from `9062` to `~7663–7719 MiB`, and kept `MemAvailable` above `1644 MiB` (versus dipping down to `595 MiB` before). It's only been tested on my 16 GiB RADV/vkd3d-proton setup and targets GTT/host-RAM retention rather than FPS, but figured it was worth linking here while #279 is waiting for review.
Author
Owner

@⁠wrz1911 on GitHub · 2026-12-03 14:16 UTC · original

Thanks for the detailed write-up — the GART/aperture note helped us rule that out (we have GTT 15.9 GB, ttm.pages_limit 4070713). One more failure mode we hit on 16 GiB / 24-thread: warm pipeline preparation hangs above 12 jobs (workers stop progressing, 45 s "unresponsive" lines, 0 done, no dmesg GPU errors); 10-12 works. May be oversubscription (workers x ~2 threads). Details: #325.

**@⁠wrz1911** on GitHub · 2026-12-03 14:16 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/196#issuecomment-7381168143) Thanks for the detailed write-up — the GART/aperture note helped us rule that out (we have GTT 15.9 GB, ttm.pages_limit 4070713). One more failure mode we hit on 16 GiB / 24-thread: warm pipeline preparation hangs above 12 jobs (workers stop progressing, 45 s "unresponsive" lines, 0 done, no dmesg GPU errors); 10-12 works. May be oversubscription (workers x ~2 threads). Details: #325.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/lobomfz--VIctory-xmem#196
No description provided.