play: hold memory back for the texture line whenever frame generation is not running #4213

Closed
github-bot wants to merge 11 commits from github-bot/gh-4212 into main AGit
Owner

@⁠Kassadd on GitHub · 2026-11-30 17:27 UTC · original
Kassadd:pr-texture-line → main · +820 −828 · 32 files · 11 commits · closed without merging

play: hold memory back for the texture line whenever frame generation is not running

What it changes

settings() holds 1.5 to 2 GB of the card's memory back from the texture pool by setting
VICTORY_TEXTURE_ROOM_PERCENT (80 with frame generation, 86 without) and
VICTORY_FRAMEGEN_ROOM_RESERVE=1.

Those two lines sat inside if let Some(x) = framegen_x, which is only Some when frame
generation was asked for or made ready. So they were skipped in two configurations:

  • --dlss off, which is what docs/linux-proton.md tells Linux users to run (frame
    generation does not work under Wine), and
  • --dlss quality without frame generation — and this one I only found by running it.

This moves them out, to if framegen_x.is_none() — the branch where nothing above asked
for them. The two lines themselves are unchanged, with the same values and the same meaning.

         if let Some(x) = framegen_x {
             set("VICTORY_FRAMEGEN", "1");
             set("VICTORY_FRAMEGEN_X", &x.to_string());
-            set("VICTORY_TEXTURE_ROOM_PERCENT", if framegen { "80" } else { "86" });
-            set("VICTORY_FRAMEGEN_ROOM_RESERVE", "1");
         }
     }
+    if framegen_x.is_none() {
+        set("VICTORY_TEXTURE_ROOM_PERCENT", if framegen { "80" } else { "86" });
+        set("VICTORY_FRAMEGEN_ROOM_RESERVE", "1");
+    }

What it looks like in a run

Under umu-run on a 16 GiB card at 4K output, with --dlss quality and no frame generation,
the layer's own line read:

... = 12006 MB against a line of 12991 MB (94.4 % of a budget of 13759 MB)

94.4 %, not 86. The layer's line was line_for — budget less 768 MiB or a twentieth,
floored at 90 % — and the card sat at 15,376 of 16,376 MB. The switch dump for that run
has VICTORY_DLSS=1 and VICTORY_MENU_DLSS=quality, and no VICTORY_TEXTURE_ROOM_PERCENT
at all.

With the cap applied another way on the same card (VICTORY_VRAM_BUDGET_MB=12800), the card
sat at 12.5 GB and the worst world frame went from 264 ms to 86 ms — same median,
64 ms, but the variance gone. That is the failure this is aimed at: device lost
(0x887A0005) and a refused command list (0x8007000E) stop being reachable for want of a
few hundred MB.

How it was tested

  • The test fails without the change and passes with it. play::tests::without_frame_generation_the_texture_line_is_still_held_back
    covers all three cases: DLSS on with no frame generation, DLSS off, and frame generation
    made ready (which keeps the old behaviour).
  • play::tests: 32 passed, 0 failed, run under Wine on the Windows test binary.
  • Two existing tests asserted the old behaviour — a_plain_start_is_the_launchers and
    without_nvidias_files_there_is_no_dlss both said !contains_key("VICTORY_TEXTURE_ROOM_PERCENT").
    Updated with a comment saying why: the reserve is not part of the Streamline path, it
    is the memory the texture queue holds back on its own, and it does not need a swap chain.
  • Built for x86_64-pc-windows-msvc; the victory bin's tests build on main 84bd61e.

On the 86

86 reads like "a little less than 80", and with no backend to make room for it collapses to
80 anyway: room_line_for returns budget / 100 * percent.unwrap_or(80).min(80) when the
reserve is asked for and frame generation is unavailable. So 86 + the reserve is 80 % in
practice — the value main already reaches on a machine with DLSS and frame generation off.
This takes the same route rather than inventing a third number.

Checked for overlap

  • #4115 / #4053 (landed as 145f772): the victory-gpu lib tests did not compile on
    main (card_pass gained a sixth argument, two test call sites passed five). Unrelated.
  • #4189 (shadow.rs, AMD windows) does interact: window_line takes
    resource::room_line(budget) as its cap, and its own comment names
    "VICTORY_TEXTURE_ROOM_PERCENT 86 or 80, 1.5 to 2 GB" as the room it keeps free of
    windows. Making the line 80 % where it was line_for therefore lowers the window cap by
    about 2 GB on a 16 GiB card too
    . Both pull the same way — leave the card room — but this
    is a second effect, and on the AMD cards #4190 is about I have not measured whether the
    windows end up short. If that is a concern, gating on streamline.is_none() would keep
    this PR to the --dlss off case only.
  • #4005 (landed as 94dc7e9) keeps 512 MB free inside the line; this changes which
    line. Different lever, no conflict.

Not done

  • No frame-rate claim from this build. The 264 -> 86 ms figures come from the 80 % line
    reached with VICTORY_VRAM_BUDGET_MB=12800, not from this change.
  • Not measured on an AMD card, where #4190's interaction would bite.
  • DLSS itself works under Wine here (Streamline 2.14.16, NGX 310.9.16, 1.00 upscalings a
    frame) but was no faster than --dlss off on this machine: the frame is bounded by the
    layer's copies, not by the card. That is why the --dlss off case matters and is the one
    docs/linux-proton.md documents.
**@⁠Kassadd** on GitHub · 2026-11-30 17:27 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4212) `Kassadd:pr-texture-line` → `main` · +820 −828 · 32 files · 11 commits · closed without merging play: hold memory back for the texture line whenever frame generation is not running ## What it changes `settings()` holds 1.5 to 2 GB of the card's memory back from the texture pool by setting `VICTORY_TEXTURE_ROOM_PERCENT` (`80` with frame generation, `86` without) and `VICTORY_FRAMEGEN_ROOM_RESERVE=1`. **Those two lines sat inside `if let Some(x) = framegen_x`**, which is only `Some` when frame generation was asked for or made ready. So they were skipped in **two** configurations: - `--dlss off`, which is what `docs/linux-proton.md` tells Linux users to run (frame generation does not work under Wine), and - `--dlss quality` **without** frame generation — and this one I only found by running it. **This moves them out, to `if framegen_x.is_none()`** — the branch where nothing above asked for them. The two lines themselves are unchanged, with the same values and the same meaning. ```diff if let Some(x) = framegen_x { set("VICTORY_FRAMEGEN", "1"); set("VICTORY_FRAMEGEN_X", &x.to_string()); - set("VICTORY_TEXTURE_ROOM_PERCENT", if framegen { "80" } else { "86" }); - set("VICTORY_FRAMEGEN_ROOM_RESERVE", "1"); } } + if framegen_x.is_none() { + set("VICTORY_TEXTURE_ROOM_PERCENT", if framegen { "80" } else { "86" }); + set("VICTORY_FRAMEGEN_ROOM_RESERVE", "1"); + } ``` ## What it looks like in a run Under `umu-run` on a 16 GiB card at 4K output, with `--dlss quality` and no frame generation, the layer's own line read: ```text ... = 12006 MB against a line of 12991 MB (94.4 % of a budget of 13759 MB) ``` **94.4 %**, not 86. The layer's line was `line_for` — budget less 768 MiB or a twentieth, floored at 90 % — and the card sat at **15,376 of 16,376 MB**. The switch dump for that run has `VICTORY_DLSS=1` and `VICTORY_MENU_DLSS=quality`, and no `VICTORY_TEXTURE_ROOM_PERCENT` at all. With the cap applied another way on the same card (`VICTORY_VRAM_BUDGET_MB=12800`), the card sat at **12.5 GB** and the worst world frame went from **264 ms to 86 ms** — same median, 64 ms, but the variance gone. That is the failure this is aimed at: `device lost` (`0x887A0005`) and a refused command list (`0x8007000E`) stop being reachable for want of a few hundred MB. ## How it was tested - **The test fails without the change and passes with it.** `play::tests::without_frame_generation_the_texture_line_is_still_held_back` covers all three cases: DLSS on with no frame generation, DLSS off, and frame generation made ready (which keeps the old behaviour). - **`play::tests`: 32 passed, 0 failed**, run under Wine on the Windows test binary. - Two existing tests asserted the old behaviour — `a_plain_start_is_the_launchers` and `without_nvidias_files_there_is_no_dlss` both said `!contains_key("VICTORY_TEXTURE_ROOM_PERCENT")`. **Updated with a comment saying why**: the reserve is not part of the Streamline path, it is the memory the texture queue holds back on its own, and it does not need a swap chain. - Built for `x86_64-pc-windows-msvc`; the `victory` bin's tests build on `main` `84bd61e`. ## On the `86` `86` reads like "a little less than 80", and with no backend to make room for it collapses to 80 anyway: `room_line_for` returns `budget / 100 * percent.unwrap_or(80).min(80)` when the reserve is asked for and frame generation is unavailable. So `86` + the reserve is 80 % in practice — the value `main` already reaches on a machine with DLSS and frame generation off. This takes the same route rather than inventing a third number. ## Checked for overlap - **#4115 / #4053** (landed as `145f772`): the `victory-gpu` lib tests did not compile on `main` (`card_pass` gained a sixth argument, two test call sites passed five). Unrelated. - **#4189** (`shadow.rs`, AMD windows) does interact: `window_line` takes `resource::room_line(budget)` as its cap, and its own comment names "`VICTORY_TEXTURE_ROOM_PERCENT` 86 or 80, 1.5 to 2 GB" as the room it keeps free of windows. Making the line 80 % where it was `line_for` therefore **lowers the window cap by about 2 GB on a 16 GiB card too**. Both pull the same way — leave the card room — but this is a second effect, and on the AMD cards #4190 is about I have not measured whether the windows end up short. If that is a concern, gating on `streamline.is_none()` would keep this PR to the `--dlss off` case only. - **#4005** (landed as `94dc7e9`) keeps 512 MB free *inside* the line; this changes which line. Different lever, no conflict. ## Not done - **No frame-rate claim from this build.** The 264 -> 86 ms figures come from the 80 % line reached with `VICTORY_VRAM_BUDGET_MB=12800`, not from this change. - **Not measured on an AMD card**, where #4190's interaction would bite. - **DLSS itself works under Wine** here (Streamline 2.14.16, NGX 310.9.16, 1.00 upscalings a frame) but was no faster than `--dlss off` on this machine: the frame is bounded by the layer's copies, not by the card. That is why the `--dlss off` case matters and is the one `docs/linux-proton.md` documents.
`settings()` holds 1.5 to 2 GB of the card's memory back from the texture
pool by setting `VICTORY_TEXTURE_ROOM_PERCENT` (80 with frame generation,
86 without) and `VICTORY_FRAMEGEN_ROOM_RESERVE=1`. Both were inside the
`if !pc_fsr && dlss != "off" && streamline.is_some()` branch, so they were
only ever asked for when an upscaler was on.

`docs/linux-proton.md` tells Linux users to run `--dlss off`: frame
generation does not work under Wine. That is the one configuration where
neither switch was set, and the texture line stayed at `resource::line_for`
— the widest the code has — with the card ending over its budget.

This moves the two lines out of that branch. The lines themselves are
unchanged, with the same two values and the same meaning.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 18:08:46 +00:00
github-bot changed title from play: hold memory back for the texture line with no upscaler too (--dlss off left it at line_for) to play: hold memory back for the texture line whenever frame generation is not running 2026-11-30 18:46:43 +00:00
github-bot force-pushed github-bot/gh-4212 from 3f162b6c0a to 45d3e9d873 2026-11-30 18:46:44 +00:00 Compare
github-bot closed this pull request 2026-12-01 00:05:24 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!4213
No description provided.