perf(vk): default DLSS to CNN preset E on < 7 GB GPUs #1096

Merged
HumanBean merged 2 commits from flix331/Longshot:perf/vk-dlss-cnn-6gb-default into main 2026-11-16 09:52:59 +00:00
Contributor

Type: perf · Risk: low · Tested on: Windows 11, NVIDIA GeForce RTX 3050 Laptop (6 GB VRAM) · Needs: none

Why

Split out from #637 per review feedback (REQUEST_CHANGES). On < 7 GB NVIDIA GPUs (such as 6 GB RTX 3050 Laptop cards), DLSS defaults to Transformer Preset K (11), which consumes 85 MB of internal NGX workspace (143 MB total with 58 MB images) and higher Tensor Core GPU time per frame than CNN Preset E (5), while texture caches sit tightly against the driver's 5,233 MB allowance. Following the sensible-defaults principle, cards with < 7 GB physical VRAM should default the MODEL_K slot to CNN Preset E automatically instead of adding extra menu rows or performance claims.

See #637.

What changed

Automatically selects DLSS CNN Preset E (5) on GPUs with < 7 GB physical VRAM when opts.dlss_model is at its default MODEL_K (0) and RX_VK_DLSS_PRESET is unset, leaving >= 7 GB cards, explicit M/L/NVIDIA default choices, and RX_VK_DLSS_PRESET overrides untouched.

  • dlss: wanted_preset() in gpu/vk/vk_dlss.cpp includes vk_internal.h and returns 5 (NVSDK_NGX_DLSS_Hint_Render_Preset_E) when device_vram_bytes() is non-zero and < 7ull << 30, opts.dlss_model == upscaler_rows::MODEL_K, and RX_VK_DLSS_PRESET is unset.
  • review fixes (HumanBean, 5f3b51fb): the rule is one function in gpu/vk/upscaler_rows.h, cnn_for_vram(model, vram) (passed through model_preset/dlss_preset, preset E named kPresetE and checked against the SDK's in vk_dlss.cpp's static_assert), used by wanted_preset() and by the menu: on such a card the DLSS model row reads CNN (E), its help says it was chosen for the card's memory (translated in all 13 menu languages), and the bug report lists the DLSS model's default as depending on this PC. wanted_preset() reads RX_VK_DLSS_PRESET through preset_env, so a value that names no preset leaves E, as the row already did. Game-free checks: tests/test_upscaler_rows.cpp/.py (the rule by behaviour, and that DLSS, the row and the report use it) and tests/test_bug_report_defaults.py's model-small-card; the README's DLSS model row and paragraph; a device_vram_bytes stand-in in scripts/screenshots/menu.cpp.

Measurements

Verdict: On the same main (02903b04) build with nvngx_dlss.dll v310.9.16, NGX honored Presets K, E, and F without mapping them back to Transformer. Preset F was slowest (33.00 ms GPU time). In matched fixed-camera Market runs at identical draws (~1,763–1,771), Preset E saved 1.55 ms GPU time (-9.8%, 14.20 vs 15.75 ms), improved average FPS by +3.03 fps (+7.2%, 44.97 vs 41.94 fps), reduced steady-state longest submission from 4.9–5.4 ms to 3.6–3.8 ms (-26%), and saved 27 MB of internal NGX VRAM (its own: 58 MB vs 85 MB) with indistinguishable visual quality (01-dlss-k-vs-e.png).

Hardware: Windows 11 (Optimus), NVIDIA GeForce RTX 3050 Laptop (6,001 MB physical VRAM, 5,233 MB driver allowance, driver 610.62), 16 GB RAM, 12 threads
Scene: Market (Market_Child, daytime), 1920x1080 output, DLSS Performance (50%) (960x540 -> 1920x1080), sharpness=80
Method: Same main (02903b04) build with RX_VK_DLSS=1, RX_VK_DLSS_LOG=1, RX_VK_DLSS_PRESET=K/E/F; parsed longshot_log.txt per-120-present samples (draws >= 500) and 600-frame vk: status: summaries, both during a Market walkthrough (K vs E vs F) and in a stationary fixed-camera Market spot (K vs E).
How to reproduce: Launch with RX_VK_DLSS=1 RX_VK_DLSS_LOG=1 and RX_VK_DLSS_PRESET=K, E, or F in Market_Child.

Before: main @ 02903b04 After: this PR @ 93f695f2
Stationary avg draws / frame 1,771 1,763
Stationary avg FPS 41.94 fps 44.97 fps (+3.03 fps, +7.2%)
Stationary avg GPU time 15.75 ms (steady 15.3 ms) 14.20 ms (steady 14.1 ms, -1.55 ms)
Stationary longest submission (steady) 4.9–5.4 ms (8.27 ms avg) 3.6–3.8 ms (6.11 ms avg)
DLSS VRAM (its images + its own) 58 + 85 = 143 MB 58 + 58 = 116 MB (-27 MB)
Walkthrough (K / E / F on 02903b04) K: 30.46 ms / 18.32 fps E: 29.21 ms / 19.29 fps (F: 33.00 ms / 17.78 fps)
[K] Info: (Perf) Using App hint Preset K
[K] vk: NVIDIA DLSS: feature 1 made (the first; frame 1344, 101.2 ms of CPU): 960x540 (960x540 to 1920x1080) -> 1920x1080, mode 2, preset K
[K] vk: status: 600 frames, the slowest 48.5 ms; VRAM 4.6 of 5.1 GB; NVIDIA DLSS: 600 frames drawn, ... its images 58 MB, its own 85 MB

[E] Info: (Perf) Using App hint Preset E
[E] vk: NVIDIA DLSS: feature 1 made (the first; frame 1241, 78.5 ms of CPU): 960x540 (960x540 to 1920x1080) -> 1920x1080, mode 2, preset E
[E] vk: status: 600 frames, the slowest 30.1 ms; VRAM 4.7 of 5.1 GB; NVIDIA DLSS: 600 frames drawn, ... its images 58 MB, its own 58 MB

[F] Info: (Perf) Using App hint Preset F
[F] vk: NVIDIA DLSS: feature 1 made (the first; frame 1256, 60.2 ms of CPU): 960x540 (960x540 to 1920x1080) -> 1920x1080, mode 2, preset F

Flags and settings

None — no new flags, menu rows, or ini keys were added. Existing RX_VK_DLSS_PRESET and explicit DLSS model choices (M, L, NVIDIA default) remain unchanged.

Testing

Tested:

  • Windows 11, llvm-mingw: python -I -B tests/test_upscaler_rows.py --cxx g++ (upscaler rows: all checks passed), python -I -B tests/test_dlss_checks.py --cxx g++ (dlss checks: ok), and python -I -B tests/run_all.py (578 passed, 45 failed, 42 skipped in Windows sandbox — all DLSS/upscaler/NGX checks passed; the 45 failures are unrelated Windows/sandbox environment checks such as test_linux_preflight.py, test_run_all_changed.py, test_job_queue.py, and nx2/test_*.py).
  • Windows 11, NVIDIA RTX 3050 Laptop 6 GB (driver 610.62): K vs E vs F walkthrough and stationary fixed-camera K vs E A/B on main @ 02903b04 with nvngx_dlss.dll v310.9.16.

Not tested:

  • The review fixes in 5f3b51fb: read, not built or run before they were pushed (the forge's checks run the game-free ones); "CNN (E)" in the menu on a 6 GB card not seen in the game.
  • DLAA and Ultra Performance with preset E on a card under 7 GB: E is asked for every mode, measured at Performance only. NVIDIA's SDK header marks preset E deprecated: a later SDK may drop it (the static_assert then fails the build).
  • >= 8 GB NVIDIA GPUs (by inspection, device_vram_bytes() < (7ull << 30) evaluates false so wanted_preset() returns the unchanged Preset K).
  • Linux builds with LONGSHOT_NGX_SDK.

Must be tested:

  • None (optional >= 8 GB Windows/Linux DLSS build sanity check if desired).

Risks

What could break: Nothing expected on >= 7 GB GPUs (code path is bypassed). On < 7 GB GPUs, DLSS model row at default 0 (Transformer (K)) uses CNN Preset E internally; users who explicitly want Transformer K on < 7 GB can still set RX_VK_DLSS_PRESET=K.

Turning it off: Set RX_VK_DLSS_PRESET=K, pick another option in DLSS model, or revert the single commit in gpu/vk/vk_dlss.cpp.

Compatibility: Nothing changes for saves, longshot_options.ini, or shader/pipeline caches.

Issues

See #637

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (578 passed, 42 skipped, 45 unrelated Windows-sandbox failures named in Testing; all DLSS/upscaler tests pass).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
**Type:** perf · **Risk:** low · **Tested on:** Windows 11, NVIDIA GeForce RTX 3050 Laptop (6 GB VRAM) · **Needs:** none ## Why Split out from `#637` per review feedback (`REQUEST_CHANGES`). On `< 7 GB` NVIDIA GPUs (such as 6 GB RTX 3050 Laptop cards), DLSS defaults to Transformer Preset K (`11`), which consumes `85 MB` of internal NGX workspace (`143 MB` total with `58 MB` images) and higher Tensor Core GPU time per frame than CNN Preset E (`5`), while texture caches sit tightly against the driver's `5,233 MB` allowance. Following the sensible-defaults principle, cards with `< 7 GB` physical VRAM should default the `MODEL_K` slot to CNN Preset E automatically instead of adding extra menu rows or performance claims. See #637. ## What changed Automatically selects DLSS CNN Preset E (`5`) on GPUs with `< 7 GB` physical VRAM when `opts.dlss_model` is at its default `MODEL_K` (`0`) and `RX_VK_DLSS_PRESET` is unset, leaving `>= 7 GB` cards, explicit `M`/`L`/`NVIDIA default` choices, and `RX_VK_DLSS_PRESET` overrides untouched. - dlss: `wanted_preset()` in `gpu/vk/vk_dlss.cpp` includes `vk_internal.h` and returns `5` (`NVSDK_NGX_DLSS_Hint_Render_Preset_E`) when `device_vram_bytes()` is non-zero and `< 7ull << 30`, `opts.dlss_model == upscaler_rows::MODEL_K`, and `RX_VK_DLSS_PRESET` is unset. - review fixes (HumanBean, `5f3b51fb`): the rule is one function in `gpu/vk/upscaler_rows.h`, `cnn_for_vram(model, vram)` (passed through `model_preset`/`dlss_preset`, preset E named `kPresetE` and checked against the SDK's in `vk_dlss.cpp`'s `static_assert`), used by `wanted_preset()` and by the menu: on such a card the DLSS model row reads **CNN (E)**, its help says it was chosen for the card's memory (translated in all 13 menu languages), and the bug report lists the DLSS model's default as depending on this PC. `wanted_preset()` reads `RX_VK_DLSS_PRESET` through `preset_env`, so a value that names no preset leaves E, as the row already did. Game-free checks: `tests/test_upscaler_rows.cpp`/`.py` (the rule by behaviour, and that DLSS, the row and the report use it) and `tests/test_bug_report_defaults.py`'s `model-small-card`; the README's DLSS model row and paragraph; a `device_vram_bytes` stand-in in `scripts/screenshots/menu.cpp`. ## Measurements **Verdict:** On the same `main` (`02903b04`) build with `nvngx_dlss.dll` `v310.9.16`, NGX honored Presets `K`, `E`, and `F` without mapping them back to Transformer. Preset `F` was slowest (`33.00 ms` GPU time). In matched fixed-camera Market runs at identical draws (`~1,763–1,771`), Preset `E` saved **`1.55 ms` GPU time (`-9.8%`, `14.20` vs `15.75 ms`)**, improved **average FPS by `+3.03 fps` (`+7.2%`, `44.97` vs `41.94 fps`)**, reduced steady-state **longest submission from `4.9–5.4 ms` to `3.6–3.8 ms` (`-26%`)**, and saved **`27 MB` of internal NGX VRAM (`its own`: `58 MB` vs `85 MB`)** with indistinguishable visual quality (`01-dlss-k-vs-e.png`). Hardware: Windows 11 (Optimus), NVIDIA GeForce RTX 3050 Laptop (6,001 MB physical VRAM, 5,233 MB driver allowance, driver 610.62), 16 GB RAM, 12 threads Scene: Market (`Market_Child`, daytime), `1920x1080` output, `DLSS Performance (50%)` (`960x540 -> 1920x1080`), `sharpness=80` Method: Same `main` (`02903b04`) build with `RX_VK_DLSS=1`, `RX_VK_DLSS_LOG=1`, `RX_VK_DLSS_PRESET=K/E/F`; parsed `longshot_log.txt` per-120-present samples (`draws >= 500`) and 600-frame `vk: status:` summaries, both during a Market walkthrough (`K` vs `E` vs `F`) and in a stationary fixed-camera Market spot (`K` vs `E`). How to reproduce: Launch with `RX_VK_DLSS=1 RX_VK_DLSS_LOG=1` and `RX_VK_DLSS_PRESET=K`, `E`, or `F` in `Market_Child`. | | Before: main @ 02903b04 | After: this PR @ 93f695f2 | |---|---|---| | Stationary avg draws / frame | `1,771` | `1,763` | | Stationary avg FPS | `41.94 fps` | **`44.97 fps` (`+3.03 fps`, `+7.2%`)** | | Stationary avg GPU time | `15.75 ms` (steady `15.3 ms`) | **`14.20 ms` (steady `14.1 ms`, `-1.55 ms`)** | | Stationary longest submission (steady) | `4.9–5.4 ms` (`8.27 ms` avg) | **`3.6–3.8 ms` (`6.11 ms` avg)** | | DLSS VRAM (`its images` + `its own`) | `58 + 85 = 143 MB` | **`58 + 58 = 116 MB` (`-27 MB`)** | | Walkthrough (`K` / `E` / `F` on `02903b04`) | `K: 30.46 ms` / `18.32 fps` | `E: 29.21 ms` / `19.29 fps` (`F: 33.00 ms` / `17.78 fps`) | ``` [K] Info: (Perf) Using App hint Preset K [K] vk: NVIDIA DLSS: feature 1 made (the first; frame 1344, 101.2 ms of CPU): 960x540 (960x540 to 1920x1080) -> 1920x1080, mode 2, preset K [K] vk: status: 600 frames, the slowest 48.5 ms; VRAM 4.6 of 5.1 GB; NVIDIA DLSS: 600 frames drawn, ... its images 58 MB, its own 85 MB [E] Info: (Perf) Using App hint Preset E [E] vk: NVIDIA DLSS: feature 1 made (the first; frame 1241, 78.5 ms of CPU): 960x540 (960x540 to 1920x1080) -> 1920x1080, mode 2, preset E [E] vk: status: 600 frames, the slowest 30.1 ms; VRAM 4.7 of 5.1 GB; NVIDIA DLSS: 600 frames drawn, ... its images 58 MB, its own 58 MB [F] Info: (Perf) Using App hint Preset F [F] vk: NVIDIA DLSS: feature 1 made (the first; frame 1256, 60.2 ms of CPU): 960x540 (960x540 to 1920x1080) -> 1920x1080, mode 2, preset F ``` ### Flags and settings None — no new flags, menu rows, or ini keys were added. Existing `RX_VK_DLSS_PRESET` and explicit `DLSS model` choices (`M`, `L`, `NVIDIA default`) remain unchanged. ## Testing **Tested:** - Windows 11, llvm-mingw: `python -I -B tests/test_upscaler_rows.py --cxx g++` (`upscaler rows: all checks passed`), `python -I -B tests/test_dlss_checks.py --cxx g++` (`dlss checks: ok`), and `python -I -B tests/run_all.py` (`578 passed, 45 failed, 42 skipped` in Windows sandbox — all DLSS/upscaler/NGX checks passed; the 45 failures are unrelated Windows/sandbox environment checks such as `test_linux_preflight.py`, `test_run_all_changed.py`, `test_job_queue.py`, and `nx2/test_*.py`). - Windows 11, NVIDIA RTX 3050 Laptop 6 GB (driver 610.62): `K` vs `E` vs `F` walkthrough and stationary fixed-camera `K` vs `E` A/B on `main @ 02903b04` with `nvngx_dlss.dll v310.9.16`. **Not tested:** - The review fixes in `5f3b51fb`: read, not built or run before they were pushed (the forge's checks run the game-free ones); "CNN (E)" in the menu on a 6 GB card not seen in the game. - DLAA and Ultra Performance with preset E on a card under 7 GB: E is asked for every mode, measured at Performance only. NVIDIA's SDK header marks preset E deprecated: a later SDK may drop it (the `static_assert` then fails the build). - `>= 8 GB` NVIDIA GPUs (by inspection, `device_vram_bytes() < (7ull << 30)` evaluates false so `wanted_preset()` returns the unchanged `Preset K`). - Linux builds with `LONGSHOT_NGX_SDK`. **Must be tested:** - None (optional `>= 8 GB` Windows/Linux DLSS build sanity check if desired). ## Risks **What could break:** Nothing expected on `>= 7 GB` GPUs (code path is bypassed). On `< 7 GB` GPUs, `DLSS model` row at default `0` (`Transformer (K)`) uses CNN Preset E internally; users who explicitly want Transformer K on `< 7 GB` can still set `RX_VK_DLSS_PRESET=K`. **Turning it off:** Set `RX_VK_DLSS_PRESET=K`, pick another option in `DLSS model`, or revert the single commit in `gpu/vk/vk_dlss.cpp`. **Compatibility:** Nothing changes for saves, `longshot_options.ini`, or shader/pipeline caches. ## Issues See #637 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (578 passed, 42 skipped, 45 unrelated Windows-sandbox failures named in Testing; all DLSS/upscaler tests pass). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
perf(vk): default DLSS to CNN preset E on < 7 GB GPUs
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
93f695f211
Assisted-by: Antigravity
HumanBean requested changes 2026-11-16 09:31:12 +00:00
Dismissed
HumanBean left a comment

Thanks for splitting this out of #637. The measurements are good: preset E really is cheaper on the 6 GB 3050 at Performance (−1.55 ms GPU, −27 MB of NGX memory, same picture). The wanted_preset() change itself is small and correct for the case it targets. It needs changes before it can merge, though, mainly because the menu and the bug report now name a different network from the one that draws:

1. The DLSS model row and the bug report say "Transformer (K)" while E draws (blocking). On a card under 7 GB, value 0 still reads Transformer (K) in tx_dlss_model (vk_menu.cpp), with the hint "NVIDIA's transformer model: the one tested most here.", and the bug report prints the same label (tests/test_bug_report_defaults.py drives tx_dlss_model). So a player sees K, and a report someone files says K, but the feature is made with E. The row also can't choose K on these cards any more, because value 0 means both "the default" and "K". The description points to RX_VK_DLSS_PRESET=K, but an environment switch isn't something a player can reach. Something like this would fix it:

  • move the rule into upscaler_rows.h, e.g. model_preset(int model, uint64_t vram) / dlss_preset(model, env, vram), so wanted_preset(), tx_dlss_model and hn_dlss_model all use the one function. On < 7 GB, value 0 then reads e.g. CNN (E) with a hint saying why (less video memory and GPU time on this card), and the bug report says E;
  • add a game-free check for it next to the existing ones in tests/test_upscaler_rows.py: 6 GB + K row + no env gives 5; 8 GB gives 11; M/L/default unchanged; a valid env wins; an invalid env (see 2) still gives E.

How the row should read is your call. It just has to say what draws.

2. An invalid RX_VK_DLSS_PRESET skips the E default. wanted_preset() checks env && *env itself, but dlss_preset and the menu (dlss_preset_env) use upscaler_rows::preset_env, which ignores a value that isn't a letter or 0 (e.g. RX_VK_DLSS_PRESET=1). With such a value the row shows plain Transformer (K) and the K row's preset is used, but the new branch is skipped, so a 6 GB card gets K and not E. Checking upscaler_rows::preset_env(env) would keep the two in step, and doing that is easier once the rule lives in upscaler_rows.h (point 1).

3. E for every quality mode was measured at Performance only. The preset goes to all six hints (DLAA, Quality, Balanced, Performance, Ultra Performance, Ultra Quality), so a 6 GB card on DLAA or Ultra Performance also gets E now. The numbers only cover Performance (960x540 → 1080p). Either say in the description why E is still right for DLAA/Ultra Performance on these cards (a run of either would do), or limit the rule to the modes measured. This one isn't blocking if you can explain it.

Smaller things (not blocking):

  • return 5 is a bare literal. The feature code already has static_assert(NVSDK_NGX_DLSS_Hint_Render_Preset_K == 11 && ...), so add NVSDK_NGX_DLSS_Hint_Render_Preset_E == 5 to it, or name it in upscaler_rows.h as a constant like the others.
  • The file's header comment (vk_dlss.cpp lines 13–14: "chooses DLSS's preset: K by default") and the upscaler_rows.h comment on the row ("0 the transformer, preset K (the default here, the one tested)") are now wrong on < 7 GB cards. Please update both.
  • device_vram_bytes() is called on every prepare(). It's only a loop over the memory heaps, so it doesn't matter. The vk_internal.h include is fine too: vk_xess.cpp and vk_fsr4.cpp include it as well.
  • pr status warns that the measurements were taken on 02903b04. The one commit on main since then (#1095, dev_build.py) doesn't touch the renderer, so one line saying the numbers still hold is enough. Add the two "When it applies" boxes pr status suggests, too (a check reading vk_dlss.cpp, and Windows + Linux builds).

Overlaps: #637 (same author) still carries the DLSS CNN presets this was split from. Once this lands, drop that part from it so the two don't both change wanted_preset(). Nothing else open touches wanted_preset() or the DLSS model row.

Reviewed by reading the code only; nothing was built or run.

🤖 Generated with Claude Code

Thanks for splitting this out of [#637](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/637). The measurements are good: preset E really is cheaper on the 6 GB 3050 at Performance (−1.55 ms GPU, −27 MB of NGX memory, same picture). The `wanted_preset()` change itself is small and correct for the case it targets. It needs changes before it can merge, though, mainly because the menu and the bug report now name a different network from the one that draws: **1. The DLSS model row and the bug report say "Transformer (K)" while E draws (blocking).** On a card under 7 GB, value 0 still reads `Transformer (K)` in `tx_dlss_model` (vk_menu.cpp), with the hint "NVIDIA's transformer model: the one tested most here.", and the bug report prints the same label (`tests/test_bug_report_defaults.py` drives `tx_dlss_model`). So a player sees K, and a report someone files says K, but the feature is made with E. The row also can't choose K on these cards any more, because value 0 means both "the default" and "K". The description points to `RX_VK_DLSS_PRESET=K`, but an environment switch isn't something a player can reach. Something like this would fix it: - move the rule into `upscaler_rows.h`, e.g. `model_preset(int model, uint64_t vram)` / `dlss_preset(model, env, vram)`, so `wanted_preset()`, `tx_dlss_model` and `hn_dlss_model` all use the one function. On < 7 GB, value 0 then reads e.g. `CNN (E)` with a hint saying why (less video memory and GPU time on this card), and the bug report says E; - add a game-free check for it next to the existing ones in `tests/test_upscaler_rows.py`: 6 GB + K row + no env gives 5; 8 GB gives 11; M/L/default unchanged; a valid env wins; an invalid env (see 2) still gives E. How the row should read is your call. It just has to say what draws. **2. An invalid `RX_VK_DLSS_PRESET` skips the E default.** `wanted_preset()` checks `env && *env` itself, but `dlss_preset` and the menu (`dlss_preset_env`) use `upscaler_rows::preset_env`, which ignores a value that isn't a letter or `0` (e.g. `RX_VK_DLSS_PRESET=1`). With such a value the row shows plain `Transformer (K)` and the `K` row's preset is used, but the new branch is skipped, so a 6 GB card gets K and not E. Checking `upscaler_rows::preset_env(env)` would keep the two in step, and doing that is easier once the rule lives in upscaler_rows.h (point 1). **3. E for every quality mode was measured at Performance only.** The preset goes to all six hints (DLAA, Quality, Balanced, Performance, Ultra Performance, Ultra Quality), so a 6 GB card on DLAA or Ultra Performance also gets E now. The numbers only cover Performance (960x540 → 1080p). Either say in the description why E is still right for DLAA/Ultra Performance on these cards (a run of either would do), or limit the rule to the modes measured. This one isn't blocking if you can explain it. Smaller things (not blocking): - `return 5` is a bare literal. The feature code already has `static_assert(NVSDK_NGX_DLSS_Hint_Render_Preset_K == 11 && ...)`, so add `NVSDK_NGX_DLSS_Hint_Render_Preset_E == 5` to it, or name it in `upscaler_rows.h` as a constant like the others. - The file's header comment (vk_dlss.cpp lines 13–14: "chooses DLSS's preset: K by default") and the `upscaler_rows.h` comment on the row ("0 the transformer, preset K (the default here, the one tested)") are now wrong on < 7 GB cards. Please update both. - `device_vram_bytes()` is called on every `prepare()`. It's only a loop over the memory heaps, so it doesn't matter. The `vk_internal.h` include is fine too: vk_xess.cpp and vk_fsr4.cpp include it as well. - `pr status` warns that the measurements were taken on `02903b04`. The one commit on main since then ([#1095](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1095), dev_build.py) doesn't touch the renderer, so one line saying the numbers still hold is enough. Add the two "When it applies" boxes `pr status` suggests, too (a check reading vk_dlss.cpp, and Windows + Linux builds). Overlaps: [#637](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/637) (same author) still carries the DLSS CNN presets this was split from. Once this lands, drop that part from it so the two don't both change `wanted_preset()`. Nothing else open touches `wanted_preset()` or the DLSS model row. Reviewed by reading the code only; nothing was built or run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
@ -314,2 +315,3 @@
/// DLSS's preset: the DLSS model row's, RX_VK_DLSS_PRESET over it (upscaler_rows.h dlss_preset)
/// DLSS's preset: the DLSS model row's, RX_VK_DLSS_PRESET over it (upscaler_rows.h dlss_preset).
/// On < 7 GB GPUs, the default K slot automatically selects CNN Preset E (-27 MB NGX VRAM, lower GPU time)
Owner

The file header (lines 13-14, "K by default") and the row's comment in upscaler_rows.h ("preset K (the default here, the one tested)") need the same note about < 7 GB cards.

The file header (lines 13-14, "K by default") and the row's comment in upscaler_rows.h ("preset K (the default here, the one tested)") need the same note about < 7 GB cards.
@ -317,2 +320,3 @@
static const char* const env = getenv("RX_VK_DLSS_PRESET");
return upscaler_rows::dlss_preset(opts.dlss_model, env && *env ? env : nullptr);
const unsigned p = upscaler_rows::dlss_preset(opts.dlss_model, env && *env ? env : nullptr);
if ((!env || !*env) && opts.dlss_model == upscaler_rows::MODEL_K) {
Owner

This checks env && *env, but the row and dlss_preset use upscaler_rows::preset_env(env), so an invalid value (e.g. RX_VK_DLSS_PRESET=1) skips E here while the menu shows the plain K row. !upscaler_rows::preset_env(env) keeps them in step. Better still, move this rule into upscaler_rows.h so the menu label/hint and the bug report can use it too (see the review).

This checks `env && *env`, but the row and `dlss_preset` use `upscaler_rows::preset_env(env)`, so an invalid value (e.g. `RX_VK_DLSS_PRESET=1`) skips E here while the menu shows the plain K row. `!upscaler_rows::preset_env(env)` keeps them in step. Better still, move this rule into `upscaler_rows.h` so the menu label/hint and the bug report can use it too (see the review).
@ -319,0 +321,4 @@
const unsigned p = upscaler_rows::dlss_preset(opts.dlss_model, env && *env ? env : nullptr);
if ((!env || !*env) && opts.dlss_model == upscaler_rows::MODEL_K) {
const uint64_t vram = device_vram_bytes();
if (vram && vram < (7ull << 30)) return 5; // NVSDK_NGX_DLSS_Hint_Render_Preset_E
Owner

Please add NVSDK_NGX_DLSS_Hint_Render_Preset_E == 5 to the existing static_assert in the feature code (or name the 5 in upscaler_rows.h), so the literal is checked against the SDK like K/L/M are.

Please add `NVSDK_NGX_DLSS_Hint_Render_Preset_E == 5` to the existing `static_assert` in the feature code (or name the 5 in upscaler_rows.h), so the literal is checked against the SDK like K/L/M are.
fix(vk): the DLSS model row names preset E where it draws; the VRAM rule in upscaler_rows.h
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 17s
Third-party parts / As their notes say (pull_request) Successful in 23s
PR description / Description follows the template (pull_request_target) Successful in 14s
5f3b51fb3b
On a card with less than 7 GB of video memory the K row draws with NVIDIA's CNN
preset E, but the row, its help and the bug report still said Transformer (K).
The rule is now one pure function in upscaler_rows.h (cnn_for_vram, with the card's
memory passed to model_preset and dlss_preset), used by wanted_preset() and by the
menu: the row reads CNN (E) there, its help says why, and the bug report lists the
DLSS model's default as depending on this PC.

- wanted_preset() goes through dlss_preset, so an RX_VK_DLSS_PRESET that names no
  preset (e.g. 1) no longer skips E, as the row already ignored it
- kPresetE names the 5, checked against NVSDK_NGX_DLSS_Hint_Render_Preset_E
- the comments that said K by default (vk_dlss.cpp, upscaler_rows.h, vk_menu.h) and
  README's DLSS model row say E under 7 GB
- the new hint in all 13 tables of menu_i18n.h
- checks: test_upscaler_rows.cpp (6 GB K row 5, 8 GB 11, M/L/default unchanged, a
  valid switch wins, an invalid one leaves E), test_upscaler_rows.py (DLSS, the row,
  its help and the report use the rule), test_bug_report_defaults.py (a 6 GB card's
  report says CNN (E))

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean changed title from WIP:perf(vk): default DLSS to CNN preset E on < 7 GB GPUs to perf(vk): default DLSS to CNN preset E on < 7 GB GPUs 2026-11-16 09:50:19 +00:00
HumanBean force-pushed perf/vk-dlss-cnn-6gb-default from 5f3b51fb3b
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 17s
Third-party parts / As their notes say (pull_request) Successful in 23s
PR description / Description follows the template (pull_request_target) Successful in 14s
to 97b6f701e4
Some checks failed
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 14s
PR description / Description follows the template (pull_request_target) Successful in 19s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 18s
CI / Workflow lint (actionlint) (pull_request) Successful in 20s
Third-party parts / As their notes say (pull_request) Successful in 26s
2026-11-16 09:51:52 +00:00
Compare
HumanBean approved these changes 2026-11-16 09:52:09 +00:00
HumanBean left a comment

Approved at the request of a maintainer. Rebased onto main d76feb2d, which brought in #1041. Two conflicts, both resolved without a decision:

  • gpu/vk/menu_i18n.h: each language's text count is main's plus this PR's one new hint. The counts match the entries, and every table is still sorted with no text twice.
  • tests/test_bug_report_defaults.py: the cases list keeps 1041's framegen-by-no-dlss and this PR's model-small-card.

The review's points are in 5f3b51fb (now 97b6f701):

  • the VRAM rule is in upscaler_rows.h and used by DLSS, the row, its help and the bug report;
  • preset_env decides the switch;
  • preset E is named and checked against the SDK;
  • there are game-free checks, and the comments and the README are updated.

Still open, as the description says: DLAA and Ultra Performance with E on a small card, and the SDK marking preset E deprecated.

🤖 Generated with Claude Code

Approved at the request of a maintainer. Rebased onto main `d76feb2d`, which brought in https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1041. Two conflicts, both resolved without a decision: - `gpu/vk/menu_i18n.h`: each language's text count is main's plus this PR's one new hint. The counts match the entries, and every table is still sorted with no text twice. - `tests/test_bug_report_defaults.py`: the cases list keeps 1041's `framegen-by-no-dlss` and this PR's `model-small-card`. The review's points are in `5f3b51fb` (now `97b6f701`): - the VRAM rule is in `upscaler_rows.h` and used by DLSS, the row, its help and the bug report; - `preset_env` decides the switch; - preset E is named and checked against the SDK; - there are game-free checks, and the comments and the README are updated. Still open, as the description says: DLAA and Ultra Performance with E on a small card, and the SDK marking preset E deprecated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
HumanBean deleted branch perf/vk-dlss-cnn-6gb-default 2026-11-16 09:52:59 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
MagicBeanDev/Longshot!1096
No description provided.