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

Merged
Smoodie7 merged 1 commit from upstream-pr/217 into main 2026-11-27 11:04:23 +00:00
Smoodie7 commented 2026-11-27 10:29:01 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Smoodie7 on 2026-11-27T10:29:01Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5525080255 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/217). Originally posted by [Smoodie7](https://github.com/Smoodie7) on 2026-11-27T10:29:01Z. --- 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.
TaynanGT commented 2026-11-27 10:37:39 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T10:37:39Z.


@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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7216112838 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/217#issuecomment-7216112838). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T10:37:39Z. --- @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.
Smoodie7 commented 2026-11-27 10:53:40 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Smoodie7 on 2026-11-27T10:53:40Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7216433572 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/217#issuecomment-7216433572). Originally posted by [Smoodie7](https://github.com/Smoodie7) on 2026-11-27T10:53:40Z. --- 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.
efsebayern commented 2026-11-27 10:59:53 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by efsebayern on 2026-11-27T10:59:53Z.


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).

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7216556225 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/217#issuecomment-7216556225). Originally posted by [efsebayern](https://github.com/efsebayern) on 2026-11-27T10:59:53Z. --- 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).*
TaynanGT commented 2026-11-27 10:59:57 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T10:59:57Z.


@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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7216557219 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/217#issuecomment-7216557219). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T10:59:57Z. --- @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 commented 2026-11-27 11:08:29 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T11:08:29Z.


@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

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7216726705 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/217#issuecomment-7216726705). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T11:08:29Z. --- @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)
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
TaynanGT/Vice-Tay!217
No description provided.