Skip to content

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

Open
atorata wants to merge 1 commit into
trustno1-coder:mainfrom
atorata:fix/raise-bounds-vulkan
Open

atorata wants to merge 1 commit into
trustno1-coder:mainfrom
atorata:fix/raise-bounds-vulkan

Conversation

@atorata

@atorata atorata commented Nov 29, 2026

Copy link
Copy Markdown

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 ambient: the light estimate's passes build under Proton (no isnan, system compiler, root signature apart) #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

`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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016tyj8RxWUmnsgTN5VfppVa
@github-actions github-actions Bot added the pr-fix Pull request: fixes a bug label Nov 29, 2026
@github-actions github-actions Bot changed the title [pr-fix] Ambient: raise stays inside the image it writes (Xid 13 under Vulkan at DLSS Performance) Ambient: raise stays inside the image it writes (Xid 13 under Vulkan at DLSS Performance) Nov 29, 2026
moritz-eckhard-nickel added a commit to moritz-eckhard-nickel/VIctory-NVIDIA that referenced this pull request Nov 30, 2026
…e image it writes (Xid 13 under Vulkan at DLSS Performance)

trustno1-coder#3044 by atorata, head 253427b.
JustOptimize added a commit to JustOptimize/VIctory-Enhanced that referenced this pull request Nov 30, 2026
Port of trustno1-coder#3044, applied clean. An 8-line bounds check in the raise helper's HLSL: it also checks the image's own size, so a depth larger than the image cannot write outside the texture under Vulkan. Harmless here: on this build it did not stop the freezes (Xid 109 at 2:21 in the one-setting runs). Tried here with the batch (see README-hang.md). Not tested on NVIDIA by the author's own PR (RTX 3060 only); it matters only at DLSS Performance, and this build runs DLSS off.
@stasadance

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-fix Pull request: fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants