VICTORY_TEXTURE_BACK=1 makes a new committed read-back buffer for every copy-back (~966,000 in 21 min); on Linux/NVIDIA that churn runs the driver out of DMA mappings #1340

Open
opened 2026-11-26 17:10:00 +00:00 by github-bot · 2 comments
Owner

@⁠anon31-006459 on GitHub · 2026-11-26 17:09 UTC · original

Setup: Linux (Pop!_OS 24.04, kernel 7.2.15), RTX 3070 Ti 8 GB, NVIDIA 595.104.02 (open kernel module), Ryzen 7 3700X, 32 GB RAM, Proton Experimental 11.0-20261112. Fork main ac25549 + the #1820 recipe + TEXTURE_BACK=1, Series S.

What happens: texback::record calls host.read_back_buffer(total) (a CreateCommittedResource on a read-back heap) for every copy-back, and the buffer is released after land(). In a 21-minute session in the prison (run 16), the log's counter reached texture readback landed copied=965888. During such sessions the kernel logs NVRM: intermapRegisterDmaMapping: Failed to insert new mapping node and gpu_vaspace.c asserts, followed by Xid 31 (MMU fault, FAULT_PDE) and 0x887A0005 (runs 15 and 16).

Caveat: in an overnight run with TEXTURE_BACK=0 the mapping errors still came once the PC's free memory ran low (first at 3.4 GB free, 31 of them at 0.4 GB). So the churn is a contributor, not the only cause. The same insert failures are a known bug of NVIDIA's open kernel module (VIctory #844, NVIDIA/open-gpu-kernel-modules#1540).

Suggested fix (have a patch, ~90 lines in texback.rs): keep read-back buffers of up to 16 MiB by power-of-two size, as the staging pool does, and give one back only after its land() ran (the list that wrote it has run). VICTORY_READBACK_POOL=0 gives the old behaviour, and VICTORY_READBACK_POOL_MB caps what is kept (256). It builds and the texback, shadow and plaincopy unit tests pass under Wine. In the game: run 17 (with this and a free-memory-driven idle-list cap) held the PC's memory shared with the card flat at about 6 GB with no mapping errors. It still ended about 6 minutes into the world on an Xid 31 read fault with no insert failures before it, so there is a separate fault too. Happy to open a PR if wanted.

AI-assisted (Claude Code, Claude Opus 5.5); numbers from runs on my machine. No game data.

**@⁠anon31-006459** on GitHub · 2026-11-26 17:09 UTC · [original](https://github.com/fxceless/victory-fork/issues/1340) **Setup:** Linux (Pop!_OS 24.04, kernel 7.2.15), RTX 3070 Ti 8 GB, NVIDIA 595.104.02 (open kernel module), Ryzen 7 3700X, 32 GB RAM, Proton Experimental 11.0-20261112. Fork main `ac25549` + the #1820 recipe + `TEXTURE_BACK=1`, Series S. **What happens:** `texback::record` calls `host.read_back_buffer(total)` (a `CreateCommittedResource` on a read-back heap) for every copy-back, and the buffer is released after `land()`. In a 21-minute session in the prison (run 16), the log's counter reached `texture readback landed copied=965888`. During such sessions the kernel logs `NVRM: intermapRegisterDmaMapping: Failed to insert new mapping node` and `gpu_vaspace.c` asserts, followed by `Xid 31` (MMU fault, `FAULT_PDE`) and `0x887A0005` (runs 15 and 16). **Caveat:** in an overnight run with `TEXTURE_BACK=0` the mapping errors still came once the PC's free memory ran low (first at 3.4 GB free, 31 of them at 0.4 GB). So the churn is a contributor, not the only cause. The same insert failures are a known bug of NVIDIA's open kernel module (VIctory #844, NVIDIA/open-gpu-kernel-modules#1540). **Suggested fix (have a patch, ~90 lines in `texback.rs`):** keep read-back buffers of up to 16 MiB by power-of-two size, as the staging pool does, and give one back only after its `land()` ran (the list that wrote it has run). `VICTORY_READBACK_POOL=0` gives the old behaviour, and `VICTORY_READBACK_POOL_MB` caps what is kept (256). It builds and the texback, shadow and plaincopy unit tests pass under Wine. In the game: run 17 (with this and a free-memory-driven idle-list cap) held the PC's memory shared with the card flat at about 6 GB with no mapping errors. It still ended about 6 minutes into the world on an `Xid 31` read fault with no insert failures before it, so there is a separate fault too. Happy to open a PR if wanted. *AI-assisted (Claude Code, Claude Opus 5.5); numbers from runs on my machine. No game data.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 17:10:00 +00:00
Author
Owner

@⁠rafaconvaitis on GitHub · 2026-11-26 17:25 UTC · original

I found the same automatic readback path in Cool Fox c3e5c37 on Windows, RTX 4070 12 GB. The 25-minute Series S boat run logged copied=187392 in texback::land and reached both package markers with no device removal. The counter is for successful landings. In Cool Fox, list::detach and detach_parts can append the same recorded list more than once, and read_backs visits each reference. Separate counters for new resources, pool hits and landings would make the allocation comparison more precise.

A lifetime case worth covering in the proposed PR is repeat execution of the same closed list. The recorded copy destination should stay leased until its final in-flight use and list reset or retirement. Marvisak/VIctory#2818 is a useful comparison for the explicit readback path, which ties reuse to list reset.

**@⁠rafaconvaitis** on GitHub · 2026-11-26 17:25 UTC · [original](https://github.com/fxceless/victory-fork/issues/1340#issuecomment-7198989183) I found the same automatic readback path in Cool Fox `c3e5c37` on Windows, RTX 4070 12 GB. The 25-minute Series S boat run logged `copied=187392` in `texback::land` and reached both package markers with no device removal. The counter is for successful landings. In Cool Fox, `list::detach` and `detach_parts` can append the same recorded list more than once, and `read_backs` visits each reference. Separate counters for new resources, pool hits and landings would make the allocation comparison more precise. A lifetime case worth covering in the proposed PR is repeat execution of the same closed list. The recorded copy destination should stay leased until its final in-flight use and list reset or retirement. Marvisak/VIctory#2818 is a useful comparison for the explicit readback path, which ties reuse to list reset.
Author
Owner

@⁠rafaconvaitis on GitHub · 2026-11-26 18:06 UTC · original

The fenced automatic-readback pool is now available as a Cool Fox backport. The focused test passes on Windows/WARP and RTX 4070. It executes the same closed D3D12 recording twice, checks a different recording's texel as well, and verifies reuse only after the original list resets. https://github.com/DoubleGhosty/cool_fox/pull/27

With the pool enabled at a 128 MiB idle cap, one Series S Windows integration run reached 9,600 completed readbacks. Its separate counters showed 51 successful new resources, 9,550 reuses, zero allocation failures, and a peak idle buffer width of 14.5 MiB. That verifies reuse on this Windows run. A matched pool-off run and the Linux failure case still need separate validation.

**@⁠rafaconvaitis** on GitHub · 2026-11-26 18:06 UTC · [original](https://github.com/fxceless/victory-fork/issues/1340#issuecomment-7200066434) The fenced automatic-readback pool is now available as a Cool Fox backport. The focused test passes on Windows/WARP and RTX 4070. It executes the same closed D3D12 recording twice, checks a different recording's texel as well, and verifies reuse only after the original list resets. https://github.com/DoubleGhosty/cool_fox/pull/27 With the pool enabled at a 128 MiB idle cap, one Series S Windows integration run reached 9,600 completed readbacks. Its separate counters showed 51 successful new resources, 9,550 reuses, zero allocation failures, and a peak idle buffer width of 14.5 MiB. That verifies reuse on this Windows run. A matched pool-off run and the Linux failure case still need separate validation.
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/fxceless--victory-fork#1340
No description provided.