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

Open
github-bot wants to merge 1 commit from github-bot/gh-3044 into main AGit
Owner

@⁠atorata on GitHub · 2026-11-29 19:44 UTC · original
atorata:fix/raise-bounds-vulkan → main · +8 −1 · 1 files · 1 commits · open

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.
**@⁠atorata** on GitHub · 2026-11-29 19:44 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3044) `atorata:fix/raise-bounds-vulkan` → `main` · +8 −1 · 1 files · 1 commits · open 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.
`raise` checked its threads against `width`/`height`, which are the
depth's size (`views.depth_size`), while it is dispatched over the image's
size and writes `light[p]`. When the depth is larger than the image, the
threads past the image pass the check and write outside it. D3D12 drops
such writes; under vkd3d-proton/Vulkan they fault the card.

With DLSS Performance on Series S the title's upscaler context is made at
1280x720 (the smallest its FSR4 accepts) while DLSS renders 960x540, so
this happened every frame there: on an RTX 3060 under Proton two runs
ended in an MMU fault (Xid 13, same ESR address both times) 1 and 25
minutes in, none at DLSS Quality (720p, sizes equal), and none in about
40 minutes at DLSS Performance with the image's own bounds checked too,
as `reflect_light`, `bound_light` and `clear_air` already do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016tyj8RxWUmnsgTN5VfppVa
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 19:47:16 +00:00
Author
Owner

@⁠stasadance on GitHub · 2026-11-30 04:21 UTC · original

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.

**@⁠stasadance** on GitHub · 2026-11-30 04:21 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3044#issuecomment-7268697954) 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 can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3044/head:github-bot/gh-3044'
git switch 'github-bot/gh-3044'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3044'
git switch 'github-bot/gh-3044'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3044'
git switch 'github-bot/gh-3044'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3044'
git switch 'main'
git merge --squash 'github-bot/gh-3044'
git switch 'main'
git merge --ff-only 'github-bot/gh-3044'
git switch 'main'
git merge 'github-bot/gh-3044'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3044
No description provided.