DLSS: frame generation's state read past the card's memory budget counts too (#1482) #856

Merged
kibagami-nc merged 1 commit from upstream-pr/856 into main 2026-11-29 08:16:58 +00:00
kibagami-nc commented 2026-11-28 07:50:37 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-28T07:50:37Z.


Its first part is in main (e1406af1): an upscaling recorded past the card's memory budget (slEvaluateFeature returning 39) counts as done. That was merged from the first commit. What's left here is the second part, rebased on f9dfb76f.

What happens

slDLSSGGetState returns 39, "warning: out of VRAM", with the state read, as the evaluation does. sonokweii found it while testing this PR (RTX 5060 8 GB, driver 610.88, frame generation 3x, past the budget): every sampled call gave code=39 … presented=2 generate_max=5.

Both of its calls in streamline.rs take 39 as a failure:

  • Before a present, let most = if code == 0 { state.num_frames_to_generate_max.max(1) } else { 1 } cuts 3X to 2X, though the state says 5:
    DLSS Frame Generation: more frames asked than this card generates asked=3 given=2
    
  • After a present, frames are counted only if code == 0. So past the budget, every per-second line reads 0 frames shown by it, and the F3 panel's shown frame rate stays at the rendered one, while the state says presented=2.

The change

  • state_read(code): 0 and 39 mean the state was read.
  • most_generated(code, max): the card's most from such a state, or one.
  • Both calls use them.

Tests

  • New test streamline::failing_tests::frame_generation_state_read_past_the_budget_counts: 39 reads the state, errors don't, and most_generated(39, 5) is 5, not 1.
  • cargo test -p victory-gpu --lib --locked on f9dfb76f: 590 passed, 44 ignored.
  • Clippy (workspace, --all-targets, default and --all-features): nothing new against main's own findings.

Not run with the game here. With a card past its budget and frame generation 3X, the lines to compare are DLSS Frame Generation switched … times=3 (where it said 2) and … frames shown by it.

No game files, dumps or extracted data are included.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5538052297 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/856). Originally posted by [kibagami-nc](https://github.com/kibagami-nc) on 2026-11-28T07:50:37Z. --- **Its first part is in main** (e1406af1): an upscaling recorded past the card's memory budget (`slEvaluateFeature` returning 39) counts as done. That was merged from the first commit. **What's left here is the second part**, rebased on f9dfb76f. ## What happens `slDLSSGGetState` returns 39, "warning: out of VRAM", with the state read, as the evaluation does. sonokweii found it while testing this PR (RTX 5060 8 GB, driver 610.88, frame generation 3x, past the budget): every sampled call gave `code=39 … presented=2 generate_max=5`. Both of its calls in `streamline.rs` take 39 as a failure: - **Before a present**, `let most = if code == 0 { state.num_frames_to_generate_max.max(1) } else { 1 }` cuts 3X to 2X, though the state says 5: ``` DLSS Frame Generation: more frames asked than this card generates asked=3 given=2 ``` - **After a present**, frames are counted only `if code == 0`. So past the budget, every per-second line reads `0 frames shown by it`, and the F3 panel's shown frame rate stays at the rendered one, while the state says `presented=2`. ## The change - `state_read(code)`: 0 and 39 mean the state was read. - `most_generated(code, max)`: the card's most from such a state, or one. - Both calls use them. ## Tests - **New test** `streamline::failing_tests::frame_generation_state_read_past_the_budget_counts`: 39 reads the state, errors don't, and `most_generated(39, 5)` is 5, not 1. - **`cargo test -p victory-gpu --lib --locked`** on f9dfb76f: 590 passed, 44 ignored. - **Clippy** (workspace, `--all-targets`, default and `--all-features`): nothing new against main's own findings. Not run with the game here. With a card past its budget and frame generation 3X, the lines to compare are `DLSS Frame Generation switched … times=3` (where it said 2) and `… frames shown by it`. No game files, dumps or extracted data are included.
sonokweii commented 2026-11-28 21:17:05 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by sonokweii on 2026-11-28T21:17:05Z.


Tested 374806c on an 8 GB card (RTX 5060, driver 610.88, Streamline 2.14.16 / NGX 310.9.16), merged locally on 923e38c together with #1444: Series S, DLSS Quality to 1080p, frame generation 3x, about 4 minutes in the world, release build.

The upscaling part works. With the card past its budget, no DLSS line counts a failure any more (0 of 242 lines; 202 of them with the card past its budget):

DLSS per frame: 1.00 upscalings by DLSS, 0.00 failed, 0.00 left to the title's FidelityFX (330 by DLSS so far); 1.00 of them with the card's memory past its budget

The same 39 comes back from slDLSSGGetState, and the two get_state calls in streamline.rs still take it as a failure:

  1. In present_begins, let most = if code == 0 { state.num_frames_to_generate_max.max(1) } else { 1 }; cuts 3x to 2x, though the state it got says 5:

    21:08:28 DLSS Frame Generation: more frames asked than this card generates asked=3 given=2
    21:08:28 DLSS Frame Generation switched frame=8061 on=true times=2 code=39 result="warning: out of VRAM"
    21:09:32 DLSS Frame Generation: slDLSSGGetState after the present n=480 code=39 status=0x0 presented=2 generate_max=5 min_size=100 vram_mb=0
    
  2. After the present, frames are counted only if code == 0. From 21:08:28 to the end, all 10 sampled state calls gave 39 with presented=2, yet all 191 per-second lines read 0, and FG_PER (so shown_per_frame()) stays at 1:

    DLSS Frame Generation: 6 presents with it on, 0 off, 0 frames shown by it (status 0x0)
    

Accepting 39 like 0 in both spots, as evaluated() does for the evaluate, would ask for the 3x set in F1 and count the frames Streamline reports. If 2x past the budget is meant, the "more frames asked than this card generates" message is misleading there.

This also corrects part of what I wrote in #1482: on 923e38c, the "0 frames shown" past the budget is at least partly this counting (an earlier 923e38c session: 39 with presented=2 in 25 of 30 state samples, the rest 1 or 3). f4608f0 has the same if code == 0 but does not log the state call, so I can't tell there.

Unrelated to this PR as far as I can tell: this session rendered at 5-6 fps (4.6-8.0), with 45-80 ms a frame copying back 8-9 MB (5.7 fps, 174.0 ms/frame (139.4 preparing: ...; 7.5 on the GPU; 75.1 copying back 8.6 MB)). It showed up once on 923e38c without this PR too (DLSS Performance), while another 923e38c session from the same save ran at 13-16 fps with 10-13 ms.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7245905986 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/856#issuecomment-7245905986). Originally posted by [sonokweii](https://github.com/sonokweii) on 2026-11-28T21:17:05Z. --- Tested 374806c on an 8 GB card (RTX 5060, driver 610.88, Streamline 2.14.16 / NGX 310.9.16), merged locally on 923e38c together with #1444: Series S, DLSS Quality to 1080p, frame generation 3x, about 4 minutes in the world, release build. **The upscaling part works.** With the card past its budget, no DLSS line counts a failure any more (0 of 242 lines; 202 of them with the card past its budget): ``` DLSS per frame: 1.00 upscalings by DLSS, 0.00 failed, 0.00 left to the title's FidelityFX (330 by DLSS so far); 1.00 of them with the card's memory past its budget ``` **The same 39 comes back from `slDLSSGGetState`, and the two `get_state` calls in `streamline.rs` still take it as a failure:** 1. In `present_begins`, `let most = if code == 0 { state.num_frames_to_generate_max.max(1) } else { 1 };` cuts 3x to 2x, though the state it got says 5: ``` 21:08:28 DLSS Frame Generation: more frames asked than this card generates asked=3 given=2 21:08:28 DLSS Frame Generation switched frame=8061 on=true times=2 code=39 result="warning: out of VRAM" 21:09:32 DLSS Frame Generation: slDLSSGGetState after the present n=480 code=39 status=0x0 presented=2 generate_max=5 min_size=100 vram_mb=0 ``` 2. After the present, frames are counted only `if code == 0`. From 21:08:28 to the end, all 10 sampled state calls gave 39 with `presented=2`, yet all 191 per-second lines read 0, and `FG_PER` (so `shown_per_frame()`) stays at 1: ``` DLSS Frame Generation: 6 presents with it on, 0 off, 0 frames shown by it (status 0x0) ``` Accepting 39 like 0 in both spots, as `evaluated()` does for the evaluate, would ask for the 3x set in F1 and count the frames Streamline reports. If 2x past the budget is meant, the "more frames asked than this card generates" message is misleading there. This also corrects part of what I wrote in #1482: on 923e38c, the "0 frames shown" past the budget is at least partly this counting (an earlier 923e38c session: 39 with `presented=2` in 25 of 30 state samples, the rest 1 or 3). f4608f0 has the same `if code == 0` but does not log the state call, so I can't tell there. Unrelated to this PR as far as I can tell: this session rendered at 5-6 fps (4.6-8.0), with 45-80 ms a frame copying back 8-9 MB (`5.7 fps, 174.0 ms/frame (139.4 preparing: ...; 7.5 on the GPU; 75.1 copying back 8.6 MB)`). It showed up once on 923e38c without this PR too (DLSS Performance), while another 923e38c session from the same save ran at 13-16 fps with 10-13 ms.
kibagami-nc commented 2026-11-28 21:51:46 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-28T21:51:46Z.


@sonokweii, thank you, both confirmed and fixed in a77efe7d. The branch is also rebased on main (d4b5d517).

slDLSSGGetState behaves like the evaluation: it returns 39 with the state read, which is what your sampled lines show (code=39 … presented=2 generate_max=5). Both of its calls now take 39 like 0:

  • Before a present: the most frames the card makes is read from the state, so 3X stays 3X past the budget, without the "more frames asked than this card generates" warning.
  • After a present: the frames the state reports are counted, so frames shown by it and the F3 panel should show the generated frames.

New test frame_generation_state_read_past_the_budget_counts: 39 reads the state, and most_generated(39, 5) is 5, not 1. cargo test -p victory-gpu --lib: 552 passed, 0 failed.

If you have another session past the budget, the lines to compare are DLSS Frame Generation switched … times= (3 with 3X asked, where it said 2) and DLSS Frame Generation: … frames shown by it.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7246327669 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/856#issuecomment-7246327669). Originally posted by [kibagami-nc](https://github.com/kibagami-nc) on 2026-11-28T21:51:46Z. --- @sonokweii, thank you, both confirmed and fixed in a77efe7d. The branch is also rebased on main (d4b5d517). `slDLSSGGetState` behaves like the evaluation: it returns 39 with the state read, which is what your sampled lines show (`code=39 … presented=2 generate_max=5`). Both of its calls now take 39 like 0: - **Before a present:** the most frames the card makes is read from the state, so 3X stays 3X past the budget, without the "more frames asked than this card generates" warning. - **After a present:** the frames the state reports are counted, so `frames shown by it` and the F3 panel should show the generated frames. New test `frame_generation_state_read_past_the_budget_counts`: 39 reads the state, and `most_generated(39, 5)` is 5, not 1. `cargo test -p victory-gpu --lib`: 552 passed, 0 failed. If you have another session past the budget, the lines to compare are `DLSS Frame Generation switched … times=` (3 with 3X asked, where it said 2) and `DLSS Frame Generation: … frames shown by it`.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!856
No description provided.