Streamline: rearm stuck DLSS Frame Generation before advancing SIMULATION_START #2938

Open
Maverick0351a wants to merge 1 commit from upstream-pr/2938 into main
Maverick0351a commented 2026-11-29 18:54:47 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Maverick0351a on 2026-11-29T18:54:47Z.


Fixes #

What it changes

  • In streamline::present_ends(), runs dlssg_get_state and the stuck-framegen dlssg_set_options(DLSSG_OFF) rearm while Streamline is still on frame, before calling marker(abi::SIMULATION_START, next) for frame + 1.
  • Previously, present_ends() advanced SIMULATION_START to frame + 1 on line 2814 before calling set_options(DLSSG_OFF) on line 2866. Because Streamline was already on frame + 1, both set_options(DLSSG_OFF) in present_ends() and set_options(DLSSG_ON) in present_begins() of frame + 1 fell within the same Streamline frame token frame + 1, causing Streamline to reject the DLSSG_ON call with code=21 (eErrorInvalidParameter):
    [streamline][error]dlfgEntry.cpp:544[slDLSSGSetOptions] Repeated slDLSSGSetOptions() call for the frame 35558

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): NVIDIA GeForce RTX 5080 Laptop GPU (16 GB GDDR7, driver 621.24.0, Streamline 2.14.16 / NGX 310.9.16), Series X (1440p) and Series S (1080p), DLSS Quality, DLSS Frame Generation 4x, ray tracing off.
  • Before: On frame 35557, present_ends() logged frame=35557 presents=90 rearms=1 code=0 "DLSS Frame Generation showed one frame a present that long with more asked (status 0): switched off to be asked on again", and on frame 35558, present_begins() failed with WARN streamline: dlfgEntry.cpp:544[slDLSSGSetOptions] Repeated slDLSSGSetOptions() call for the frame 35558 and DLSS Frame Generation switched frame=35558 on=true times=4 code=21 result="error: invalid parameter".
  • After: set_options(DLSSG_OFF) runs under frame before SIMULATION_START(frame + 1), so present_begins() on frame + 1 is the sole slDLSSGSetOptions call for frame + 1.
  • cargo test passed for the crates it touches: yes (cargo test -p victory-gpu --lib rearm_tests, 3 passed).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #592
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5553980299 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2938). Originally posted by [Maverick0351a](https://github.com/Maverick0351a) on 2026-11-29T18:54:47Z. --- Fixes # ## What it changes - In `streamline::present_ends()`, runs `dlssg_get_state` and the stuck-framegen `dlssg_set_options(DLSSG_OFF)` rearm while Streamline is still on `frame`, **before** calling `marker(abi::SIMULATION_START, next)` for `frame + 1`. - Previously, `present_ends()` advanced `SIMULATION_START` to `frame + 1` on line 2814 before calling `set_options(DLSSG_OFF)` on line 2866. Because Streamline was already on `frame + 1`, both `set_options(DLSSG_OFF)` in `present_ends()` and `set_options(DLSSG_ON)` in `present_begins()` of `frame + 1` fell within the same Streamline frame token `frame + 1`, causing Streamline to reject the `DLSSG_ON` call with `code=21 (eErrorInvalidParameter)`: `[streamline][error]dlfgEntry.cpp:544[slDLSSGSetOptions] Repeated slDLSSGSetOptions() call for the frame 35558` ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): NVIDIA GeForce RTX 5080 Laptop GPU (16 GB GDDR7, driver 621.24.0, Streamline 2.14.16 / NGX 310.9.16), Series X (1440p) and Series S (1080p), DLSS Quality, DLSS Frame Generation 4x, ray tracing off. - Before: On frame `35557`, `present_ends()` logged `frame=35557 presents=90 rearms=1 code=0 "DLSS Frame Generation showed one frame a present that long with more asked (status 0): switched off to be asked on again"`, and on frame `35558`, `present_begins()` failed with `WARN streamline: dlfgEntry.cpp:544[slDLSSGSetOptions] Repeated slDLSSGSetOptions() call for the frame 35558` and `DLSS Frame Generation switched frame=35558 on=true times=4 code=21 result="error: invalid parameter"`. - After: `set_options(DLSSG_OFF)` runs under `frame` before `SIMULATION_START(frame + 1)`, so `present_begins()` on `frame + 1` is the sole `slDLSSGSetOptions` call for `frame + 1`. - `cargo test` passed for the crates it touches: yes (`cargo test -p victory-gpu --lib rearm_tests`, 3 passed). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #592
justrealyme commented 2026-11-29 19:24:29 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by justrealyme on 2026-11-29T19:24:29Z.


Tested on RTX 5070 Ti (driver 621.40), Core Ultra 7 265K, Windows 11. Release build of 829188e with this PR applied, Series X, 1440p, DLSS Quality, DLSS frame generation 2x, VICTORY_ALIAS_TARGETS=0.

  • Without this PR, the play log showed the failure described here. Frame generation was rearmed 6 times, each followed by Repeated slDLSSGSetOptions() call for the frame, and there were 31 seconds with one frame shown per present.
  • With it, in a play session of about 2 minutes: 0 rearms, 0 repeated-call errors, and full 2x in 118 of 125 seconds (27.7 fps rendered, 54.9 shown).

The run with this PR also had VICTORY_ALIAS_TARGETS=0 set (from #1917), so the drop in stalls isn't measured against this PR alone. What the log shows for this PR is that the repeated-call error is gone. The build also compiled cleanly on top of 829188e.

Done with AI assistance (Claude Code).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7261255132 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2938#issuecomment-7261255132). Originally posted by [justrealyme](https://github.com/justrealyme) on 2026-11-29T19:24:29Z. --- Tested on **RTX 5070 Ti** (driver 621.40), Core Ultra 7 265K, Windows 11. Release build of 829188e with this PR applied, Series X, 1440p, DLSS Quality, DLSS frame generation 2x, `VICTORY_ALIAS_TARGETS=0`. - **Without this PR**, the play log showed the failure described here. Frame generation was rearmed 6 times, each followed by `Repeated slDLSSGSetOptions() call for the frame`, and there were 31 seconds with one frame shown per present. - **With it**, in a play session of about 2 minutes: 0 rearms, 0 repeated-call errors, and full 2x in 118 of 125 seconds (27.7 fps rendered, 54.9 shown). The run with this PR also had `VICTORY_ALIAS_TARGETS=0` set (from #1917), so the drop in stalls isn't measured against this PR alone. What the log shows for this PR is that the repeated-call error is gone. The build also compiled cleanly on top of 829188e. Done with AI assistance (Claude Code).
ThePerfomance commented 2026-11-30 04:18:21 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ThePerfomance on 2026-11-30T04:18:21Z.

Review: COMMENTED


Thanks for working on this, @Maverick0351a. I tested af2b7e9 on an RTX 5070 with driver 621.24. The synthetic DLSS-G probe passed at the default rearm threshold. With VICTORY_FRAMEGEN_REARM=1, frames 45 and 46 received both DLSSG_ON and DLSSG_OFF. Streamline logged Repeated slDLSSGSetOptions() even though both calls returned 0 and the probe passed.

Would it make sense to track the last frame that called slDLSSGSetOptions and defer the rearm until a frame where the options have not already been set? If generated frames return meanwhile, the pending rearm can be dropped. Counting the attempt only after Streamline accepts DLSSG_OFF would also keep a rejected call from using up a retry. A small regression test with a rearm threshold of 1 could check that no frame gets both calls.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6106834359 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2938#pullrequestreview-6106834359). Originally posted by [ThePerfomance](https://github.com/ThePerfomance) on 2026-11-30T04:18:21Z. **Review:** COMMENTED --- Thanks for working on this, @Maverick0351a. I tested `af2b7e9` on an RTX 5070 with driver 621.24. The synthetic DLSS-G probe passed at the default rearm threshold. With `VICTORY_FRAMEGEN_REARM=1`, frames 45 and 46 received both `DLSSG_ON` and `DLSSG_OFF`. Streamline logged `Repeated slDLSSGSetOptions()` even though both calls returned `0` and the probe passed. Would it make sense to track the last frame that called `slDLSSGSetOptions` and defer the rearm until a frame where the options have not already been set? If generated frames return meanwhile, the pending rearm can be dropped. Counting the attempt only after Streamline accepts `DLSSG_OFF` would also keep a rejected call from using up a retry. A small regression test with a rearm threshold of `1` could check that no frame gets both calls.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2938:upstream-pr/2938'
git switch 'upstream-pr/2938'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2938'
git switch 'upstream-pr/2938'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2938'
git switch 'upstream-pr/2938'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2938'
git switch 'main'
git merge --squash 'upstream-pr/2938'
git switch 'main'
git merge --ff-only 'upstream-pr/2938'
git switch 'main'
git merge 'upstream-pr/2938'
git push origin 'main'
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!2938
No description provided.