feat: add d4r inference engines and Windows parity tooling
Add native K/M/RR inference engines, HIP kernels, replay and validation harnesses, and Windows DLSS setup and runtime support. Include GPU profiling tools, build and packaging scripts, platform integration patches, and implementation documentation.
This commit is contained in:
1 parent
25493b3198
commit
7c5d3c9157
430 files changed
+76191
No files matched your search
@@ -0,0 +1,138 @@
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
What you need
|
||||
-------------
|
||||
- An AMD RDNA3 or RDNA4 GPU. This build includes native DLSS 4 and 4.5 network kernels for
|
||||
gfx1100–gfx1103 and gfx1200–gfx1201 unless the builder selected fewer targets. Only the RX 7700 XT
|
||||
(gfx1101) has been tested on a real GPU. gfx1201 has emulator testing; gfx1200 has compile testing
|
||||
only. Neither establishes RDNA4 runtime support, performance or driver stability. Texture-kernel
|
||||
optimisations are included only for targets supplied by the builder.
|
||||
- Linux with the amdgpu kernel driver (/dev/kfd). ROCm itself is not needed: the zip includes the
|
||||
ROCm 7.2.4 runtime in d4r/rocm. RocmDir in d4r/d4r.ini selects another ROCm installation instead.
|
||||
- GE-Proton 11 (tested: GE-Proton11-3), selected for the game in Steam.
|
||||
@clean - Two NVIDIA files, which this zip does not include:
|
||||
@clean - nvngx_dlss.dll, the DLSS library, version 310.7 or 310.9 (tested: 310.7.0 and 310.9.1).
|
||||
@clean Many games ship one, but often an older version. The d4r kernels check the DLSS code they
|
||||
@clean replace, so other versions still run, just slower.
|
||||
@clean - _nvngx.dll, NVIDIA's NGX runtime from an NVIDIA Windows display driver (tested: the one from
|
||||
@clean driver 596.36, file version 32.0.15.9636). Extract the driver installer, for example with
|
||||
@clean 7-Zip, and look for _nvngx.dll.
|
||||
@full - Nothing from NVIDIA: this zip already contains NVIDIA's DLSS library (nvngx_dlss.dll 310.7.0),
|
||||
@full NVIDIA's NGX runtime (_nvngx.dll 32.0.15.9636) and output kernels built from NVIDIA's DLSS code.
|
||||
|
||||
|
||||
Install
|
||||
-------
|
||||
1. Extract everything in this zip into the folder that holds the game's main .exe. For Unreal
|
||||
Engine games that is <game>/<Project>/Binaries/Win64/, next to <Project>-Win64-Shipping.exe.
|
||||
You get dxgi.dll, OptiScaler.ini, d3d12.dll, d3d12core.dll, this file and an d4r folder.
|
||||
When updating, replace both d3d12 DLLs with the shim: it requires their resource-lifetime extension.
|
||||
If the folder already has a dxgi.dll or OptiScaler.ini (another OptiScaler install), move those
|
||||
out of the way first. Also remove PROTON_USE_OPTISCALER from the game's launch options if you
|
||||
used GE-Proton's built-in OptiScaler: d4r brings its own.
|
||||
@clean 2. Copy nvngx_dlss.dll into the d4r folder, and _nvngx.dll into d4r/ngx.
|
||||
@clean 3. In Steam, open the game's Properties:
|
||||
@full 2. In Steam, open the game's Properties:
|
||||
- Compatibility: force GE-Proton11-3.
|
||||
- Launch options:
|
||||
PROTON_FORCE_NVAPI=1 DXVK_NVAPI_GPU_ARCH=AD100 %command%
|
||||
@clean 4. Optional: check the install from a terminal in that folder:
|
||||
@full 3. Optional: check the install from a terminal in that folder:
|
||||
sh d4r/d4r-check.sh
|
||||
@clean 5. Start the game and choose DLSS in its graphics settings.
|
||||
@full 4. Start the game and choose DLSS in its graphics settings.
|
||||
|
||||
The first time DLSS starts, the game can freeze for a minute or more while DLSS's GPU kernels are
|
||||
compiled. They are cached in ~/.cache/d4r, so later starts are quick.
|
||||
|
||||
|
||||
Settings
|
||||
--------
|
||||
- In d4r/d4r.ini, [Kernels] PreferAccuracy = true prioritizes fidelity over performance for every
|
||||
native kernel and the translated fallback. It selects separately built accuracy kernels, restores
|
||||
intermediate FP8 quantization and per-MMA f16 rounding, preserves denormal handling, and keeps
|
||||
NGX's synchronization calls. It defaults to false. Restart the game after changing it; the first
|
||||
start may compile a separate cache. Missing accuracy variants use translated kernels, never the
|
||||
fast native set. The mode aims to match NVIDIA's output, but 1:1 RTX image quality is not proven.
|
||||
- d4r/d4r.ini: d4r's settings for this game. The main one is the DLSS model:
|
||||
K (DLSS 4, default), E (DLSS 3 CNN, a little faster), M (DLSS 4.5), or L (DLSS 4.5
|
||||
for Ultra Performance, especially 4K; experimental). Set Model = L and select Ultra Performance
|
||||
in game or OptiScaler. Choosing the model does not change the render resolution.
|
||||
- On RDNA4, [Kernels] NativeFp8 is on by default. It selects native FP8 WMMA and the matching
|
||||
gfx12-fp8 kernel folder; set it to false to use f16 widening. The FP8 path has not been tested
|
||||
on a real RDNA4 GPU.
|
||||
- If L/M shows extra trails in motion, try [Kernels] NativeSwinEncoders = false with
|
||||
PreferAccuracy = true. This uses original translated enc1/enc2 layers while retaining other
|
||||
native acceleration. It reduced trails in a captured Townfall sequence on RX 7700 XT and costs
|
||||
some GPU time. Restart after changing it; other scenes and RDNA4 hardware still need testing.
|
||||
- OptiScaler.ini: OptiScaler's settings, such as its fps overlay and the render resolution of each
|
||||
quality mode. Press Insert in game for OptiScaler's menu.
|
||||
|
||||
Each game has its own copy of both files.
|
||||
|
||||
|
||||
Performance
|
||||
-----------
|
||||
Radeon RX 7700 XT, SILENT HILL Townfall at 2560x1440, a 62-second walk through the town, average fps:
|
||||
|
||||
Mode DLSS 3 CNN (E) DLSS 4 (K) DLSS 4.5 (M) FSR 4
|
||||
Quality 72 69 51 76
|
||||
Balanced 80 76 59 84
|
||||
Performance 88 82 69 94
|
||||
Ultra Performance 89 93 90 107
|
||||
Native 2560x1440 (TSR, no upscaling): 49
|
||||
|
||||
DLSS 4 in every mode, and E and M at Quality, were measured with this release. The other E and M
|
||||
figures come from the development setup, which runs the same kernels. Every DLSS frame is shown in
|
||||
the frame it belongs to, so there is no added latency.
|
||||
@clean This zip lacks the kernels built from NVIDIA's code, so its DLSS 4 is about 3 fps slower.
|
||||
|
||||
|
||||
Why the launch options
|
||||
----------------------
|
||||
- PROTON_FORCE_NVAPI=1 lets Proton's NVAPI run on an AMD GPU and present the GPU as NVIDIA's.
|
||||
OptiScaler only enables DLSS on NVIDIA hardware.
|
||||
- DXVK_NVAPI_GPU_ARCH=AD100 reports an RTX 40 series (Ada) GPU. DLSS then loads the network
|
||||
weights that match the kernels d4r runs.
|
||||
|
||||
|
||||
If something goes wrong
|
||||
-----------------------
|
||||
- d4r's log is d4r/d4r_nvngx.log. It is rewritten at every launch. Lines starting with "d4r:" and
|
||||
"nvcuda bridge:" name missing files or libraries.
|
||||
- DLSS missing in the game's menu, or no d4r_nvngx.log: check the launch options and that the
|
||||
files are next to the game's main .exe. For OptiScaler's own log, set LogToFile=true in
|
||||
OptiScaler.ini's [Log] section.
|
||||
- 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, DirectX 11 and Vulkan games.
|
||||
|
||||
|
||||
Uninstall
|
||||
---------
|
||||
Delete dxgi.dll, OptiScaler.ini, OptiScaler.log (if present), d3d12.dll, d3d12core.dll,
|
||||
D4R_README.txt and the d4r folder from the game folder, and clear the launch options. The kernel
|
||||
cache in ~/.cache/d4r can be deleted too.
|
||||
|
||||
|
||||
Licenses
|
||||
--------
|
||||
d4r is GNU General Public License, version 3 only (GPL-3.0-only). The release also contains ZLUDA (Apache 2.0 or MIT), vkd3d-proton
|
||||
(LGPL 2.1, patched) and OptiScaler 0.9.4 (GPL 3.0, unmodified). d4r/source/SOURCES.txt says where
|
||||
each file comes from, and d4r/licenses has the license texts. d4r is not affiliated with NVIDIA,
|
||||
AMD or the OptiScaler project.
|
||||
@clean NVIDIA's files are yours to supply, under NVIDIA's terms.
|
||||
@full NVIDIA's files in this zip (d4r/nvngx_dlss.dll, d4r/ngx/_nvngx.dll) and the kernels built from
|
||||
@full NVIDIA's code (listed in d4r/source/SOURCES.txt) are NVIDIA's property, are not covered by
|
||||
@full d4r's license, and are included by whoever distributes this zip, not by NVIDIA.
|
||||
@@ -0,0 +1,63 @@
|
||||
# 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**.
|
||||
|
||||
## Added
|
||||
|
||||
- **Prefer accuracy over performance.** Set `[Kernels] PreferAccuracy = true` in `d4r/d4r.ini` and restart the game. The release includes separate accuracy variants of every native network and texture kernel for all supported RDNA3 and RDNA4 targets, including RDNA4's native FP8 variants.
|
||||
- K restores FP16 accumulator rounding after each matrix step. M also restores intermediate FP8 quantization.
|
||||
- The accuracy path retains denormal handling, disables relaxed accumulation/fast-math switches, and keeps NGX's synchronization calls. It uses a separate compilation cache.
|
||||
- Missing accuracy variants use translated NVIDIA kernels and are logged; the fast native set is never silently substituted.
|
||||
- This aims to preserve NVIDIA's arithmetic. It is slower, its FPS cost has not been benchmarked, and **1:1 image quality against RTX DLSS is not proven**.
|
||||
- **Reproducible GLIBC 2.41 build environment.** A pinned Debian build image and release-build script rebuild ZLUDA/LLVM, the Wine bridge, the Windows DLLs, and both kernel sets. The ZIP includes toolchain details in `d4r/source/BUILD_INFO.txt`.
|
||||
|
||||
## Fixed
|
||||
|
||||
- **GLIBC loader compatibility ([#6](https://github.com/countervolts/d4r/issues/6)).** The previous release required `GLIBC_2.44` from `libm.so.6`, preventing ZLUDA from loading on systems such as the reporter's Bazzite installation. This release is built in a GLIBC 2.41 environment; the package check rejects any bundled Linux library requiring a newer ABI.
|
||||
- **Cyberpunk 2077 preset-K black artifacts ([#5](https://github.com/countervolts/d4r/issues/5)).** Preserve FP16/FP64 denormal requirements while limiting the performance optimization to FP32. The fix covers both translated kernels and the rebuilt native texture kernels. Captured-scene replays showed substantially fewer sky artifacts; this is not a guarantee that every scene is artifact-free.
|
||||
- **Stale direct-output redirects after resource destruction ([#8](https://github.com/countervolts/d4r/issues/8)).** Reused CUDA array handles no longer inherit an earlier feature's output buffer. This addresses the quality-switch corruption reported with preset M in Spider-Man 2.
|
||||
|
||||
## Improved
|
||||
|
||||
- **Synchronization diagnostics and an optional blocking output wait.** `D4R_SHIM_BLOCKING_SYNC=1` yields the CPU while waiting for DLSS output, with a fallback to context synchronization. It is an opt-in mitigation for [#7](https://github.com/countervolts/d4r/issues/7); reduced CPU usage on the reporter's RDNA4 setup still needs confirmation.
|
||||
- **More useful failure logs.** Rejected input/output formats and dimensions are now recorded even after startup, with repeated errors rate-limited. Output-wait CPU and wall time are reported separately, and GPU timing queries are deferred until asynchronous work finishes.
|
||||
- **More conservative accuracy texture builds.** Strict surface conversions use separate helper functions, avoiding a compiler failure when the original denormal handling is retained.
|
||||
- **Accuracy build safeguards.** The builder refuses to label a directory containing older fast binaries as an accuracy set. Configuration tests cover every release target, missing-set fallback, invalid markers, environment precedence, and the default-off behavior.
|
||||
|
||||
## Also included from 0.1.2
|
||||
|
||||
These capabilities remain in the release; they are not newly validated hardware results:
|
||||
|
||||
- Experimental RDNA4 builds for gfx1200/gfx1201, with `NativeFp8` enabled by default, alongside gfx1100–gfx1103 RDNA3 builds.
|
||||
- Kernel selection uses the GPU with the most SIMDs when integrated and discrete GPUs coexist; `D4R_GPU_ARCH` overrides it.
|
||||
- DLSS 3 matrix-kernel acceleration; M's cached weight preparation, packed FP8 encoding, improved patch-merge/weight loads, and direct output; K's CU-mode layers; wave64 performance texture variants.
|
||||
- Native texture/output variants for the game's motion-vector resolution, HDR/LDR input and depth direction, compiled offline per GPU target.
|
||||
- The bundled ROCm 7.2.4 runtime: no separate ROCm installation is required.
|
||||
|
||||
The 0.1.2 performance measurements remain historical results. They are not benchmarks of this rebuild or the new accuracy mode.
|
||||
|
||||
## Install or upgrade
|
||||
|
||||
1. Back up your `d4r/d4r.ini` and `OptiScaler.ini` if you customized them.
|
||||
2. Extract `d4r-0.1.3.zip` into the folder holding the game's main `.exe` (`<Project>/Binaries/Win64` for Unreal Engine games), keeping the ZIP's layout.
|
||||
3. Restore your settings if needed. Older INIs omit `PreferAccuracy`, which defaults to off; add it under `[Kernels]` to enable it.
|
||||
4. Select GE-Proton 11 in Steam (tested integration: GE-Proton11-3), with:
|
||||
```
|
||||
PROTON_FORCE_NVAPI=1 DXVK_NVAPI_GPU_ARCH=AD100 %command%
|
||||
```
|
||||
5. Select DLSS in the game and restart after changing the accuracy option.
|
||||
|
||||
The rebuilt runtime may compile a new kernel cache on first start. `sh d4r/d4r-check.sh` checks the install. [SUPPORTED_GAMES.md](https://github.com/countervolts/d4r/blob/main/SUPPORTED_GAMES.md) lists game-specific setup and known issues.
|
||||
|
||||
## Validation and limits
|
||||
|
||||
- All bundled Linux ELF libraries are checked against the GLIBC 2.41 ABI limit; release loading is checked inside that environment.
|
||||
- The release contains performance and accuracy kernels for all eight target variants. Configuration tests and sampled CPU-emulated kernel/reference checks cover the new accuracy path; these do not establish full-game or RTX parity.
|
||||
- RDNA4 remains experimental: emulator/compiler coverage does not prove hardware speed, image quality, or driver stability. The external RX 7900 XTX report is RDNA3, not RDNA4 validation.
|
||||
- Super Resolution only: Frame Generation, Ray Reconstruction, and DLSS 5 Neural Rendering are unsupported. Keep Ray Reconstruction off.
|
||||
|
||||
## Licenses
|
||||
|
||||
d4r is GNU General Public License, version 3 only (GPL-3.0-only). ZLUDA, LLVM, vkd3d-proton, OptiScaler, and the bundled ROCm libraries retain their respective licenses in `d4r/licenses`; sources and patches are listed in `d4r/source`. NVIDIA's libraries and texture kernels compiled from its code are not covered by those licenses. d4r is not affiliated with NVIDIA or AMD.
|
||||
|
||||
The attached `.sha256` file contains the ZIP's checksum.
|
||||
@@ -0,0 +1,46 @@
|
||||
d4r @VERSION@: where every file in this release comes from
|
||||
============================================================
|
||||
|
||||
Built from source by d4r (GPL-3.0-only, d4r/licenses/d4r-LICENSE.txt):
|
||||
d4r/nvngx.dll NGX shim tools/d4r_nvngx_shim.cpp in the d4r repository
|
||||
d4r/nvcuda.dll Wine CUDA bridge tools/wine_nvcuda_bridge.c
|
||||
d4r/kernels/ native RDNA3/RDNA4 kernels for the DLSS 4 and 4.5 network layers, kernels/k and kernels/m
|
||||
(d4r-kernels.txt lists hashes of the DLSS code each kernel replaces; it holds no NVIDIA code)
|
||||
d4r/d4r.ini, d4r/d4r-check.sh, D4R_README.txt
|
||||
|
||||
Third-party software, unmodified or patched by d4r:
|
||||
d4r/zluda/libcuda.so ZLUDA (Apache License 2.0 or MIT), https://github.com/vosen/ZLUDA
|
||||
commit @ZLUDA_COMMIT@ with d4r/source/patches/zluda/0002 to 0007 applied.
|
||||
It contains LLVM (Apache License 2.0 with LLVM exceptions).
|
||||
Licenses: d4r/licenses/ZLUDA-LICENSE-*.txt, d4r/licenses/LLVM-LICENSE.txt
|
||||
d3d12.dll, d3d12core.dll
|
||||
vkd3d-proton (GNU LGPL 2.1), https://github.com/HansKristian-Work/vkd3d-proton
|
||||
commit @VKD3D_COMMIT@ with d4r/source/patches/vkd3d-proton/0001 and 0002 applied,
|
||||
built with its build-win64.txt cross file (meson --buildtype release).
|
||||
Licenses: d4r/licenses/vkd3d-proton-*.txt
|
||||
d4r/rocm/lib/ ROCm 7.2.4 runtime, unmodified, from AMD's Ubuntu 22.04 packages
|
||||
(https://repo.radeon.com/rocm/apt/7.2.4): HIP (hip-runtime-amd, MIT),
|
||||
comgr (NCSA; contains LLVM, Apache License 2.0 with LLVM exceptions),
|
||||
ROCr (hsa-rocr, NCSA) and rocprofiler-register (MIT).
|
||||
Sources: https://github.com/ROCm/rocm-systems and https://github.com/ROCm/llvm-project,
|
||||
tag rocm-7.2.4. Licenses: d4r/licenses/ROCm-*
|
||||
libelf.so.1 (elfutils 0.186, GNU LGPL 3.0 or GPL 2.0) and libnuma.so.1 (numactl 2.0.14,
|
||||
GNU LGPL 2.1), unmodified, from Ubuntu 22.04's libelf1 and libnuma1 packages; their
|
||||
sources are Ubuntu's elfutils 0.186-1ubuntu0.1 and numactl 2.0.14-3ubuntu2 source packages.
|
||||
Licenses: d4r/licenses/ROCm-lib*-copyright.txt
|
||||
dxgi.dll OptiScaler 0.9.4 (GNU GPL 3.0), unmodified OptiScaler.dll renamed to dxgi.dll.
|
||||
Source: https://github.com/optiscaler/OptiScaler/tree/v0.9.4
|
||||
License: d4r/licenses/OptiScaler-LICENSE-GPL-3.0.txt
|
||||
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 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 distributes
|
||||
@full this zip, not by NVIDIA:
|
||||
@full d4r/nvngx_dlss.dll NVIDIA DLSS Super Resolution library @DLSS_VERSION@
|
||||
@full d4r/ngx/_nvngx.dll NVIDIA NGX runtime from NVIDIA's Windows display driver, @NGX_VERSION@
|
||||
@full d4r/kernels/*/hiluma_engine_output_*, 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), compiled by ZLUDA
|
||||
d4r is not affiliated with NVIDIA, AMD or the OptiScaler project.
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
# Checks an d4r install: run it from the game folder (the one holding the game's .exe and d4r/),
|
||||
# or give that folder as the argument. It only reads files and prints what it finds.
|
||||
# usage: sh d4r/d4r-check.sh [GAME_FOLDER] [ROCM_DIR]
|
||||
GAME="${1:-.}"
|
||||
D4R="$GAME/d4r"
|
||||
# ROCm: the argument, else d4r.ini's RocmDir, else the bundled d4r/rocm, else D4R_ROCM_DIR, else /opt/rocm
|
||||
ini_rocm=$(sed -n 's/^[[:space:]]*RocmDir[[:space:]]*=[[:space:]]*\([^;#]*\).*/\1/p' "$D4R/d4r.ini" 2>/dev/null | tail -1 | sed 's/[[:space:]]*$//')
|
||||
[ "$ini_rocm" = auto ] && ini_rocm=
|
||||
case "$ini_rocm" in "~/"*) ini_rocm="$HOME/${ini_rocm#\~/}" ;; esac
|
||||
[ -z "$ini_rocm" ] && [ -d "$D4R/rocm/lib" ] && ini_rocm="$D4R/rocm"
|
||||
ROCM="${2:-${ini_rocm:-${D4R_ROCM_DIR:-/opt/rocm}}}"
|
||||
problems=0
|
||||
ok() { printf ' ok %s\n' "$1"; }
|
||||
bad() { printf ' MISSING %s\n' "$1"; problems=$((problems + 1)); }
|
||||
note() { printf ' note %s\n' "$1"; }
|
||||
|
||||
printf 'd4r install in %s\n' "$(cd "$GAME" 2>/dev/null && pwd || echo "$GAME")"
|
||||
[ -d "$D4R" ] || { printf 'no d4r folder here; run this from the folder with the game .exe\n'; exit 1; }
|
||||
ls "$GAME"/*.exe >/dev/null 2>&1 && ok "game executable next to d4r/" || note "no .exe next to d4r/ (it must be the game's main executable folder)"
|
||||
for f in dxgi.dll OptiScaler.ini d3d12.dll d3d12core.dll d4r/nvngx.dll d4r/nvcuda.dll d4r/zluda/libcuda.so d4r/d4r.ini; do
|
||||
[ -f "$GAME/$f" ] && ok "$f" || bad "$f (re-extract the d4r zip)"
|
||||
done
|
||||
[ -f "$D4R/nvngx_dlss.dll" ] && ok "d4r/nvngx_dlss.dll (NVIDIA DLSS library)" || bad "d4r/nvngx_dlss.dll: copy NVIDIA's DLSS library here"
|
||||
[ -f "$D4R/ngx/_nvngx.dll" ] && ok "d4r/ngx/_nvngx.dll (NVIDIA NGX runtime)" || bad "d4r/ngx/_nvngx.dll: copy NVIDIA's NGX runtime here"
|
||||
if [ -f "$D4R/nvngx_dlss.dll" ] && command -v strings >/dev/null 2>&1; then
|
||||
v=$(strings -el "$D4R/nvngx_dlss.dll" | grep -A1 '^FileVersion$' | sed -n 2p | tr ',' '.')
|
||||
case "$v" in
|
||||
310.7.*|310.9.*) ok "DLSS version $v (native kernels verified for 310.7 and 310.9)" ;;
|
||||
"") note "cannot read the DLSS version" ;;
|
||||
*) note "DLSS version $v: kernels whose code changed run without native kernels (slower)" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
found=
|
||||
for dir in "$ROCM/lib" /opt/rocm/lib /usr/lib /usr/lib64 /usr/lib/x86_64-linux-gnu; do
|
||||
[ -e "$dir/libamdhip64.so.7" ] && { found="$dir"; break; }
|
||||
done
|
||||
[ -n "$found" ] && ok "ROCm HIP runtime ($found/libamdhip64.so.7)" || bad "ROCm HIP runtime 7.x (libamdhip64.so.7); re-extract the d4r zip, which includes it in d4r/rocm"
|
||||
[ -e /dev/kfd ] && ok "/dev/kfd (ROCm compute device)" || bad "/dev/kfd: the amdgpu compute interface is not available"
|
||||
target=""
|
||||
for props in /sys/class/kfd/kfd/topology/nodes/*/properties; do
|
||||
s=$(sed -n 's/^simd_count //p' "$props" 2>/dev/null); t=$(sed -n 's/^gfx_target_version //p' "$props" 2>/dev/null)
|
||||
[ -n "$s" ] && [ "$s" != 0 ] && [ -n "$t" ] && [ "$t" != 0 ] && { target="$t"; break; }
|
||||
done
|
||||
if [ -n "$target" ]; then
|
||||
arch=$(printf 'gfx%d%d%x' $((target / 10000)) $(((target / 100) % 100)) $((target % 100)))
|
||||
if [ -d "$D4R/kernels/$arch" ]; then ok "GPU $arch: native kernels present"
|
||||
else note "GPU $arch: no native kernels for it in this release (DLSS runs, much slower)"; fi
|
||||
fi
|
||||
|
||||
printf '\nSteam launch options for this game:\n PROTON_FORCE_NVAPI=1 DXVK_NVAPI_GPU_ARCH=AD100 %%command%%\n'
|
||||
[ "$problems" -eq 0 ] && printf '\nEverything d4r needs is in place.\n' || printf '\n%d thing(s) to fix above.\n' "$problems"
|
||||
@@ -0,0 +1,76 @@
|
||||
; 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.
|
||||
|
||||
[DLSS]
|
||||
; DLSS model recommendations:
|
||||
;
|
||||
; Model | DLSS | Recommended modes | Notes
|
||||
; ------+-------+---------------------------------+----------------------------------
|
||||
; K | 4 | DLAA / Quality / Balanced | Default; faster alternative to M/L
|
||||
; M | 4.5 | Performance | More demanding on RDNA3
|
||||
; L | 4.5 | Ultra Performance | Especially 4K; experimental
|
||||
; E | 3 CNN | Quality / Balanced / Performance | Legacy faster fallback
|
||||
; F | 3 CNN | DLAA / Ultra Performance | Deprecated; prefer K or L
|
||||
;
|
||||
; Select the upscaling mode separately in game/OptiScaler. These are recommendations;
|
||||
; other modes are allowed. L requires the L texture build.
|
||||
; game = use the game/OptiScaler choice. Benchmarks: D4R_README.txt.
|
||||
Model = K
|
||||
; NVIDIA's library marks the image "DLSS SDK - DO NOT DISTRIBUTE" in this setup; d4r turns that off.
|
||||
; true shows it.
|
||||
ShowWatermark = false
|
||||
|
||||
[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).
|
||||
; 1-3: allow results up to that many frames old. Slightly more fps, more input latency.
|
||||
FrameAge = 0
|
||||
|
||||
[Kernels]
|
||||
; Prioritize fidelity over speed. Uses accuracy variants of all native kernels, preserves NVIDIA's
|
||||
; intermediate FP8/f16 rounding and denormal handling, and keeps NGX's synchronization calls.
|
||||
; Slower but aims to match RTX DLSS.
|
||||
PreferAccuracy = false
|
||||
; false reduces L/M motion trails by using original enc1/enc2 layers; other native kernels stay on.
|
||||
; Best paired with PreferAccuracy = true; costs some GPU time. Restart after changing this.
|
||||
NativeSwinEncoders = true
|
||||
; Hand-written RDNA3 and RDNA4 kernels for the DLSS 4 and 4.5 networks (d4r\kernels). Each one is used
|
||||
; only when your DLSS library's code for that kernel matches the code it was written for; otherwise
|
||||
; that kernel is compiled from NVIDIA's code instead, which is slower but still correct.
|
||||
NativeKernels = on
|
||||
; RDNA4 (RX 9000 series) only: run DLSS's FP8 math on the GPU's native FP8 matrix units, with NVIDIA's
|
||||
; own FP8 rounding in the DLSS 4.5 (M) layers. off runs it as 16-bit math, as on RDNA3. Ignored on
|
||||
; other GPUs.
|
||||
NativeFp8 = on
|
||||
|
||||
[Interop]
|
||||
; Experimental thin-feature tracking: 0 = off; 1/2 = opaque-surface dilation radius.
|
||||
; Both enabled values fill sky gaps from the nearest foreground within 8 render pixels.
|
||||
; Requires render- or display-resolution, unjittered motion vectors and same-frame linear VRAM inputs. Restart to change.
|
||||
; Unsupported features keep original vectors; larger radii may affect disocclusion edges.
|
||||
MotionVectorDilation = 0
|
||||
; Keep inputs and output in video memory. Input and output readiness waits use CPU sleeps.
|
||||
VramInterop = true
|
||||
LinearInputs = true
|
||||
ElideNgxSync = true
|
||||
; Lets DLSS's last kernel write straight into the game's output buffer (DLSS 4 / K only). It takes
|
||||
; effect only while d4r's own output kernel runs, which it does when the DLSS library matches.
|
||||
DirectOutput = auto
|
||||
|
||||
[Paths]
|
||||
; Linux paths.
|
||||
; ROCm installation (default: the ROCm runtime in d4r\rocm, else /opt/rocm)
|
||||
RocmDir = auto
|
||||
; Cache for the compiled DLSS kernels (default ~/.cache/d4r). The first launch fills it.
|
||||
CacheDir = auto
|
||||
|
||||
[Debug]
|
||||
; d4r's log is d4r\d4r_nvngx.log, rewritten at every launch.
|
||||
; Profile = true adds one line of timings per frame.
|
||||
Profile = false
|
||||
|
||||
[Env]
|
||||
; Extra environment variables for d4r, NAME = value.
|
||||
; Sleeping event queries are the default; 0 restores context waits for an A/B comparison.
|
||||
; D4R_SHIM_BLOCKING_SYNC = 0
|
||||
@@ -0,0 +1,27 @@
|
||||
; OptiScaler settings for the d4r Windows drag-in release. Values not listed keep OptiScaler's
|
||||
; defaults. The DLSS model is chosen in d4r\d4r.ini, not here.
|
||||
[Upscalers]
|
||||
Dx12Upscaler=dlss
|
||||
[FrameGen]
|
||||
Enabled=false
|
||||
FGInput=nofg
|
||||
FGOutput=nofg
|
||||
[DLSS]
|
||||
Enabled=true
|
||||
AllowExternalBackend=true
|
||||
RenderPresetOverride=false
|
||||
UseGenericAppIdWithDlss=false
|
||||
[Libraries]
|
||||
; Relative to this folder (needs d4r's OptiScaler with patch 0006).
|
||||
NvngxPath=d4r
|
||||
NvngxDlssPath=d4r\dlss
|
||||
NvngxFeaturePath=d4r\dlss
|
||||
[Hotfix]
|
||||
RestoreComputeSignature=false
|
||||
RestoreGraphicSignature=false
|
||||
ExtendedStateRestore=false
|
||||
[Log]
|
||||
LogToFile=true
|
||||
LogLevel=2
|
||||
[Menu]
|
||||
DisableSplash=true
|
||||
@@ -0,0 +1,68 @@
|
||||
d4r for Windows: NVIDIA DLSS on AMD Radeon RDNA3 and RDNA4
|
||||
===========================================================
|
||||
|
||||
d4r runs NVIDIA's own DLSS (DLSS 4 by default) on a Radeon GPU in DirectX 12 games. OptiScaler
|
||||
(included) catches the game's upscaler calls and hands them to d4r.
|
||||
|
||||
This is an early release. Only the Radeon RX 9070 XT has been tested on real hardware; every other
|
||||
GPU in this release is compile-tested. SUPPORTED_GAMES.md in the source repository lists the
|
||||
tested games. Expect problems.
|
||||
|
||||
What you need
|
||||
-------------
|
||||
- Windows 11, a Radeon RX 7000 or RX 9000 series GPU, a current AMD Adrenalin driver.
|
||||
- A DirectX 12 game without anti-cheat (OptiScaler injects a DLL; it can get an account banned).
|
||||
- NVIDIA DLSS files. The ZIP does not include them. Run install.bat to download official, pinned files.
|
||||
It downloads DLSS SR 310.9.1, Ray Reconstruction 310.9.1, and extracts _nvngx.dll from the
|
||||
official NVIDIA 617.14 driver without installing or changing the driver. SR is stored under d4r\dlss;
|
||||
RR is stored separately under d4r\rr so SR startup cannot auto-load an RR feature. It needs internet access
|
||||
and about 1 GiB temporary space. The driver archive and DLSS files are SHA256-verified.
|
||||
NVIDIA license terms apply. Files stay local and outside public d4r packages.
|
||||
|
||||
Install
|
||||
-------
|
||||
1. Extract this ZIP into the folder that holds the game's main .exe. For Unreal Engine games that
|
||||
is <game>\<Project>\Binaries\Win64, next to <Project>-Win64-Shipping.exe.
|
||||
If the folder already has a dxgi.dll or OptiScaler.ini (another OptiScaler install), or a
|
||||
d3d12.dll from a Linux install, move those out first.
|
||||
2. Run install.bat and accept the download prompt. Existing d4r DLLs are backed up outside the game
|
||||
folder with their original paths and SHA256 hashes. Verified downloads are cached in
|
||||
%LOCALAPPDATA%\d4r\cache.
|
||||
The Ray Reconstruction DLL is local preparation only; this Windows game backend does not run RR yet.
|
||||
3. Optional: check the install. In the game folder, open PowerShell and run
|
||||
powershell -ExecutionPolicy Bypass -File d4r\d4r-check.ps1
|
||||
4. Start the game from Steam, Epic or a shortcut as usual. In its graphics settings choose DLSS
|
||||
(or FSR 3.1/XeSS if DLSS is hidden; OptiScaler then feeds DLSS). Keep frame generation off.
|
||||
Press Insert in game for OptiScaler's menu.
|
||||
|
||||
The first time DLSS starts, the game can freeze for several minutes while DLSS's GPU kernels are
|
||||
compiled. They are cached in %LOCALAPPDATA%\d4r\cache, so later starts are quick.
|
||||
|
||||
Settings
|
||||
--------
|
||||
Edit d4r\d4r.ini (it is commented) and restart the game. Each game has its own copy.
|
||||
- Model: E (preset 5), K (11, DLSS 4), L (12) or M (13, DLSS 4.5). E and L set NGX hints only; the standalone engine and L texture kernels are not integrated. Select quality mode in the game.
|
||||
- Kernels/NativeFp8: experimental RDNA4 setting. Requires a matching gfx12 native-FP8 M bundle; keep false with the standard FP16 release. Token-lane and hardware-pack builds remain unvalidated on GPU.
|
||||
- AsyncInterop, ValidateOutput, Log: for testing and bug reports; the defaults are the tested setting.
|
||||
OptiScaler's own settings (overlay, render ratios) are in OptiScaler.ini.
|
||||
|
||||
If something goes wrong
|
||||
-----------------------
|
||||
- Run d4r\d4r-check.ps1: it prints ok / MISSING / note lines with the fix for each problem.
|
||||
- d4r\d4r_nvngx.log is rewritten at every launch. A line "d4r: DLSS disabled: ..." says why.
|
||||
- DLSS missing in the menu and no d4r_nvngx.log: the files are not next to the game's main .exe.
|
||||
- For a bug report run d4r\d4r-check.ps1 -Report and send the ZIP it puts on your Desktop,
|
||||
with your GPU, the game, the model and what the image looked like. Logs can contain folder names.
|
||||
- Not supported: frame generation, standalone inference engine, DLSS Ray Reconstruction, DirectX 11, Vulkan. E/L preset hints do not establish full Windows feature parity.
|
||||
|
||||
Uninstall
|
||||
---------
|
||||
Delete dxgi.dll, OptiScaler.ini, OptiScaler.log (if present), WINDOWS_README.txt and the d4r folder
|
||||
from the game folder. The cache in %LOCALAPPDATA%\d4r can be deleted too. Nothing else was changed.
|
||||
|
||||
Licenses
|
||||
--------
|
||||
d4r is GNU General Public License, version 3 only (GPL-3.0-only). This ZIP also contains ZLUDA (Apache 2.0 or MIT), OptiScaler (GPL 3.0,
|
||||
patched; the patches are in the source repository), and AMD's HIP runtime. d4r\licenses has the
|
||||
texts. d4r is not affiliated with NVIDIA, AMD or the OptiScaler project. NVIDIA's files are yours
|
||||
to supply, under NVIDIA's terms.
|
||||
@@ -0,0 +1,47 @@
|
||||
; d4r settings for this game (Windows). This file lives in the game's d4r folder and applies to
|
||||
; this game only. Edit it with Notepad, save, and restart the game. Mistakes are reported in
|
||||
; d4r\d4r_nvngx.log and by d4r-check.ps1; an invalid value falls back to the default shown here.
|
||||
;
|
||||
; Engine inference and Ray Reconstruction are not yet integrated in this Windows build.
|
||||
|
||||
[DLSS]
|
||||
; DLSS model:
|
||||
;
|
||||
; Model | DLSS | Recommended modes | Notes
|
||||
; ------+------+----------------------------+--------------------------------------
|
||||
; K | 4 | DLAA / Quality / Balanced | Default; faster
|
||||
; M | 4.5 | Performance | More demanding
|
||||
; E | 3 | Quality / Balanced | Legacy CNN; no native Windows layer acceleration
|
||||
; L | 4.5 | Ultra Performance | Experimental; not Windows-validated
|
||||
;
|
||||
; Select the quality mode (Quality, Performance, ...) in the game or the OptiScaler menu (Insert).
|
||||
; E and L select NGX preset hints only. They do not enable standalone engine paths.
|
||||
Model = K
|
||||
; NVIDIA's library stamps "DLSS SDK - DO NOT DISTRIBUTE" over the image; d4r turns that off.
|
||||
; true shows it.
|
||||
ShowWatermark = false
|
||||
|
||||
[Interop]
|
||||
; Experimental: lets the game continue while DLSS runs on the GPU instead of waiting for it.
|
||||
; Requires a game that uses one D3D12 command queue. Off is the tested setting. Whether it is
|
||||
; faster depends on the game and has not been measured broadly; turn it off if the game crashes,
|
||||
; stutters or shows a wrong image.
|
||||
AsyncInterop = false
|
||||
|
||||
[Debug]
|
||||
; Check every DLSS output for invalid values (NaN/Inf) on the GPU. Costs some speed; use it only
|
||||
; when reporting a problem.
|
||||
ValidateOutput = false
|
||||
; normal: errors and a summary in d4r\d4r_nvngx.log. verbose: every API call and kernel launch
|
||||
; (large log; use it only when asked for a bug report).
|
||||
Log = normal
|
||||
|
||||
[Paths]
|
||||
; Folder for the compiled DLSS kernels. auto = %LOCALAPPDATA%\d4r\cache. The first launch fills it
|
||||
; and can take several minutes; later launches are quick.
|
||||
CacheDir = auto
|
||||
|
||||
[Kernels]
|
||||
; Experimental RDNA4 only. Requires a matching token-lane FP8 M bundle; startup refuses this
|
||||
; setting if d4r/native/<gfx12>/d4r-native-fp8.txt is absent. Default keeps the FP16 path.
|
||||
NativeFp8 = false
|
||||
@@ -0,0 +1,10 @@
|
||||
@echo off
|
||||
setlocal
|
||||
echo d4r will download NVIDIA DLSS files and an NVIDIA driver archive.
|
||||
echo Driver archive is about 945 MiB (991 MB). It will only extract _nvngx.dll; it will not install or change drivers.
|
||||
choice /C YN /N /M "Continue? [Y/N] "
|
||||
if errorlevel 2 exit /b 0
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0install-dlss.ps1" -PackageRoot "%~dp0." -Yes
|
||||
set "D4R_INSTALL_EXIT=%ERRORLEVEL%"
|
||||
if not "%D4R_INSTALL_EXIT%"=="0" echo d4r install failed. Read the message above.
|
||||
exit /b %D4R_INSTALL_EXIT%
|
||||
Reference in new issue
Block a user