Leave NGX's Shutdown1 to the process exit after DLSS (#176) #217

Manually merged
github merged 1 commit from github-bot/gh-217 into gh-pr/217/base 2026-11-27 11:07:56 +00:00 AGit
Owner

@⁠Smoodie7 on GitHub · 2026-11-27 10:29 UTC · original
Smoodie7:improve/series-s-16gb → main · +49 −6 · 1 files · 1 commits · merged 2026-11-27 11:04 UTC

Fixes the exit crash in #176 / #212, and nothing else. It is one commit on current main, with the #214 markers kept. The 4080 profile and the Series S pool are now in their own PRs, as suggested.

Every exit after DLSS faulted at _nvngx.dll+0x46694 (a write to 0). The return address in victory.exe is the call right after release_pending, so the fault is inside the core's NVSDK_NGX_D3D12_Shutdown1, after the features are released. Every caller of fidelityfx::shut_down ends the process right after. shut_down now drains the GPU, releases the pending features, destroys the capability parameters (NVSDK_NGX_D3D12_DestroyParameters), and leaves the core to the process exit. VICTORY_DLSS_SHUTDOWN=1 restores the Shutdown1 call.

RTX 4070 Ti SUPER, driver 621.40, Series S, -Dlss quality -FrameGen Exit
before, menu or world 0xC0000005 at _nvngx.dll+0x46694
after, menu (WM_CLOSE) 0
after, world: feature live, 1,000+ frames evaluated, closed in play (2 runs) 0 and 0
DLSS: feature created ... render=[1280, 720] output=[1920, 1080]
DLSS: 1000 frames evaluated
close received how="SC_CLOSE"
frame generation: waiting for submitted work before shutdown
DLSS: waiting for submitted work before NGX shutdown
DLSS: draining pending NGX features
DLSS: features released; NGX's core is left to the process exit

cargo test -p victory-hle --locked passes. cargo clippy -p victory-hle --all-targets --all-features --locked -- -D warnings is clean.

**@⁠Smoodie7** on GitHub · 2026-11-27 10:29 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/217) `Smoodie7:improve/series-s-16gb` → `main` · +49 −6 · 1 files · 1 commits · merged 2026-11-27 11:04 UTC Fixes the exit crash in #176 / #212, and nothing else. It is one commit on current main, with the #214 markers kept. The 4080 profile and the Series S pool are now in their own PRs, as suggested. Every exit after DLSS faulted at `_nvngx.dll+0x46694` (a write to 0). The return address in `victory.exe` is the call right after `release_pending`, so the fault is inside the core's `NVSDK_NGX_D3D12_Shutdown1`, after the features are released. Every caller of `fidelityfx::shut_down` ends the process right after. `shut_down` now drains the GPU, releases the pending features, destroys the capability parameters (`NVSDK_NGX_D3D12_DestroyParameters`), and leaves the core to the process exit. `VICTORY_DLSS_SHUTDOWN=1` restores the `Shutdown1` call. | RTX 4070 Ti SUPER, driver 621.40, Series S, `-Dlss quality -FrameGen` | Exit | |---|---| | before, menu or world | `0xC0000005` at `_nvngx.dll+0x46694` | | after, menu (WM_CLOSE) | 0 | | after, world: feature live, 1,000+ frames evaluated, closed in play (2 runs) | 0 and 0 | ```text DLSS: feature created ... render=[1280, 720] output=[1920, 1080] DLSS: 1000 frames evaluated close received how="SC_CLOSE" frame generation: waiting for submitted work before shutdown DLSS: waiting for submitted work before NGX shutdown DLSS: draining pending NGX features DLSS: features released; NGX's core is left to the process exit ``` `cargo test -p victory-hle --locked` passes. `cargo clippy -p victory-hle --all-targets --all-features --locked -- -D warnings` is clean.
Every exit after a DLSS session ended in an access violation inside
NGX's core: a write to address 0 at _nvngx.dll+0x46694, called from the
core's NVSDK_NGX_D3D12_Shutdown1 (+0x6a650). It was reported in #176 on
an RTX 3080 with driver 610.88, and it happened in both sessions of #212
on an RTX 4070 Ti SUPER with driver 621.40. The return address in
victory.exe is the call right after release_pending, so the features
are released correctly and Shutdown1 itself faults.

Every caller of fidelityfx::shut_down ends the process right after
(lifecycle's end, the CRT exit, the end of run). So shut_down now
drains the GPU, releases the pending features, destroys the capability
parameters with NVSDK_NGX_D3D12_DestroyParameters (as the SDK asks
before NGX goes), and leaves the core to the process exit.
VICTORY_DLSS_SHUTDOWN=1 still calls Shutdown1, for drivers where it
works and for checking a fix in NGX.

Booted to the menu with -Console series-s -Machine 4080 -Dlss quality
-FrameGen, then closed the window with WM_CLOSE. Before: exit code
0xC0000005 with the _nvngx.dll+0x46694 fault. After: exit code 0, and
"DLSS: features released; NGX's core is left to the process exit".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
-Machine auto took every NVIDIA PC for the RTX 4090 test PC: 12/8/6
translation, update and landing threads, sized for 16 cores. -Machine
4070 matches an 8-core CPU, but it sets an explicit 1536 MB ceiling on
card copies of title buffers, below the 2048 MB the runtime already
picks for a 16 GB budget. On an RTX 4070 Ti SUPER with a Ryzen 7 7700
(#212), the card had 7.5 GB of 15.3 GB in use, with 5.6 GB of shared
memory in the PC's RAM and 1.6 GB of RAM left free.

-Machine 4080 keeps the 4070 thread counts (8/6/4, one mapping thread,
three pipeline workers) and gives card copies more room: 3072 MB for
buffers and 2048 MB for windows outside buffers. -Safe leaves the
budgets out, as it does for 4070. auto picks the 4080 profile for an
NVIDIA card with at least 15 GB, read from the display driver's
registry entry because Win32_VideoController stops counting at 4 GB,
next to 8 physical cores or fewer. Other PCs pick what they picked
before.

Measured in #212 with -Console series-s -Dlss quality -FrameGen at
1280x720 after victory warm --used: 20.3 rendered FPS median on the
boat (68 samples) and 36.2 presented with 2x frame generation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
VICTORY_OUTPUT=2560x1440 on Series S stopped before the first frame
(#212). The back buffers' pool is 82 MiB on Series S: `mov eax, 82 MiB`
at +0x247ad45, then `cmovne` against the Series X's 64 MiB. The pool's
allocator (+0x56a2ae0) ran past its end and hit its int3 (+0x56a2afd,
from +0x247aeb6). Jumping over the left-over check at +0x247af25 was
not enough there.

For an output larger than 1920x1080, the Series S size grows by 16
bytes for every pixel past 1920x1080, rounded to 2 MiB. That is twice
the 7.5 bytes a pixel the Series X pool's left-over shows between
3840x2160 and 1920x1080, giving 108 MiB at 2560x1440 and 178 MiB at
3840x2160. With a larger pool the left-over check goes too, at
3840x2160 as well. VICTORY_SERIES_S_POOL_MB=<n> (82 to 1024) sets the
size by hand. The 64 MiB Series X size is left as it is.

At 2560x1440 with -Dlss quality -FrameGen: 90 MiB still runs out in
the pool's allocator. 96 and 108 MiB get past the back buffers and the
DLSS context (render 1706x960), and then stop on the next fixed
allocation: a 2 MiB, 64 KiB-aligned request whose failure ends in the
int3 at +0x2219650 (called from +0x4fac413). That is the next thing to
find for Series S above 1080p. 1280x720 and 1920x1080 are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 10:40:21 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 10:37 UTC · original

@⁠Smoodie7 The shutdown commit ae81a6b is the first one I’d test in isolation over current main, keeping the #214 markers. In #212, the first DLSS feature was created at the first world frame. For the exit check, reach a world frame with DLSS evaluating before closing the game. That exercises live feature teardown as well as process exit.

The 4080 profile and the 1440p loader allocation have separate verification paths. The larger pool getting as far as DLSS context creation is a useful milestone. The next allocation still needs its own check before treating 1440p as playable.

**@⁠TaynanGT** on GitHub · 2026-11-27 10:37 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/217#issuecomment-7216112838) @⁠Smoodie7 The shutdown commit `ae81a6b` is the first one I’d test in isolation over current main, keeping the #214 markers. In #212, the first DLSS feature was created at the first world frame. For the exit check, reach a world frame with DLSS evaluating before closing the game. That exercises live feature teardown as well as process exit. The 4080 profile and the 1440p loader allocation have separate verification paths. The larger pool getting as far as DLSS context creation is a useful milestone. The next allocation still needs its own check before treating 1440p as playable.
github-bot force-pushed github-bot/gh-217 from 3df0228619 to 2b6b31a7fe 2026-11-27 10:55:21 +00:00 Compare
Author
Owner

@⁠Smoodie7 on GitHub · 2026-11-27 10:53 UTC · original

Rebased on current main with the #214 markers kept, so the shutdown commit is now 492ac96f. I ran it with a live feature in the world, twice (the two A/B runs in #212): the feature was created at the first world frame, more than 1,000 frames were evaluated, then I closed the window during play.

10:39:05 DLSS: feature created ... render=[1280, 720] output=[1920, 1080]
10:40:07 DLSS: 1000 frames evaluated
10:43:55 close received how="SC_CLOSE"
10:43:56 frame generation: waiting for submitted work before shutdown
10:43:56 DLSS: waiting for submitted work before NGX shutdown
10:43:56 DLSS: draining pending NGX features
10:43:56 DLSS: features released; NGX's core is left to the process exit

Both runs exited with code 0, and the second run logged the same sequence. Before this change, every exit after DLSS faulted at _nvngx.dll+0x46694. Understood on the other two: the 4080 profile and the 1440p pool stay separate, and 1440p is not playable until the next 2 MiB allocation is found.

**@⁠Smoodie7** on GitHub · 2026-11-27 10:53 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/217#issuecomment-7216433572) Rebased on current main with the #214 markers kept, so the shutdown commit is now `492ac96f`. I ran it with a live feature in the world, twice (the two A/B runs in #212): the feature was created at the first world frame, more than 1,000 frames were evaluated, then I closed the window during play. ```text 10:39:05 DLSS: feature created ... render=[1280, 720] output=[1920, 1080] 10:40:07 DLSS: 1000 frames evaluated 10:43:55 close received how="SC_CLOSE" 10:43:56 frame generation: waiting for submitted work before shutdown 10:43:56 DLSS: waiting for submitted work before NGX shutdown 10:43:56 DLSS: draining pending NGX features 10:43:56 DLSS: features released; NGX's core is left to the process exit ``` Both runs exited with code 0, and the second run logged the same sequence. Before this change, every exit after DLSS faulted at `_nvngx.dll+0x46694`. Understood on the other two: the 4080 profile and the 1440p pool stay separate, and 1440p is not playable until the next 2 MiB allocation is found.
github-bot changed title from Fix the DLSS exit crash, add a 16 GB / 8-core NVIDIA profile, size the Series S back buffer pool above 1080p to Leave NGX's Shutdown1 to the process exit after DLSS (#176) 2026-11-27 11:01:46 +00:00
github-bot force-pushed github-bot/gh-217 from 2b6b31a7fe to c96db2e95e 2026-11-27 11:01:47 +00:00 Compare
Author
Owner

@⁠efsebayern on GitHub · 2026-11-27 10:59 UTC · original

A data point for the 4080 auto-pick: hybrid Intel CPUs don't match NumberOfCores -le 8.

On an RTX 4080 SUPER 16 GB + i7-13700K (8 P + 8 E cores, 24 threads) + 32 GB, Win32_Processor.NumberOfCores reports 16, so auto still picks 4090. On that PC the 8-core thread counts are clearly better. These are the 4070 profile's counts, the same ones the 4080 profile uses. Measured in the Series S opening cutscene, diag build, mean fps over 3 minutes from the runtime's 5-second lines:

Profile Ray tracing on Ray tracing off
4090 (12/8/6 threads) 10.2 fps 17.0 fps
4070 (8/6/4 threads) 16.2 fps 20.3 fps

Only P-cores have Hyper-Threading on these parts, so P-cores = logical processors − cores (24 − 16 = 8 here). On non-hybrid CPUs logical = 2 × cores, so nothing changes there. Something like:

$cpu = Get-CimInstance Win32_Processor -ErrorAction SilentlyContinue
$cores = ($cpu | Measure-Object NumberOfCores -Sum).Sum
$logical = ($cpu | Measure-Object NumberOfLogicalProcessors -Sum).Sum
# Hybrid Intel (P-cores with HT, E-cores without): count the P-cores.
if ($logical -gt $cores -and $logical -lt 2 * $cores) { $cores = $logical - $cores }

I haven't measured the 4080 card budgets (3072 / 2048 MB) on this PC yet, only the thread counts above.

AI-assisted (Claude Code).

**@⁠efsebayern** on GitHub · 2026-11-27 10:59 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/217#issuecomment-7216556225) A data point for the `4080` auto-pick: hybrid Intel CPUs don't match `NumberOfCores -le 8`. On an **RTX 4080 SUPER 16 GB + i7-13700K (8 P + 8 E cores, 24 threads) + 32 GB**, `Win32_Processor.NumberOfCores` reports 16, so `auto` still picks `4090`. On that PC the 8-core thread counts are clearly better. These are the 4070 profile's counts, the same ones the `4080` profile uses. Measured in the Series S opening cutscene, `diag` build, mean fps over 3 minutes from the runtime's 5-second lines: | Profile | Ray tracing on | Ray tracing off | |---|---|---| | `4090` (12/8/6 threads) | 10.2 fps | 17.0 fps | | `4070` (8/6/4 threads) | 16.2 fps | 20.3 fps | Only P-cores have Hyper-Threading on these parts, so P-cores = logical processors − cores (24 − 16 = 8 here). On non-hybrid CPUs logical = 2 × cores, so nothing changes there. Something like: ```powershell $cpu = Get-CimInstance Win32_Processor -ErrorAction SilentlyContinue $cores = ($cpu | Measure-Object NumberOfCores -Sum).Sum $logical = ($cpu | Measure-Object NumberOfLogicalProcessors -Sum).Sum # Hybrid Intel (P-cores with HT, E-cores without): count the P-cores. if ($logical -gt $cores -and $logical -lt 2 * $cores) { $cores = $logical - $cores } ``` I haven't measured the `4080` card budgets (3072 / 2048 MB) on this PC yet, only the thread counts above. *AI-assisted (Claude Code).*
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 10:59 UTC · original

@⁠Smoodie7 The two exits after more than 1,000 evaluated frames cover live-feature teardown. I aligned the executable shutdown code in the isolated #219 to your tested 492ac96f in 5c3302e. The isolated revision is going through Windows CI. The 4080 profile and the next 1440p allocation stay on their own test paths.

**@⁠TaynanGT** on GitHub · 2026-11-27 10:59 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/217#issuecomment-7216557219) @⁠Smoodie7 The two exits after more than 1,000 evaluated frames cover live-feature teardown. I aligned the executable shutdown code in the isolated #219 to your tested `492ac96f` in `5c3302e`. The isolated revision is going through Windows CI. The 4080 profile and the next 1440p allocation stay on their own test paths.
github-bot changed target branch from main to gh-pr/217/base 2026-11-27 11:07:54 +00:00
github manually merged commit c96db2e95e into gh-pr/217/base 2026-11-27 11:07:56 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 11:08 UTC · original

@⁠efsebayern For that 13700K, choose the 8/6/4 counts explicitly for the comparison. I’m keeping the automatic selection discussion in #223. Logical processors minus cores measures the extra SMT threads and depends on HT being enabled. For hybrid detection, Windows exposes each CPU set’s EfficiencyClass, which can give us the actual topology. Windows CPU set information

**@⁠TaynanGT** on GitHub · 2026-11-27 11:08 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/217#issuecomment-7216726705) @⁠efsebayern For that 13700K, choose the 8/6/4 counts explicitly for the comparison. I’m keeping the automatic selection discussion in #223. Logical processors minus cores measures the extra SMT threads and depends on HT being enabled. For hybrid detection, Windows exposes each CPU set’s `EfficiencyClass`, which can give us the actual topology. [Windows CPU set information](https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-system_cpu_set_information)
This discussion has been locked. Commenting is limited to contributors.
No description provided.