[pr-feature][dlss][frame-generation][NVIDIA] Standalone NVIDIA Reflex low latency, PCL pipeline markers, F1/CLI controls, and F3 status row #159
Loading…
Reference in a new issue
No description provided.
Delete branch "davetheshrew/Darner:pr/reflex-low-latency"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Contributor role (optional)
What it changes
Previously, NVIDIA Reflex was only initialized and toggled as an internal dependency of DLSS Frame Generation (
slReflexSetOptionson/off),slReflexSleepwas never called, and PCL markers were only emitted aroundpresent_begins/present_endswith no standalone toggle, CLI flag, or F3 visibility.This adds full standalone and paired NVIDIA Reflex low-latency support (
DARNER_REFLEX=off|on|boost, off by default):crates/darner-gpu/src/streamline/abi.rs,streamline.rs):ReflexMode(Off,On,Boost),ReflexReport/ReflexReport2/ReflexStateABI definitions (with layout unit tests), and loadsslReflexSleepandslReflexGetStatealongsideslReflexSetOptionsandslPCLSetMarker.FEATURE_REFLEX+FEATURE_PCLwheneverDARNER_REFLEX=on|boostor DLSS Frame Generation is enabled, and proxies the swap chain / DXGI present factory so Streamline observes presents when Reflex runs standalone.Onwhenever DLSS Frame Generation is active while allowingBoostto override it.slReflexSleep(frame.rs,queue.rs,queue/behind.rs,streamline.rs,host.rs):slReflexSleepimmediately beforeSIMULATION_STARTinframe::wait(excluding sleep time from simulation work), emitsSIMULATION_ENDinqueue::present, emitsRENDER_SUBMIT_STARTahead of hostExecuteCommandListssubmissions (queue.rs/queue/behind.rs), and completesRENDER_SUBMIT_END,PRESENT_START, andPRESENT_ENDinpresent_begins/present_ends.pace::on()artificial present-hold delay inhost.rswhenever Reflex is active.streamline::line.apps/darner/src/play.rs,run.rs,host/menu.rs,host/panel.rs,locales/en.json,docs/dlss.md):darner play --reflex off|on|boost, startup status output indarner run, and a Picture-pageNVIDIA REFLEXF1 setting (OFF/ON/ON + BOOST) that switches live when Streamline Reflex/FG was initialized at launch (or prompts Save & Restart otherwise).REFLEXrow in the F3 stats panel showingOFF,ON, orON + BOOSTalong with live PCL sim-to-GPU latency (ms) when reported.play.rsmenu/CLI round-trip,abi.rsstruct layouts, and F3reflex_rowformatting/fit.How it was tested
47c37db(based onmain57dea7f)cargo clippy --workspace --all-targets --locked -- -D warnings,cargo clippy --workspace --all-targets --all-features --locked -- -D warnings,cargo test --workspace --locked, andcargo xtask policy>REFLEXrow>--all-featuresclippy or Series S was not tested>Checklist
main.docs/asset-policy.md.Checked for overlap
crates/darner-gpu/src/streamline.rs, and #154 toucheshost/menu.rs/host/panel.rs.Remember to run the three Windows verification gates (cargo clippy --workspace --all-targets --locked -- -D warnings, cargo clippy --workspace --all-targets --all-features --locked -- -D warnings, cargo test --workspace --locked) and paste the actual results + your GPU/settings into the <...> placeholders before clicking submit.
Test report and review: RTX 5070 Ti, 3 runs of the bench kit's camera flight.
Setup. RTX 5070 Ti 16 GB (NVIDIA 621.47), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26200. Both builds from source,
cargo build --release --locked -p darner --features bench-remote: PR head47c37dband its basemain57dea7f. The gta-bench-kit camera flightcam-city60(fixed save, 65 s route), Series X, 1440p, DLAA, hardware RT, DLSS frame generation 2x unless said. One run per arm, so the fps differences below are within the noise.57dea7f47c37db47c37dbDARNER_FRAMEGEN_X=0 DARNER_MENU_FRAMEGEN=0 DARNER_REFLEX=onTwo earlier base runs of the same build on this PC gave 9.77 and 12.15 fps, so R159 is inside base's range. The 123 s launch was B's first run on a shader cache copied from A's (the translator is unchanged); R159_0on on the same build launched in 77 s, so I don't tie it to the PR.
Standalone Reflex works. Frame generation ready but off,
DARNER_REFLEX=on:Reflex low latency mode mode="on" code=0 result="ok", thenNVIDIA Reflex (on): …lines once a second with sleeps and a PCL report: in the menus about 160 sleeps of ~6.1 ms with sim-to-GPU 0.6-1.5 ms; in the flight 6-11 sleeps of 0.01 ms (the title thread is the limit, so Reflex doesn't sleep), sim-to-GPU 150-450 ms with 33-38 ms of GPU active time. No warnings or errors from Streamline.With DLSS frame generation and
DARNER_REFLEXunset, the PR changes whatmaindoes.effective_reflex_mode(fg on, Off)isOn, sosimulation_beginnow callsslReflexSleepon the title thread every frame;mainnever calls it. The description says Reflex is off by default, but every frame generation run gets the sleep.The mode sent and the sleeps disagree. In R159 (frame generation 2x, no switch) the log shows
mode="on"at device creation, thenmode="off"one second later (present_beginsaskseffective_reflex_mode(fg_active && on, …), andonis false until the first upscaled frame), and the sleeps go on all the same:simulation_begindecides withreflex_active()→effective_reflex_now()→fg_will_be_on(), which does not look atcalls.reflex_mode. SoslReflexSleepruns, ~6 ms a call, while Reflex was set off. One source of truth (sleep only when the mode last sent is on or boost) would fix it. Once the flight starts it goes back to(on)with 0.01 ms sleeps.Other things I saw reading it:
RENDER_SUBMIT_STARTtakes its frame fromPRESENT_BEGUN_FRAME + 1(the host's presents), andSIMULATION_START/SIMULATION_ENDfrom the title's present count. With the line of submissions, the host's present count is behind the title's, so the markers of one frame id may come from different title frames. I haven't checked whether this is what makes sim-to-GPU 150-450 ms in the flight.present_begins, where #139 also changes howFgSnapshotis kept (applied on the maintainer's side): expect a conflict there.Gates on
47c37db:cargo clippy --workspace --all-targets --locked -- -D warningsand the same with--all-features: both passed.cargo test --workspacenot run.Not tested:
boost, the F1 setting switched live, the F3 row on screen, frame generation off without Reflex, Series S, latency with an outside tool,cargo test --workspace.Both findings are right. With DLSS frame generation and
DARNER_REFLEXunset,effective_reflex_mode(true, Off)is On, soreflex_active()slept the title thread every frame, which main never did. Andreflex_active()decided fromfg_will_be_on(), not from the mode last sent, so it slept while Streamline had been told off.Fixed on our main on top of the merge (
c88549fc, not pushed yet):reflex_active()(theslReflexSleepcalls and the pace bypass) is now true only when Reflex was asked for (DARNER_REFLEXor F1) and the mode last passed toslReflexSetOptionsis on or boost. The sent mode is kept in an atomic, so it is read withoutCALLS.render_submit_beginnow takes its frame id fromqueue::presented() + 1, the same countsimulation_beginuses, instead of the host's last present + 1. That count runs behind the title's with the relay. A frame id's markers now come from one title frame.