VRAM at 99.9% of budget: ~1.9 GB free in partly used texture blocks, no residency priorities set #691

Closed
opened 2026-11-28 03:37:40 +00:00 by github-bot · 7 comments
Owner

@⁠Machad3x on GitHub · 2026-11-28 03:35 UTC · original

Setup: Windows 11, RTX 3080 Ti 12 GB, Ryzen 7 5700X, 32 GB RAM, Series X profile, title ray tracing on (VICTORY_BVH_BUILDER=1), 240 s runs from the prison cell scene.

From a 240 s run's log:

  • Card memory use stays at 99.5-99.9% of budget (11232 of 11254 MB).
  • Texture pool blocks hold 4352 MB in 64 MiB blocks. Of that, 1945 MB is free space inside blocks that are only partly used.
  • No call to SetResidencyPriority. Over budget, Windows picks what to demote, which may include BVH arenas and card copies that rays read every step.
  • MakeResident slows from about 0.2 ms to 0.7 ms per call at the budget. One wait took 1568 ms, while card use jumped from 8.4 to 10.9 GB.

What we are testing

  1. pool.rs: best-fit placement into the fullest block, so sparse blocks drain and are released.
  2. HIGH residency priority for card copies, render, depth and UAV textures, and UAV buffers; NORMAL for texture blocks. Switch VICTORY_RESIDENCY_PRIORITY.

Branch tn1-vram on Machad3x/VIctory-nvidia. Results will follow here.

**@⁠Machad3x** on GitHub · 2026-11-28 03:35 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/691) **Setup:** Windows 11, RTX 3080 Ti 12 GB, Ryzen 7 5700X, 32 GB RAM, Series X profile, title ray tracing on (VICTORY_BVH_BUILDER=1), 240 s runs from the prison cell scene. From a 240 s run's log: - Card memory use stays at 99.5-99.9% of budget (11232 of 11254 MB). - Texture pool blocks hold 4352 MB in 64 MiB blocks. Of that, 1945 MB is free space inside blocks that are only partly used. - No call to `SetResidencyPriority`. Over budget, Windows picks what to demote, which may include BVH arenas and card copies that rays read every step. - `MakeResident` slows from about 0.2 ms to 0.7 ms per call at the budget. One wait took 1568 ms, while card use jumped from 8.4 to 10.9 GB. **What we are testing** 1. `pool.rs`: best-fit placement into the fullest block, so sparse blocks drain and are released. 2. HIGH residency priority for card copies, render, depth and UAV textures, and UAV buffers; NORMAL for texture blocks. Switch `VICTORY_RESIDENCY_PRIORITY`. Branch `tn1-vram` on Machad3x/VIctory-nvidia. Results will follow here.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 03:37:40 +00:00
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-28 03:35 UTC · original

Please attach both logs from the run that went wrong. Without them we can only guess. Paste %LOCALAPPDATA% into the address bar of File Explorer to get there.

  1. The play log, in %LOCALAPPDATA%\victory\logs\: the newest victory-nvidia-play-<date>-<time>-<number>.log (from victory.exe) or victory-nvidia-<date>-<time>.log (from the script launcher). The window shows its path at the start, on the line Log: ....
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newest victory-<date>-<time>-<number>.crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\.

Also say which GPU, Windows version (10 or 11)

**@⁠github-actions[bot]** on GitHub · 2026-11-28 03:35 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/691#issuecomment-7233201463) Please attach both logs from the run that went wrong. Without them we can only guess. Paste `%LOCALAPPDATA%` into the address bar of File Explorer to get there. 1. The play log, in `%LOCALAPPDATA%\victory\logs\`: the newest `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or `victory-nvidia-<date>-<time>.log` (from the script launcher). The window shows its path at the start, on the line `Log: ...`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. Also say which GPU, Windows version (10 or 11)
Author
Owner

@⁠Machad3x on GitHub · 2026-11-28 03:38 UTC · original

GPU: RTX 3080 Ti 12 GB, driver 621.40. Windows 11 (build 26300). Built from source, diag profile. Not a crash: the session stays alive for the whole 240 s run, so there is no crashes.log for it. The full play logs contain local paths, so these are the relevant lines with paths removed. More lines on request.

INFO victory_gpu::host: the texture queue's room: 11232 MB in use - 1945 MB free in texture blocks + 0 MB kept for card copies of title buffers + 0 MB kept for render targets = 9287 MB against a line of 10486 MB (93.2 % of a budget of 11254 MB): room
INFO victory_gpu::copystat: memory in blocks (VICTORY_TEXTURE_POOL=0 turns them off): 4352 MB of textures, 256 MB of their staging buffers
**@⁠Machad3x** on GitHub · 2026-11-28 03:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/691#issuecomment-7233233285) GPU: RTX 3080 Ti 12 GB, driver 621.40. Windows 11 (build 26300). Built from source, diag profile. Not a crash: the session stays alive for the whole 240 s run, so there is no crashes.log for it. The full play logs contain local paths, so these are the relevant lines with paths removed. More lines on request. ``` INFO victory_gpu::host: the texture queue's room: 11232 MB in use - 1945 MB free in texture blocks + 0 MB kept for card copies of title buffers + 0 MB kept for render targets = 9287 MB against a line of 10486 MB (93.2 % of a budget of 11254 MB): room INFO victory_gpu::copystat: memory in blocks (VICTORY_TEXTURE_POOL=0 turns them off): 4352 MB of textures, 256 MB of their staging buffers ```
Author
Owner

@⁠mfdbenm on GitHub · 2026-11-28 04:06 UTC · original

Confirming the exact same VRAM spillover pattern on an RTX 5070 (12GB) in v2026.11.27.9 (full telemetry, CapFrameX captures, and play logs in #694):

FG OFF (VICTORY_TEXTURE_ROOM_PERCENT=86): 10.1 / 12.0 GB Dedicated + 4.6 GB Shared (28.4 / 31.9 GB System RAM — 89%)

FG 2X (VICTORY_TEXTURE_ROOM_PERCENT=80): 9.8 / 12.0 GB Dedicated + 4.6 GB Shared (28.1 / 31.9 GB System RAM — 88%)

Even with the automatic 80% texture room cap on FG 2X and full 88,584-pipeline pre-compilation, shared GPU memory spillover stays flat at 4.6 GB

**@⁠mfdbenm** on GitHub · 2026-11-28 04:06 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/691#issuecomment-7233696944) Confirming the exact same VRAM spillover pattern on an RTX 5070 (12GB) in v2026.11.27.9 (full telemetry, CapFrameX captures, and play logs in https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/issues/694): FG OFF (VICTORY_TEXTURE_ROOM_PERCENT=86): 10.1 / 12.0 GB Dedicated + 4.6 GB Shared (28.4 / 31.9 GB System RAM — 89%) FG 2X (VICTORY_TEXTURE_ROOM_PERCENT=80): 9.8 / 12.0 GB Dedicated + 4.6 GB Shared (28.1 / 31.9 GB System RAM — 88%) Even with the automatic 80% texture room cap on FG 2X and full 88,584-pipeline pre-compilation, shared GPU memory spillover stays flat at 4.6 GB
Author
Owner

@⁠CuteBooty on GitHub · 2026-11-28 05:11 UTC · original

Data point: card memory with ray tracing on, 8 GB card, two runs (one run each)

Hardware: RTX 3070 8 GB (driver 621.24), Ryzen 7 5800X3D, 32 GB RAM, Windows 11.
Build: main 63b902fe1 plus PRs #630 and #697 and small local commits. Series S, 1920x1080, DLSS performance, frame generation 2x, victory.exe run.
Settings: VICTORY_TEXTURE_ROOM_PERCENT=85, VICTORY_SLOT_EVICT=1, VICTORY_CARD_ROOM_FOR_TARGETS_MB=2048, VICTORY_TEXTURE_POOL=1, VICTORY_SOFT_VIEWS=copies, VICTORY_BUFFERS_AHEAD=0, VICTORY_WATER_LIGHT=0.
Run N: ray tracing off, 16.7 min. Run R: VICTORY_BVH_BUILDER=1, 11.3 min. Rates are straight-line fits over the settled part (after loading, from about 2.5 minutes in), taken from the room, memory and "title memory by address" lines.

kind run N, start -> end (MB/min) run R, 150-560 s (MB/min) run R, last 110 s (MB/min)
card in use (layer) 6166 -> 6662 (+42) 6074 -> 6358 (+32) 6358 -> 6690 (+174)
card by the driver 7170 -> 7763 (+36) 7167 -> 7474 (+46) 7474 -> 7785 (+137)
texture copies 2454 -> 2205 (-17) 1903 -> 1887 (-8) 1887 -> 1819 (-34)
free inside texture blocks 489 -> 738 (+16) 400 -> 416 (+8) 416 -> 484 (+34)
texture blocks held 2944 flat 2304 flat 2304 flat
render targets kept 0 0 0
card copies of title buffers 138 -> 131 (flat) 49 -> 49 (flat) 49 -> 47
ray-tracing arenas (pages held) none 617 -> 686 (+9) 686 -> 866 MB (+120 by end points), 12 -> 15 arenas
private bytes about 21 GB, +-1 GB, no trend about 21.9 GB, flat 21.9 -> 24.0 GB (steps of +1.2 to +1.4 GB at each arena jump)
host copies of title memory 4.7 -> 4.5 GB (range 3.9-4.9) 4.2 -> 4.3 GB 4.3 -> 4.8 GB

Texture copies plus free space inside blocks add up to the blocks (2944 in run N), so the block part cannot grow. In run N the growth of "in use" (+500 MB in 13 minutes) is about equal to card buffers made (+137 MB) plus host render/write copies (+385 MB, never falls). Both runs sit at "no room, new textures wait" (about 106 of 121 room lines in run R).

Collapse in run R (last 110 s, rendered fps 13-14 down to 4-11):

time driver MB in use MB arenas (MB) build dispatches/frame pages with no copy/frame ms/frame
575 s 7536 6358 12 (688) 179 108 72
597 s 7584 6532 13 (739) 267 253 113
618 s 7623 6539 13 (754) 187 136 78
639 s 7608 6554 13 (761) 201 141 84
661 s 7731 6657 15 (864) 314 269 142
672 s 7785 6690 15 (866) 240 740 170

The arena count only went up in the whole run (the pages held dropped by at most 30 once). The card stayed at 100 % busy, 1980 MHz and 98-133 W in both runs, and the CPU was not full (game threads 8-10 cores of 16). Waits for new memory per 5 s stayed at 180-490 ms, which is too small to explain frames of 140-170 ms. So in this run the slowdown came with more builder work and more arenas, not clearly with the card running out of memory. One run each, so this is a data point, not a conclusion.

Lines (timestamps and paths removed):

  • title memory by address: 13861 pages (866 MB) in 15 arenas, 56 copies in all; per frame 46 dispatches that read, 240 that build, 740.1 pages that had no copy
  • the texture queue's room: 6690 MB in use - 484 MB free in texture blocks + 47 MB kept for card copies of title buffers + 0 MB kept for render targets = 6253 MB against a line of 5843 MB (85.0 % of a budget of 6874 MB): no room, new textures wait
  • memory in blocks (VICTORY_TEXTURE_POOL=0 turns them off): 2304 MB of textures, 384 MB of their staging buffers

Measurements and this report were prepared with an AI assistant (Claude Code); the runs were played on my machine.

**@⁠CuteBooty** on GitHub · 2026-11-28 05:11 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/691#issuecomment-7234515602) Data point: card memory with ray tracing on, 8 GB card, two runs (one run each) Hardware: RTX 3070 8 GB (driver 621.24), Ryzen 7 5800X3D, 32 GB RAM, Windows 11. Build: main 63b902fe1 plus PRs #630 and #697 and small local commits. Series S, 1920x1080, DLSS performance, frame generation 2x, `victory.exe run`. Settings: VICTORY_TEXTURE_ROOM_PERCENT=85, VICTORY_SLOT_EVICT=1, VICTORY_CARD_ROOM_FOR_TARGETS_MB=2048, VICTORY_TEXTURE_POOL=1, VICTORY_SOFT_VIEWS=copies, VICTORY_BUFFERS_AHEAD=0, VICTORY_WATER_LIGHT=0. Run N: ray tracing off, 16.7 min. Run R: VICTORY_BVH_BUILDER=1, 11.3 min. Rates are straight-line fits over the settled part (after loading, from about 2.5 minutes in), taken from the room, memory and "title memory by address" lines. | kind | run N, start -> end (MB/min) | run R, 150-560 s (MB/min) | run R, last 110 s (MB/min) | |---|---|---|---| | card in use (layer) | 6166 -> 6662 (+42) | 6074 -> 6358 (+32) | 6358 -> 6690 (+174) | | card by the driver | 7170 -> 7763 (+36) | 7167 -> 7474 (+46) | 7474 -> 7785 (+137) | | texture copies | 2454 -> 2205 (-17) | 1903 -> 1887 (-8) | 1887 -> 1819 (-34) | | free inside texture blocks | 489 -> 738 (+16) | 400 -> 416 (+8) | 416 -> 484 (+34) | | texture blocks held | 2944 flat | 2304 flat | 2304 flat | | render targets kept | 0 | 0 | 0 | | card copies of title buffers | 138 -> 131 (flat) | 49 -> 49 (flat) | 49 -> 47 | | ray-tracing arenas (pages held) | none | 617 -> 686 (+9) | 686 -> 866 MB (+120 by end points), 12 -> 15 arenas | | private bytes | about 21 GB, +-1 GB, no trend | about 21.9 GB, flat | 21.9 -> 24.0 GB (steps of +1.2 to +1.4 GB at each arena jump) | | host copies of title memory | 4.7 -> 4.5 GB (range 3.9-4.9) | 4.2 -> 4.3 GB | 4.3 -> 4.8 GB | Texture copies plus free space inside blocks add up to the blocks (2944 in run N), so the block part cannot grow. In run N the growth of "in use" (+500 MB in 13 minutes) is about equal to card buffers made (+137 MB) plus host render/write copies (+385 MB, never falls). Both runs sit at "no room, new textures wait" (about 106 of 121 room lines in run R). Collapse in run R (last 110 s, rendered fps 13-14 down to 4-11): | time | driver MB | in use MB | arenas (MB) | build dispatches/frame | pages with no copy/frame | ms/frame | |---|---|---|---|---|---|---| | 575 s | 7536 | 6358 | 12 (688) | 179 | 108 | 72 | | 597 s | 7584 | 6532 | 13 (739) | 267 | 253 | 113 | | 618 s | 7623 | 6539 | 13 (754) | 187 | 136 | 78 | | 639 s | 7608 | 6554 | 13 (761) | 201 | 141 | 84 | | 661 s | 7731 | 6657 | 15 (864) | 314 | 269 | 142 | | 672 s | 7785 | 6690 | 15 (866) | 240 | 740 | 170 | The arena count only went up in the whole run (the pages held dropped by at most 30 once). The card stayed at 100 % busy, 1980 MHz and 98-133 W in both runs, and the CPU was not full (game threads 8-10 cores of 16). Waits for new memory per 5 s stayed at 180-490 ms, which is too small to explain frames of 140-170 ms. So in this run the slowdown came with more builder work and more arenas, not clearly with the card running out of memory. One run each, so this is a data point, not a conclusion. Lines (timestamps and paths removed): - title memory by address: 13861 pages (866 MB) in 15 arenas, 56 copies in all; per frame 46 dispatches that read, 240 that build, 740.1 pages that had no copy - the texture queue's room: 6690 MB in use - 484 MB free in texture blocks + 47 MB kept for card copies of title buffers + 0 MB kept for render targets = 6253 MB against a line of 5843 MB (85.0 % of a budget of 6874 MB): no room, new textures wait - memory in blocks (VICTORY_TEXTURE_POOL=0 turns them off): 2304 MB of textures, 384 MB of their staging buffers Measurements and this report were prepared with an AI assistant (Claude Code); the runs were played on my machine.
Author
Owner

@⁠Machad3x on GitHub · 2026-11-28 07:09 UTC · original

Update from our fork (batch 9). RTX 3080 Ti, driver 621.40, Windows 11 Pro build 26300.

Changes:

  • Textures go best-fit into the fullest pool block, so sparse blocks drain.
  • Residency priorities: high for card copies, render targets and UAV memory.
  • The 3 GB render-target reserve is kept until the world's first frame. After that, only a margin above the targets is kept: the larger of 256 MiB and 15 %.

Bug in our first version: the reserve's settle clock ran during the menus, so the reserve was given up before the world's targets existed. Frame time went to 85.2 ms per frame, with the GPU at 30.9 ms. Starting the clock at the world's first frame fixed it: 67.0 ms per frame.

Residency priorities off: 106.1 ms per frame with the GPU at 62.6 ms, so they stay on.

Early loading: the first 80 s average 148.5 ms per frame, down from 261.3.

Still open: new card memory still waits about 27 s in total over a 240 s run.

**@⁠Machad3x** on GitHub · 2026-11-28 07:09 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/691#issuecomment-7235750159) Update from our fork (batch 9). RTX 3080 Ti, driver 621.40, Windows 11 Pro build 26300. **Changes:** - Textures go best-fit into the fullest pool block, so sparse blocks drain. - Residency priorities: high for card copies, render targets and UAV memory. - The 3 GB render-target reserve is kept until the world's first frame. After that, only a margin above the targets is kept: the larger of 256 MiB and 15 %. **Bug in our first version:** the reserve's settle clock ran during the menus, so the reserve was given up before the world's targets existed. Frame time went to 85.2 ms per frame, with the GPU at 30.9 ms. Starting the clock at the world's first frame fixed it: 67.0 ms per frame. **Residency priorities off:** 106.1 ms per frame with the GPU at 62.6 ms, so they stay on. **Early loading:** the first 80 s average 148.5 ms per frame, down from 261.3. **Still open:** new card memory still waits about 27 s in total over a 240 s run.
Author
Owner

@⁠kalberts0089-hash on GitHub · 2026-11-29 09:23 UTC · original

@⁠Machad3x thanks for the batch 9 numbers. Most of what this issue asks for is now upstream, behind switches, and it's in release v2026.11.29.01:

What Commit Switch Default
New pieces from the fullest texture block with room 5b6d24c7 VICTORY_POOL_FULLEST=0 turns it off on
Highest residency priority for card buffers and target/depth/UAV textures; texture blocks stay normal 49dd441a VICTORY_RESIDENCY_HIGH=1 off
"No room" once in-use is within 256 MiB of the budget, even if free space in blocks makes the sum pass de2d4ba1 VICTORY_ROOM_REAL=0 turns it off on
Ask for residency with EnqueueMakeResident instead of the blocking call af3adb39 VICTORY_RESIDENT_LATER=1 off

A few notes:

  • Your room line (11232 MB in use, 11254 MB budget) comes out as "no room" under VICTORY_ROOM_REAL, because 11232 is above 11254 - 256 (resource.rs:2127).
  • Upstream isn't best-fit like yours. It sorts blocks by bytes held (pool.rs:382), but inside the chosen block Ranges::take still takes the lowest address that fits (pool.rs:242).
  • VICTORY_RESIDENCY_HIGH is off by default. Your 106.1 vs 67.0 ms per frame with priorities off/on is a good argument for turning it on.
  • VICTORY_RESIDENT_LATER might help with the 1568 ms wait. The queued request is still waited for before a descriptor slot is written, though, so the wait may just move rather than go away.

It would be worth running your 240 s run on the release once with the defaults and once with VICTORY_RESIDENCY_HIGH=1. VICTORY_POOL_STATS=1 adds a texture blocks line showing how full the blocks are.

**@⁠kalberts0089-hash** on GitHub · 2026-11-29 09:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/691#issuecomment-7253734531) @⁠Machad3x thanks for the batch 9 numbers. Most of what this issue asks for is now upstream, behind switches, and it's in release v2026.11.29.01: | What | Commit | Switch | Default | |---|---|---|---| | New pieces from the fullest texture block with room | 5b6d24c7 | `VICTORY_POOL_FULLEST=0` turns it off | on | | Highest residency priority for card buffers and target/depth/UAV textures; texture blocks stay normal | 49dd441a | `VICTORY_RESIDENCY_HIGH=1` | off | | "No room" once in-use is within 256 MiB of the budget, even if free space in blocks makes the sum pass | de2d4ba1 | `VICTORY_ROOM_REAL=0` turns it off | on | | Ask for residency with `EnqueueMakeResident` instead of the blocking call | af3adb39 | `VICTORY_RESIDENT_LATER=1` | off | A few notes: - Your room line (11232 MB in use, 11254 MB budget) comes out as "no room" under `VICTORY_ROOM_REAL`, because 11232 is above 11254 - 256 (`resource.rs:2127`). - Upstream isn't best-fit like yours. It sorts blocks by bytes held (`pool.rs:382`), but inside the chosen block `Ranges::take` still takes the lowest address that fits (`pool.rs:242`). - `VICTORY_RESIDENCY_HIGH` is off by default. Your 106.1 vs 67.0 ms per frame with priorities off/on is a good argument for turning it on. - `VICTORY_RESIDENT_LATER` might help with the 1568 ms wait. The queued request is still waited for before a descriptor slot is written, though, so the wait may just move rather than go away. It would be worth running your 240 s run on the release once with the defaults and once with `VICTORY_RESIDENCY_HIGH=1`. `VICTORY_POOL_STATS=1` adds a `texture blocks` line showing how full the blocks are.
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-29 23:08 UTC · original

Closing this one: it was reported on v2026.11.28.02 or earlier, and a lot has changed since (crash fixes, memory, shaders, warm-up and speed).

If it still happens on v2026.11.29.05, please open a new issue with the newest play log from %LOCALAPPDATA%\victory\logs\ and crashes.log, and we'll look at it there.

**@⁠trustno1-coder** on GitHub · 2026-11-29 23:08 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/691#issuecomment-7264222647) Closing this one: it was reported on v2026.11.28.02 or earlier, and a lot has changed since (crash fixes, memory, shaders, warm-up and speed). If it still happens on [v2026.11.29.05](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.29.05), please open a new issue with the newest play log from `%LOCALAPPDATA%\victory\logs\` and `crashes.log`, and we'll look at it there.
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/trustno1-coder--VIctory-NVIDIA#691
No description provided.