Ambient: raise stays inside the image it writes (Xid 13 under Vulkan at DLSS Performance) #3044

Open
atorata wants to merge 1 commit from upstream-pr/3044 into main
atorata commented 2026-11-29 19:44:13 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by atorata on 2026-11-29T19:44:13Z.


Fixes the Xid 13 (MMU fault) part of #2769 (that report: "with DXC v1.7.2207 (so raise compiles) ... the card faulted (Xid 13)").

What it changes

raise (the diffuse stand-in, crates/victory-gpu/src/ambient.rs) bounds its threads by width/height, which are the depth's size (words[6..8] = views.depth_size), but it is dispatched over the image's size (views.size) and writes light[p]. When the depth is larger than the image, the threads past the image pass the check and write outside the texture.

D3D12 drops out-of-bounds UAV writes, so on Windows this is invisible. Under vkd3d-proton/Vulkan it faults the card: NVRM: Xid 13 ... Graphics SM Warp Exception ... MMU Fault, then the title's watchdog.

With DLSS Performance on the Series S profile the sizes differ on every frame: the title's upscaler context is made at 1280x720 (FidelityFX: the title's upscaler made at a size its shipping FSR4 accepts ... asked_render=[960, 540] ... made_render=[1280, 720]) while DLSS renders 960x540 (a stand-in for the indirect light role=Resolve size=[960, 540]). At DLSS Quality both are 1280x720 and nothing is written outside.

The change checks the image's own size too (light.GetDimensions), as reflect_light, bound_light and clear_air in the same file already do. 8 lines in the HLSL, no Rust change.

How it was tested

  • GPU and profile: RTX 3060 12 GB, NVIDIA 620.73.04, CachyOS (kernel 7.3.6), Proton Experimental 11.0-20261112 with vkd3d-proton master 71cae091b beside victory.exe, DXC v1.9.2609 (raise built with or()/select() as in #2160). Series S, 1920x1080 output, FSR 3 frame generation 2x, ray tracing off.
  • Before: two sessions at DLSS Performance (540p) ended in Xid 13 after about 25 and 1 minutes; the ESR address was the same both times (0x...=0xf812b60), so the same instruction. No Xid 13 in about 1.5 h at DLSS Quality (720p), where depth and image sizes match.
  • After: about 40 minutes in four sessions at DLSS Performance (540p), including night scenes and sprinting, with no Xid at all.
  • For shader changes, the wave sizes tested: not applicable (a helper HLSL compute shader of ours, numthreads(8, 8, 1), not a translated title program).
  • cargo test passed for the crates it touches: not run; I could only cross-compile on Linux (cargo xwin build --release, it builds), and the helper is compiled at run time. raise_opt_in_chroma_scrub_filters_spikes_and_preserves_scene_tones_on_hardware_and_warp exercises RAISE on D3D12 and WARP and would be the one to watch on Windows.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #2160 (makes raise build under Proton; does not touch these lines), #2769 (the report). No open PR changes raise's bounds.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5554406502 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3044). Originally posted by [atorata](https://github.com/atorata) on 2026-11-29T19:44:13Z. --- Fixes the Xid 13 (MMU fault) part of #2769 (that report: "with DXC v1.7.2207 (so `raise` compiles) ... the card faulted (Xid 13)"). ## What it changes `raise` (the diffuse stand-in, `crates/victory-gpu/src/ambient.rs`) bounds its threads by `width`/`height`, which are the **depth's** size (`words[6..8] = views.depth_size`), but it is dispatched over the **image's** size (`views.size`) and writes `light[p]`. When the depth is larger than the image, the threads past the image pass the check and write outside the texture. D3D12 drops out-of-bounds UAV writes, so on Windows this is invisible. Under vkd3d-proton/Vulkan it faults the card: `NVRM: Xid 13 ... Graphics SM Warp Exception ... MMU Fault`, then the title's watchdog. With **DLSS Performance on the Series S profile** the sizes differ on every frame: the title's upscaler context is made at 1280x720 (`FidelityFX: the title's upscaler made at a size its shipping FSR4 accepts ... asked_render=[960, 540] ... made_render=[1280, 720]`) while DLSS renders 960x540 (`a stand-in for the indirect light role=Resolve size=[960, 540]`). At DLSS Quality both are 1280x720 and nothing is written outside. The change checks the image's own size too (`light.GetDimensions`), as `reflect_light`, `bound_light` and `clear_air` in the same file already do. 8 lines in the HLSL, no Rust change. ## How it was tested - GPU and profile: RTX 3060 12 GB, NVIDIA 620.73.04, CachyOS (kernel 7.3.6), Proton Experimental 11.0-20261112 with vkd3d-proton master `71cae091b` beside `victory.exe`, DXC v1.9.2609 (`raise` built with `or()`/`select()` as in #2160). Series S, 1920x1080 output, FSR 3 frame generation 2x, ray tracing off. - Before: two sessions at **DLSS Performance (540p)** ended in Xid 13 after about 25 and 1 minutes; the ESR address was the same both times (`0x...=0xf812b60`), so the same instruction. No Xid 13 in about 1.5 h at **DLSS Quality (720p)**, where depth and image sizes match. - After: about 40 minutes in four sessions at DLSS Performance (540p), including night scenes and sprinting, with no Xid at all. - For shader changes, the wave sizes tested: not applicable (a helper HLSL compute shader of ours, `numthreads(8, 8, 1)`, not a translated title program). - `cargo test` passed for the crates it touches: **not run**; I could only cross-compile on Linux (`cargo xwin build --release`, it builds), and the helper is compiled at run time. `raise_opt_in_chroma_scrub_filters_spikes_and_preserves_scene_tones_on_hardware_and_warp` exercises `RAISE` on D3D12 and WARP and would be the one to watch on Windows. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #2160 (makes `raise` build under Proton; does not touch these lines), #2769 (the report). No open PR changes `raise`'s bounds.
stasadance commented 2026-11-30 04:21:12 +00:00 (Migrated from github.com)

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


Confirming on Linux: RTX 4090, NVIDIA 620.73.04, kron4ek Wine 11.23, vkd3d-proton GE cae8353, Series S profile, DLSS + frame generation. We had Xid 13 (device lost) at world entry; with this PR applied (plus the folded code-table bound, #3695), several sessions in-world with no Xid and clean exits.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7268697954 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3044#issuecomment-7268697954). Originally posted by [stasadance](https://github.com/stasadance) on 2026-11-30T04:21:12Z. --- Confirming on Linux: RTX 4090, NVIDIA 620.73.04, kron4ek Wine 11.23, vkd3d-proton GE cae8353, Series S profile, DLSS + frame generation. We had Xid 13 (device lost) at world entry; with this PR applied (plus the folded code-table bound, #3695), several sessions in-world with no Xid and clean exits.
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/3044:upstream-pr/3044'
git switch 'upstream-pr/3044'

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