Bug: GPU reset (TDR) on the first world frame since #352 (physical pages from 2 MiB sections), even with VICTORY_SECTION_MB unset #428

Open
opened 2026-11-26 18:22:09 +00:00 by github-bot · 2 comments
Owner

@⁠jean-melikian on GitHub · 2026-11-26 18:18 UTC · original

Summary

Since main includes #352 (ee8b92e1 "perf(victory): physical pages from 2 MiB sections (VICTORY_SECTION_MB, off by default)" and its merge ba38fae6), every session on my machine ends with a GPU reset (Windows TDR, nvlddmkm event 153) on the first world frame after loading a save, about 35-45 s after the story packs open. VICTORY_SECTION_MB is not set (default, off).

Reverting only #352's changes under third_party/victory (inplace.rs, victory-gpu/src/lib.rs, victory-hle/src/modules/xmem.rs, restored from cd5c44d) on top of ce0f90f removes the TDR: the game reaches the world, runs, and passes 5 stable minutes.

Environment

  • GPU: NVIDIA GeForce RTX 3080 Ti (12 GB), Windows 11
  • CPU: Ryzen 7 9800X3D, 64 GB RAM
  • Game build: my own copy (no game files attached)
  • Launch: victory.exe run <game exe> --execute directly (not through the launcher), same environment for warm and run
  • Session started from an in-world save (same save for every run below)

Bisection

Build Base Extra commits Result at the first world frame
cd5c44d perf-trial (#383) none OK: world reached, ~10 fps avg, M5 after 6:29
cd5c44d + #392 #392 OK: world reached, ~10.7 fps avg
ce0f90f + #392 (+ #381, #389, #350 in some runs) main TDR (5 runs: at 1:26, 1:56, 2:14, 2:31, and earlier variants)
ce0f90f main none of ours except an input patch (b73d28a2) TDR at 81 s, 35 s after story000 opened
ce0f90f without #352 main #352 files restored from cd5c44d OK: world reached at 101 s, 11.0 fps avg (best 30 s: 16.8), M5 reached

Other suspects were ruled out on the way:

  • VICTORY_HEAP_SCAN_ALT (#394): TDR with it unset and with =0 (we don't use the launcher, so it was never on).
  • #381 (VICTORY_KEPT_VIEWS_YIELD): TDR with =0.
  • #392: no TDR when added alone to cd5c44d.
  • #350, #389: TDR without them.

The only third_party/victory commits in cd5c44d..ce0f90f are ed60e312 (#394), ee8b92e1 and ba38fae6 (#352).

What I ran

victory.exe warm <all .rpf of the game dir>        # same env as below
victory.exe run <game dir>\game_scarlett_master.exe --execute

Environment (identical for every run in the table):

VICTORY_OCEAN_READBACK=0  VICTORY_CARD_WINDOWS_MB=1536  VICTORY_CARD_BUFFERS_MB=1536
VICTORY_TEXTURE_ROOM_PERCENT=93  VICTORY_HEAP_PASS_DIRTY=1  VICTORY_COPY_COALESCE=256
VICTORY_WINDOW_SKIP_SAME=1  VICTORY_MERGE_SUBMISSIONS=1  VICTORY_PAGE_WRITES=5
VICTORY_STEP_INDEX=1  VICTORY_CARD_SYNC_BATCH=1  VICTORY_PARALLEL_REFRESH=1
(plus the Neptune 2026-11-25c tuned set from the old launcher; VICTORY_SECTION_MB unset)

Expected

Same behaviour as cd5c44d: the world loads and the game keeps running.

What happened

On ce0f90f, the first world frame is very heavy in copies, then the driver resets the GPU about 5 s later.

ce0f90f (TDR), last host line before the reset:

INFO victory_gpu::host: 0.7 fps, 1393.0 ms/frame (191.9 preparing: copies 113.4 ms 891.8 MB, textures 2.5 ms 22.0 MB; 2.6 on the GPU; 20.2 copying back 19.2 MB), 2836 draws/frame, dropped 4177 without a host pipeline (0 being made) and 0 indirect; heap buffers 0.3 passes 1049.6 ms
card (VRAM) 9226 MB in use of 10533 MB budget, shared 3588 MB in use

Windows System log: nvlddmkm event 153 a few seconds later (no event 13 in that run; some other ce0f90f runs logged nvlddmkm 13 "SM Warp Exception: MMU Fault"). The pipeline library loaded fine (host pipeline library loaded bytes=542221118 mapped=true), so this is not a cold pipeline rebuild.

ce0f90f without #352 (OK): the first world frames copy 100-186 MB instead of ~892 MB, and the session continues into the world.

Possible cause (reading the diff)

With VICTORY_SECTION_MB unset, #352 should behave like before. One behaviour change does apply in that case: when a section closes, the GPU side now unmaps its own view of it immediately. Before, the view stayed until the handle number was reused. A copy still writing through that view would then fault and fall back, which could explain the huge copy frame (and, with VICTORY_QUIET_BACK=1, possibly the hang). I haven't verified this with VICTORY_D3D12_DEBUG=1.

Unrelated, for context

Even with #352 reverted, long sessions (~10-12 min) still end with host GPU device removed (no TDR) after shared memory climbs to ~9 GB and the log shows no free dynamic descriptor slots. That is a separate issue, reported in #412.


AI assistance: the bisection runs were driven and analysed with an AI assistant (Claude); the measurements come from my own sessions on my machine. No game files are included.

**@⁠jean-melikian** on GitHub · 2026-11-26 18:18 UTC · [original](https://github.com/LooperSalty/AnyXboxX/issues/428) ## Summary Since `main` includes #352 (`ee8b92e1` "perf(victory): physical pages from 2 MiB sections (VICTORY_SECTION_MB, off by default)" and its merge `ba38fae6`), every session on my machine ends with a GPU reset (Windows TDR, `nvlddmkm` event 153) on the **first world frame** after loading a save, about 35-45 s after the story packs open. `VICTORY_SECTION_MB` is **not set** (default, off). Reverting only #352's changes under `third_party/victory` (`inplace.rs`, `victory-gpu/src/lib.rs`, `victory-hle/src/modules/xmem.rs`, restored from `cd5c44d`) on top of `ce0f90f` removes the TDR: the game reaches the world, runs, and passes 5 stable minutes. ## Environment - GPU: NVIDIA GeForce RTX 3080 Ti (12 GB), Windows 11 - CPU: Ryzen 7 9800X3D, 64 GB RAM - Game build: my own copy (no game files attached) - Launch: `victory.exe run <game exe> --execute` directly (not through the launcher), same environment for `warm` and `run` - Session started from an in-world save (same save for every run below) ## Bisection | Build | Base | Extra commits | Result at the first world frame | |---|---|---|---| | `cd5c44d` | perf-trial (#383) | none | **OK**: world reached, ~10 fps avg, M5 after 6:29 | | `cd5c44d` + #392 | | #392 | **OK**: world reached, ~10.7 fps avg | | `ce0f90f` + #392 (+ #381, #389, #350 in some runs) | main | | **TDR** (5 runs: at 1:26, 1:56, 2:14, 2:31, and earlier variants) | | `ce0f90f` | main | none of ours except an input patch (b73d28a2) | **TDR** at 81 s, 35 s after `story000` opened | | `ce0f90f` **without #352** | main | #352 files restored from `cd5c44d` | **OK**: world reached at 101 s, 11.0 fps avg (best 30 s: 16.8), M5 reached | Other suspects were ruled out on the way: - `VICTORY_HEAP_SCAN_ALT` (#394): TDR with it unset and with `=0` (we don't use the launcher, so it was never on). - #381 (`VICTORY_KEPT_VIEWS_YIELD`): TDR with `=0`. - #392: no TDR when added alone to `cd5c44d`. - #350, #389: TDR without them. The only `third_party/victory` commits in `cd5c44d..ce0f90f` are `ed60e312` (#394), `ee8b92e1` and `ba38fae6` (#352). ## What I ran ``` victory.exe warm <all .rpf of the game dir> # same env as below victory.exe run <game dir>\game_scarlett_master.exe --execute ``` Environment (identical for every run in the table): ``` VICTORY_OCEAN_READBACK=0 VICTORY_CARD_WINDOWS_MB=1536 VICTORY_CARD_BUFFERS_MB=1536 VICTORY_TEXTURE_ROOM_PERCENT=93 VICTORY_HEAP_PASS_DIRTY=1 VICTORY_COPY_COALESCE=256 VICTORY_WINDOW_SKIP_SAME=1 VICTORY_MERGE_SUBMISSIONS=1 VICTORY_PAGE_WRITES=5 VICTORY_STEP_INDEX=1 VICTORY_CARD_SYNC_BATCH=1 VICTORY_PARALLEL_REFRESH=1 (plus the Neptune 2026-11-25c tuned set from the old launcher; VICTORY_SECTION_MB unset) ``` ## Expected Same behaviour as `cd5c44d`: the world loads and the game keeps running. ## What happened On `ce0f90f`, the first world frame is very heavy in copies, then the driver resets the GPU about 5 s later. `ce0f90f` (TDR), last `host` line before the reset: ``` INFO victory_gpu::host: 0.7 fps, 1393.0 ms/frame (191.9 preparing: copies 113.4 ms 891.8 MB, textures 2.5 ms 22.0 MB; 2.6 on the GPU; 20.2 copying back 19.2 MB), 2836 draws/frame, dropped 4177 without a host pipeline (0 being made) and 0 indirect; heap buffers 0.3 passes 1049.6 ms card (VRAM) 9226 MB in use of 10533 MB budget, shared 3588 MB in use ``` Windows System log: `nvlddmkm` event 153 a few seconds later (no event 13 in that run; some other `ce0f90f` runs logged `nvlddmkm` 13 "SM Warp Exception: MMU Fault"). The pipeline library loaded fine (`host pipeline library loaded bytes=542221118 mapped=true`), so this is not a cold pipeline rebuild. `ce0f90f` without #352 (OK): the first world frames copy 100-186 MB instead of ~892 MB, and the session continues into the world. ## Possible cause (reading the diff) With `VICTORY_SECTION_MB` unset, #352 should behave like before. One behaviour change does apply in that case: **when a section closes, the GPU side now unmaps its own view of it immediately**. Before, the view stayed until the handle number was reused. A copy still writing through that view would then fault and fall back, which could explain the huge copy frame (and, with `VICTORY_QUIET_BACK=1`, possibly the hang). I haven't verified this with `VICTORY_D3D12_DEBUG=1`. ## Unrelated, for context Even with #352 reverted, long sessions (~10-12 min) still end with `host GPU device removed` (no TDR) after shared memory climbs to ~9 GB and the log shows `no free dynamic descriptor slots`. That is a separate issue, reported in #412. --- AI assistance: the bisection runs were driven and analysed with an AI assistant (Claude); the measurements come from my own sessions on my machine. No game files are included.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 18:22:10 +00:00
Author
Owner

@⁠KainanP on GitHub · 2026-11-26 20:11 UTC · original

Thanks for the careful bisection, @⁠jean-melikian. #352 was mine, and your reading matches the diff: with VICTORY_SECTION_MB unset it was meant to be a no-op, but it also changed when the GPU side drops its own view of a closed section (now immediately, before only when the handle number was reused). A copy still in flight through that view can then fault. I'm preparing a fix that restores the old behaviour exactly when the switch is off, and with the switch on unmaps a closed section's view only after the submissions that may use it have finished. I'll link the PR here; if the maintainer prefers, reverting #352's three files is also safe in the meantime.

AI use: Claude Code (Claude Opus 5.5).

**@⁠KainanP** on GitHub · 2026-11-26 20:11 UTC · [original](https://github.com/LooperSalty/AnyXboxX/issues/428#issuecomment-7202398731) Thanks for the careful bisection, @⁠jean-melikian. #352 was mine, and your reading matches the diff: with `VICTORY_SECTION_MB` unset it was meant to be a no-op, but it also changed when the GPU side drops its own view of a closed section (now immediately, before only when the handle number was reused). A copy still in flight through that view can then fault. I'm preparing a fix that restores the old behaviour exactly when the switch is off, and with the switch on unmaps a closed section's view only after the submissions that may use it have finished. I'll link the PR here; if the maintainer prefers, reverting #352's three files is also safe in the meantime. _AI use: Claude Code (Claude Opus 5.5)._
Author
Owner

@⁠KainanP on GitHub · 2026-11-26 20:19 UTC · original

Follow-up on the fix I said I was preparing. Short version: current main no longer contains #352, so there is nothing left to revert there, and I am not opening a PR against it.

Cause (on ce0f90f, the tree you bisected). With VICTORY_SECTION_MB unset, #352 changed two things on the GPU side. Both ran on every section close:

  • Drop for Section (xmem) called the new victory_gpu::title_memory_section_closed. That function unmapped our own view of the section (VICTORY_QUIET_BACK's host_alias view) at once. Before #352, that view stayed mapped until Windows reused the handle number. A copy-back already writing through it (host::write_alias) then faulted and took the fallback path.
  • The same function also removed the section from the in-place census map. Before #352, a closed section stayed there until its handle was reused, so host_alias stopped finding it for views that were still in the map.

The allocator part (allocate_physical with one section per request) also differed slightly with the switch off. A page count too large to multiply now set *count = 0; before, it was left unchanged. The debug line was also logged before the host call instead of after it. Neither difference is GPU-related.

Where main is now. #409 replaced third_party/victory with the combined base, and its PR body lists VICTORY_SECTION_MB (ee8b92e) among the main commits the new base does not carry. On 37d46867 there is no title_memory_section_closed, no VICTORY_SECTION_MB, and no allocate_physical: XMemAllocatePhysicalPages makes one section per request again. The new base has its own title_memory_section_gone, which unmaps our own whole-section view when a section is dropped. That is upstream (VIctory-7900XTX) code, not #352. Its only users are CPU writes (land, titlewrite, watch), and they hold watch::title_memory_reading while they use the view, which keeps the title from unmapping and so from dropping the section. GPU submissions never go through that view, so the fault path described above does not exist there.

@⁠jean-melikian, could you check whether current main (the combined base) still gets the TDR on your 3080 Ti on the first world frame? Your environment variables are from the Neptune base, and most of them (VICTORY_COPY_COALESCE, VICTORY_MERGE_SUBMISSIONS, VICTORY_STEP_INDEX, ...) are not read by the new base. Use anyxboxx run with the default set, or the Windows/NVIDIA profile. If it still resets, it is a new bug in the combined base and I will look at it separately. If it doesn't, this issue can be closed as fixed by #409.

The same change was proposed to VIctory as Marvisak/VIctory#3177. It has no GPU side at all (no close hook, no unmap), but I pushed a change there (9bfd4aac) so that with VICTORY_SECTION_MB=0 the allocator behaves exactly as before, plus a test for the count case.

AI use: Claude Code (Claude Opus 5.5) read the diffs and wrote this; not tested in game.

**@⁠KainanP** on GitHub · 2026-11-26 20:19 UTC · [original](https://github.com/LooperSalty/AnyXboxX/issues/428#issuecomment-7202543437) Follow-up on the fix I said I was preparing. Short version: current `main` no longer contains #352, so there is nothing left to revert there, and I am not opening a PR against it. **Cause (on `ce0f90f`, the tree you bisected).** With `VICTORY_SECTION_MB` unset, #352 changed two things on the GPU side. Both ran on every section close: - `Drop for Section` (xmem) called the new `victory_gpu::title_memory_section_closed`. That function unmapped our own view of the section (`VICTORY_QUIET_BACK`'s `host_alias` view) at once. Before #352, that view stayed mapped until Windows reused the handle number. A copy-back already writing through it (`host::write_alias`) then faulted and took the fallback path. - The same function also removed the section from the in-place census map. Before #352, a closed section stayed there until its handle was reused, so `host_alias` stopped finding it for views that were still in the map. The allocator part (`allocate_physical` with one section per request) also differed slightly with the switch off. A page count too large to multiply now set `*count = 0`; before, it was left unchanged. The `debug` line was also logged before the host call instead of after it. Neither difference is GPU-related. **Where `main` is now.** #409 replaced `third_party/victory` with the combined base, and its PR body lists `VICTORY_SECTION_MB` (`ee8b92e`) among the `main` commits the new base does not carry. On `37d46867` there is no `title_memory_section_closed`, no `VICTORY_SECTION_MB`, and no `allocate_physical`: `XMemAllocatePhysicalPages` makes one section per request again. The new base has its own `title_memory_section_gone`, which unmaps our own whole-section view when a section is dropped. That is upstream (VIctory-7900XTX) code, not #352. Its only users are CPU writes (`land`, `titlewrite`, `watch`), and they hold `watch::title_memory_reading` while they use the view, which keeps the title from unmapping and so from dropping the section. GPU submissions never go through that view, so the fault path described above does not exist there. @⁠jean-melikian, could you check whether current `main` (the combined base) still gets the TDR on your 3080 Ti on the first world frame? Your environment variables are from the Neptune base, and most of them (`VICTORY_COPY_COALESCE`, `VICTORY_MERGE_SUBMISSIONS`, `VICTORY_STEP_INDEX`, ...) are not read by the new base. Use `anyxboxx run` with the default set, or the Windows/NVIDIA profile. If it still resets, it is a new bug in the combined base and I will look at it separately. If it doesn't, this issue can be closed as fixed by #409. The same change was proposed to VIctory as Marvisak/VIctory#3177. It has no GPU side at all (no close hook, no unmap), but I pushed a change there (9bfd4aac) so that with `VICTORY_SECTION_MB=0` the allocator behaves exactly as before, plus a test for the count case. _AI use: Claude Code (Claude Opus 5.5) read the diffs and wrote this; not tested in game._
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/LooperSalty--AnyXboxX#428
No description provided.