Continuous VRAM growth with Hardware Ray Tracing (DXR) enabled #4315

Open
opened 2026-11-30 18:52:37 +00:00 by github-bot · 4 comments
Owner

@⁠Eliauk0 on GitHub · 2026-11-30 18:47 UTC · original

VRAM usage increases continuously over time, far exceeding the expected budget.
It starts at around 10G/14.5G shortly after launching the game, and rises to 16.7G/14.5G after some time.

victory-nvidia-play-20261130-181545-21620.log

**@⁠Eliauk0** on GitHub · 2026-11-30 18:47 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4314) VRAM usage increases continuously over time, far exceeding the expected budget. It starts at around 10G/14.5G shortly after launching the game, and rises to 16.7G/14.5G after some time. [victory-nvidia-play-20261130-181545-21620.log](https://github.com/user-attachments/files/35634730/victory-nvidia-play-20261130-181545-21620.log)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 18:52:37 +00:00
Author
Owner

@⁠tyr0nsur on GitHub · 2026-11-30 19:32 UTC · original

A likely part of the growth, read from your log and hwrt.rs on main (e1251c31):

The BLAS memory itself stays inside its budget (budget 1460 MB, live 1418 MB at the end, with 17,424 evicted). What keeps growing is the PC's memory shared with the card, 5.2 GB at 18:16:50 and 14.6 GB at 18:30:28, while the hardware RT line counts the decoded meshlet index buffers:

18:19:31  quant24 VB 14838 / meshlet IB 15609 decoded (216 MB)
18:22:59  quant24 VB 42118 / meshlet IB 47341 decoded (613 MB)
18:26:29  quant24 VB 98519 / meshlet IB 103806 decoded (1671 MB)
18:30:28  quant24 VB 141142 / meshlet IB 148196 decoded (2606 MB)

In HwRtManager::cached_meshlet_ib each decoded index buffer becomes a committed UPLOAD buffer kept in decoded_ibs, a HashMap with no bound. Only title_memory_freed removes entries, and nothing evicts them under pressure. A committed buffer takes a whole 64 KiB placement unit, but these hold about 18 KB on average (2606 MB / 148,196). So the cache can cost about 3.6x its decoded bytes in shared memory: up to about 9 GB if most of those 148k entries are still alive. The counters are cumulative, so the live share is not in the log. That figure is an upper bound, but it fits the shared-memory growth.

Two changes would bound it: a byte budget with least-recently-used eviction that charges each entry its 64 KiB placement, or sub-allocating these small buffers from a few large upload heaps (placed resources) so each one costs its own size. A "live entries / MB" figure in the hardware RT line would show directly how much the cache holds.

AI-assisted with Claude Code.

**@⁠tyr0nsur** on GitHub · 2026-11-30 19:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4314#issuecomment-7289565886) A likely part of the growth, read from your log and `hwrt.rs` on `main` (e1251c31): The BLAS memory itself stays inside its budget (`budget 1460 MB, live 1418 MB` at the end, with 17,424 evicted). What keeps growing is the **PC's memory shared with the card**, 5.2 GB at 18:16:50 and 14.6 GB at 18:30:28, while the hardware RT line counts the decoded meshlet index buffers: ``` 18:19:31 quant24 VB 14838 / meshlet IB 15609 decoded (216 MB) 18:22:59 quant24 VB 42118 / meshlet IB 47341 decoded (613 MB) 18:26:29 quant24 VB 98519 / meshlet IB 103806 decoded (1671 MB) 18:30:28 quant24 VB 141142 / meshlet IB 148196 decoded (2606 MB) ``` In `HwRtManager::cached_meshlet_ib` each decoded index buffer becomes a **committed UPLOAD buffer** kept in `decoded_ibs`, a `HashMap` with no bound. Only `title_memory_freed` removes entries, and nothing evicts them under pressure. A committed buffer takes a whole 64 KiB placement unit, but these hold about 18 KB on average (2606 MB / 148,196). So the cache can cost about 3.6x its decoded bytes in shared memory: up to about 9 GB if most of those 148k entries are still alive. The counters are cumulative, so the live share is not in the log. That figure is an upper bound, but it fits the shared-memory growth. Two changes would bound it: a byte budget with least-recently-used eviction that charges each entry its 64 KiB placement, or sub-allocating these small buffers from a few large upload heaps (placed resources) so each one costs its own size. A "live entries / MB" figure in the hardware RT line would show directly how much the cache holds. AI-assisted with Claude Code.
Author
Owner

@⁠ishan-2025 on GitHub · 2026-11-30 20:38 UTC · original

RTX 5080 data point on e1251c31 (v2026.11.30.03, diagnostics build from source), VICTORY_HW_RT=1. My sessions are shorter than the one in the report (6–7 min against about 14), so this does not rule the growth out. It shows where memory stood in the first minutes.

Setup: Ryzen 9 5950X, RTX 5080 16 GB (driver 616.56), 64 GB RAM, page file 48–64 GB. Series X, 2560x1440, DLSS Quality. VICTORY_MAP_ONCE=1. Shader cache preloaded with the switch set (it is in the cache key).

Memory, from the memory now: and hardware RT: lines ("shared" is the PC's memory shared with the card):

Run Length Card memory, last 2 min Shared at peak Shared at end Decoded meshlet IB at end AS memory BLAS evicted
R3, scripted, no cap 7 min 13.0–13.3 of 14.1 GB 6.3 GB (2.5 min in) 4.7 GB 375 MB 1180 MB 2300
R4, scripted, --fps 20 --framegen 2 7 min 12.5–12.6 of 13.8 GB 5.9 GB (2.5 min in) 4.2 GB 398 MB 1124 MB 2331
U1, played by hand, --fps 20 --framegen 2 6 min 12.5–12.6 of 13.8 GB 9.1 GB (3 min in) 5.3 GB 463 MB 1128 MB 2664
T4, same save, ray tracing off 7 min 12.4–12.5 of 13.7 GB — 5.4 GB — — —
  • Card memory: within budget in all three ray-traced runs.
  • Shared memory: peaked while the world loaded, then fell back to about the level of the run without ray tracing.
  • Decoded meshlet index buffers: rose the whole time, from 0 to 375–463 MB, in step with the counts tyr0nsur pointed at (quant24 VB / meshlet IB … decoded). If they keep rising at that pace, they would account for part of a slow growth over a longer session.

Other numbers from the same runs:

  • Ray queries: all ray-tracing programs lifted (13–14 lifted, 0 partly, 0 fell back).
  • Frame time: world median 50 ms (R3) against 37 ms with ray tracing off (T3, T4). The card was 75% busy with ray tracing off (T3) and 69% with it on (R3).
  • CPU cost: BLAS prep summed to 44–47 s per run, and TLAS prep to 6–7 s.
  • One crash: the first try of R3 stopped 169 s in with "a host command list did not close (0x80070057)". The rerun went through.

I can run a 20–30 min session with the same settings if a longer timeline of these lines would help.

AI-assisted (Claude Code); all numbers are read from my own logs.

**@⁠ishan-2025** on GitHub · 2026-11-30 20:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4314#issuecomment-7291257122) RTX 5080 data point on `e1251c31` (v2026.11.30.03, diagnostics build from source), `VICTORY_HW_RT=1`. My sessions are shorter than the one in the report (6–7 min against about 14), so this does not rule the growth out. It shows where memory stood in the first minutes. **Setup:** Ryzen 9 5950X, RTX 5080 16 GB (driver 616.56), 64 GB RAM, page file 48–64 GB. Series X, 2560x1440, DLSS Quality. `VICTORY_MAP_ONCE=1`. Shader cache preloaded with the switch set (it is in the cache key). **Memory, from the `memory now:` and `hardware RT:` lines** ("shared" is the PC's memory shared with the card): | Run | Length | Card memory, last 2 min | Shared at peak | Shared at end | Decoded meshlet IB at end | AS memory | BLAS evicted | |---|---|---|---|---|---|---|---| | R3, scripted, no cap | 7 min | 13.0–13.3 of 14.1 GB | 6.3 GB (2.5 min in) | 4.7 GB | 375 MB | 1180 MB | 2300 | | R4, scripted, `--fps 20 --framegen 2` | 7 min | 12.5–12.6 of 13.8 GB | 5.9 GB (2.5 min in) | 4.2 GB | 398 MB | 1124 MB | 2331 | | U1, played by hand, `--fps 20 --framegen 2` | 6 min | 12.5–12.6 of 13.8 GB | 9.1 GB (3 min in) | 5.3 GB | 463 MB | 1128 MB | 2664 | | T4, same save, ray tracing off | 7 min | 12.4–12.5 of 13.7 GB | — | 5.4 GB | — | — | — | - **Card memory:** within budget in all three ray-traced runs. - **Shared memory:** peaked while the world loaded, then fell back to about the level of the run without ray tracing. - **Decoded meshlet index buffers:** rose the whole time, from 0 to 375–463 MB, in step with the counts tyr0nsur pointed at (`quant24 VB / meshlet IB … decoded`). If they keep rising at that pace, they would account for part of a slow growth over a longer session. **Other numbers from the same runs:** - **Ray queries:** all ray-tracing programs lifted (13–14 lifted, 0 partly, 0 fell back). - **Frame time:** world median 50 ms (R3) against 37 ms with ray tracing off (T3, T4). The card was 75% busy with ray tracing off (T3) and 69% with it on (R3). - **CPU cost:** `BLAS prep` summed to 44–47 s per run, and `TLAS prep` to 6–7 s. - **One crash:** the first try of R3 stopped 169 s in with "a host command list did not close (0x80070057)". The rerun went through. I can run a 20–30 min session with the same settings if a longer timeline of these lines would help. *AI-assisted (Claude Code); all numbers are read from my own logs.*
Author
Owner

@⁠tyr0nsur on GitHub · 2026-11-30 23:08 UTC · original

Thanks for the matched RTX 5080 data. The original 5070 Ti run ends at about 16,864 MiB local against a 14,389 MiB budget and 14,565 MiB shared, with 1,418 MiB of live BLAS and 9 MiB pinned. The decoded MB field includes both quant24 vertices and meshlet indices, cumulatively, so it cannot establish the decoded index cache's live footprint.

#4579 gives the decoded-index upload cache a 256 MiB budget and logs its live buffer count and bytes. If you're able to try a longer A/B run, the same source revision with and without that PR, and the same scene, DXR, frame-generation and FPS settings, would be most useful. Please keep the hardware RT meshlet index cache, hardware RT BLAS memory, hardware RT inputs and memory now lines. That would show cache size and how much the shared-memory curve and BLAS preparation cost change. Cache PR

**@⁠tyr0nsur** on GitHub · 2026-11-30 23:08 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4314#issuecomment-7294749399) Thanks for the matched RTX 5080 data. The original 5070 Ti run ends at about 16,864 MiB local against a 14,389 MiB budget and 14,565 MiB shared, with 1,418 MiB of live BLAS and 9 MiB pinned. The `decoded` MB field includes both quant24 vertices and meshlet indices, cumulatively, so it cannot establish the decoded index cache's live footprint. #4579 gives the decoded-index upload cache a 256 MiB budget and logs its live buffer count and bytes. If you're able to try a longer A/B run, the same source revision with and without that PR, and the same scene, DXR, frame-generation and FPS settings, would be most useful. Please keep the `hardware RT meshlet index cache`, `hardware RT BLAS memory`, `hardware RT inputs` and `memory now` lines. That would show cache size and how much the shared-memory curve and BLAS preparation cost change. [Cache PR](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/4579)
Author
Owner

@⁠TechnoStone on GitHub · 2026-11-30 23:54 UTC · original

Could be related to also link it here #4579

**@⁠TechnoStone** on GitHub · 2026-11-30 23:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4314#issuecomment-7295673982) Could be related to also link it here https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/4579
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#4315
No description provided.