Add CUDA NGX Ray Reconstruction support

Run the signed CUDA-capable denoiser through feature 13 with independent D/E presets, pre-Init discovery, per-frame guide and camera snapshots, normalized integer guide staging, paired alpha output, and recorded-resource retirement.

Add the required ZLUDA/LLVM patch, behavioral configuration tests, GPU harness coverage, optional denoiser installation and packaging, and tested support limitations. Preserve upstream attribution and distinguish LLVM licensing from the ZLUDA portions of the patch.
This commit is contained in:
woutermans committed 2026-10-12 12:47:53 +02:00
1 parent 503061d568
commit 7117c38674
20 files changed
+3038 -114

No files matched your search

+13 -8
View File
@@ -1,14 +1,17 @@
Modified in this fork for CUDA Ray Reconstruction support and validation (2026).
d4r @VERSION@: NVIDIA DLSS on AMD Radeon RDNA3 and RDNA4 under Linux and Proton
=====================================================================
d4r runs NVIDIA's own DLSS Super Resolution (DLSS 4 by default) on AMD Radeon RDNA3 and RDNA4 GPUs in
DirectX 12 games under Proton. OptiScaler (included) catches the game's DLSS calls and hands them to
d4r. d4r then runs NVIDIA's DLSS on the Radeon through ZLUDA, with the heaviest parts replaced by
kernels written for RDNA3 and RDNA4.
d4r runs NVIDIA's own DLSS Super Resolution (DLSS 4 by default), plus experimental Ray Reconstruction,
on AMD Radeon GPUs in DirectX 12 games under Proton. OptiScaler (included) catches the game's DLSS calls
and hands them to d4r. d4r runs NVIDIA's DLSS through ZLUDA; the heaviest Super Resolution kernels are
replaced by kernels written for RDNA3 and RDNA4.
This is an early release, tested on one GPU (Radeon RX 7700 XT) in about a dozen DirectX 12 games.
SUPPORTED_GAMES.md in the source repository lists them, with per-game setup notes. Expect problems
in other games.
This is an early release. Super Resolution game testing primarily uses Radeon RX 7700 XT.
Ray Reconstruction presets D/E, temporal history, and separate alpha were validated on RX 9070 XT
(gfx1201) with native FP8 WMMA enabled. Other RR GPU targets and RTX image-quality parity are unverified.
SUPPORTED_GAMES.md in the source repository lists per-game setup notes. Expect problems in other games.
What you need
@@ -144,7 +147,9 @@ If something goes wrong
can be expected with the shim under d4r/; do not move it into the game root to silence that check.
- A wrong image: try Model = E in d4r/d4r.ini, and report the problem with both logs.
- Do not use d4r in games with anti-cheat. OptiScaler's DLL injection can get an account banned.
- Not supported: DLSS Frame Generation, DLSS Ray Reconstruction and DirectX 11.
- Ray Reconstruction requires the CUDA-capable 3.10.7 nvngx_dlssd.dll beside the shim and the matching
patched d3d12.dll/d3d12core.dll. Enable [Kernels] NativeFp8; the scalar FP8 RR path is not validated.
- Not supported: DLSS Frame Generation and DirectX 11.
- Development builds expose an experimental native Vulkan NGX path using CPU staging.
Youngblood is the first intended game test; gameplay remains unverified. See the
project documentation (docs/vulkan.md) for its separate Vulkan setup and limits.
+23
View File
@@ -1,3 +1,4 @@
<!-- Modified in this fork for CUDA Ray Reconstruction support and validation (2026). -->
# Unreleased
- Native engine, preset L (DLSS 4.5, render preset 12): the engine now runs L ([Engine] Enabled, models in `engine/l` and `engine/l-ldr`, built by `engine/compile_m.py` from a capture of preset L; `scripts/install_d4r_runtime.sh` stages `D4R_ENGINE_MODEL_L` / `D4R_ENGINE_MODEL_L_LDR`). Every stage, `d4r-m` on captured frames and the D3D12 harness are byte-identical to the CUDA backend running NVIDIA's translated kernels, apart from isolated single-frame knife edges (96-122 dB). 1280x720 -> 3840x2160 takes 3.8 ms on an RX 9070 XT. Display-resolution motion vectors keep the CUDA backend, as for M. Details: `engine/L_NOTES.md`.
@@ -15,6 +16,28 @@
- Prevent stale in-place output mappings when games destroy and recreate output textures. The harness now supports `D4R_HARNESS_RECREATE_OUTPUT=1` for this regression.
- Integration validation on RX 9070 XT: moving 12-frame RGBA16F/R10G10B10A2 copy, packed and in-place sequences matched byte-for-byte; fast and accuracy paths, token-disabled reference layers, MicroCUDA tube-cache reuse, discarded input recordings and four feature-recreation cycles were exercised. gfx1101 and gfx1200 compatibility builds also passed; those targets were not runtime-tested.
## Ray Reconstruction
- Run the signed CUDA-capable 3.10.7 DLSS-Denoiser through the NGX core's feature-13 lifecycle.
Presets D and E select distinct network weights independently of the Super Resolution preset.
- Preserve per-frame guide resources, camera matrices, subrects, and stable CUDA texture handles.
Support normalized 8-bit albedo guides with the CUDA array-format ABI and stage full guide rows.
- Support pre-Init feature discovery through the denoiser's requirements export without initializing
NGX with a provisional application identity. Initialized capability checks remain authoritative.
- Keep separate alpha and RGB outputs paired, including padded output subrects; consume alpha
readback synchronously before CPU conversion.
- Bound R8_UINT alpha stores to one byte and balance guide/alpha references when evaluation
cannot place its frame marker. Publish cached denoiser capabilities as a coherent snapshot.
- Extend the ZLUDA patch stack for real denoiser PTX, LLVM lowering, half texture/store operations,
and release/acquire ordering around workgroup barriers.
- Verified D/E temporal evaluation and separate alpha on RX 9070 XT (gfx1201) with native FP8 WMMA.
Scalar FP8 temporal RR produced nonfinite output and is not validated. Cold compilation can stall
initial rendering; other GPU targets and image-quality parity with RTX hardware remain unverified.
- Cyberpunk 2077 2.31 rendered loaded local saves with path tracing and RR preset D enabled at
1920×1080 and 3840×2160 Ultra Performance on gfx1201. The actual overlay reported DLSSD 310.7.0,
and CUDA feature-13 evaluations completed. The observed ~53 FPS at 1080p and ~20 FPS at 4K are
snapshots, not comparative benchmarks. Newer DLSS 4.5 RR preset F is not implemented or validated.
# d4r 0.1.3
This release adds an optional accuracy mode and fixes the GLIBC compatibility failure, DLSS artifacts, and stale output-buffer redirects reported after 0.1.2. Accuracy mode is **off by default**.
+4 -1
View File
@@ -1,3 +1,5 @@
Modified in this fork for CUDA Ray Reconstruction support and validation (2026).
d4r @VERSION@: where every file in this release comes from
============================================================
@@ -35,7 +37,7 @@ Third-party software, unmodified or patched by d4r:
OptiScaler.ini OptiScaler 0.9.4's OptiScaler.ini with the values d4r needs set
(packaging/optiscaler.settings in the d4r repository)
@clean Not included: NVIDIA's DLSS library (nvngx_dlss.dll) and NGX runtime (_nvngx.dll). You supply them
@clean Not included: NVIDIA's DLSS libraries (nvngx_dlss.dll, nvngx_dlssd.dll) and NGX runtime (_nvngx.dll). You supply them
@clean and are responsible for complying with NVIDIA's license terms.
@full NVIDIA's software, not covered by any license in d4r/licenses and included by whoever built this
@full zip, not by NVIDIA. NVIDIA's license does not permit redistributing it; do not share this zip:
@@ -48,6 +50,7 @@ Third-party software, unmodified or patched by d4r:
@installer d4r/kernels/*/hiluma_engine_*, rrlite_enc0_*, rrlite_dec0_*, rrlite_post_*, rrlite_downsample_*
@installer NVIDIA's PTX with parts replaced by d4r code (kernels/tex) or translated to
@installer HIP (kernels/native), compiled by ZLUDA or ROCm's clang.
@full Optional d4r/nvngx_dlssd.dll: NVIDIA DLSS Ray Reconstruction library, when supplied through D4R_BUNDLE_DLSSD
@full d4r/kernels/*/hiluma_engine_*, rrlite_enc0_*, rrlite_dec0_*, rrlite_post_*, rrlite_downsample_*
@full DLSS kernels: NVIDIA's PTX from nvngx_dlss.dll, with parts replaced by d4r code
@full (kernels/tex in the d4r repository) or translated to HIP (kernels/native),
+10
View File
@@ -1,3 +1,4 @@
; Modified in this fork for CUDA Ray Reconstruction support and validation (2026).
; d4r settings for this game. This file lives in the game's d4r folder and applies to this game only.
; "auto" means the built-in default. Any setting can also be overridden with the environment variable
; that config/d4r.ini.default in the source repository lists for it, e.g. in the game's launch options.
@@ -21,6 +22,15 @@ Model = K
; true shows it.
ShowWatermark = false
[RayReconstruction]
; Requires a CUDA-capable nvngx_dlssd.dll (tested: 310.7) beside nvngx.dll and RR enabled in game.
; auto uses the denoiser when available; false disables the route.
; RR D/E temporal validation on gfx1201 uses [Kernels] NativeFp8 = on; scalar FP8 RR is not validated.
Enable = auto
; Independent denoiser presets: auto (game choice), default, D or E (transformer).
; E requires a denoiser DLL containing that model.
Model = auto
[Latency]
; 0: every frame shows its own DLSS result, as with a native upscaler (needs the d3d12.dll that came
; with d4r next to the game).