d4r README

The project's README from github.com/countervolts/d4r. As one markdown file: README.md.

d4r (dlss 4 radeon)

d4r runs NVIDIA's official DLSS Super Resolution library (nvngx_dlss.dll) in Windows games on AMD Radeon GPUs under Linux and Proton. The game asks for DLSS as usual; the DLSS network runs on the AMD GPU through ZLUDA (CUDA on ROCm/HIP), with the heaviest DLSS kernels replaced by hand-written RDNA3 and RDNA4 code.

Supported DLSS models: DLSS 3 CNN (E), DLSS 4 transformer (K, default), and DLSS 4.5 transformer (M). DLSS 5 is not supported.

Proof of concept: d4r shows that DLSS can run on an AMD GPU, but it is not really that practical for everyday use yet. It has been tested on one GPU in a handful of games and depends on unreleased patches to ZLUDA and vkd3d-proton.

See supported games for the tested games and DLSS models.

Not affiliated with NVIDIA or AMD.

Results

DLSS Ultra Performance demo video.

Radeon RX 7700 XT (RDNA3, gfx1101), SILENT HILL Townfall at 2560×1440, every DLSS result is presented in the frame it belongs to (no added latency).

Mode DLSS 3 CNN (preset E) DLSS 4 (preset K) DLSS 4.5 (preset M) FSR 4*
Quality (1705×960) 71.7 fps 67.9 49.3 76.0
Balanced (1488×837) 80.8 75.9 58.0 84.5
Performance (1280×720) 89.7 84.1 69.0 94.0
Ultra Performance (853×480) 89.1 95.5 92.2 107.3

* FSR 4 was measured in an earlier session (2026-09-27); the DLSS columns on 2026-09-29, when the same machine ran about 2–4% slower overall. Run back to back on the same day, this release is faster than 0.1.1 at Quality with every model (E 71.2 → 71.9, K 67.9 → 68.1, M 48.4 → 49.3 fps), and more in games whose DLSS settings differ from Townfall's, whose kernel variants now run natively too.

For reference, native 2560×1440 without upscaling (the game's TSR at 100%) runs at 49.1 fps on the same walk.

On the same GPU DLSS starts at a disadvantage: its networks were designed for NVIDIA's tensor cores, and parts of them still run as translated NVIDIA code. How the numbers were measured, and what each optimisation contributed, is in docs/performance.md.

Known issues

GPU support

d4r builds for RDNA3 and RDNA4. A newly built release compiles native DLSS 4 and 4.5 network kernels for the targets below and selects the matching set at runtime. Only the RX 7700 XT has been tested on a real GPU; RDNA4 runtime and performance remain unverified on hardware.

GPU Chip FP8 math Runtime testing
RX 7700 XT, RX 7800 XT, RX 7700, Radeon PRO W7700 gfx1101 widened to f16 RX 7700 XT only
RX 7900 GRE / XT / XTX, Radeon PRO W7800 / W7900 gfx1100 widened to f16 untested
RX 7600 / 7600 XT, RX 7650 GRE gfx1102 widened to f16 untested
RDNA3 integrated GPUs gfx1103 widened to f16 untested
RX 9070 XT / 9070 / 9070 GRE, Radeon AI PRO R9700 gfx1201 native FP8 (NativeFp8, default on) emulator only
RX 9060 XT / 9060 gfx1200 native FP8 (NativeFp8, default on) compile only
RDNA2 and older unsupported

Native network kernels are built for all listed gfx11/gfx12 targets. Texture kernels are compiled for each target by d4r_emit when supplied to the package script; RDNA4 also has a -fp8 variant. The bridge selects the KFD GPU with the most SIMDs, avoiding an integrated GPU when a discrete GPU is present; D4R_GPU_ARCH overrides that choice. Missing native kernels fall back to ZLUDA. Without the native network kernels, NVIDIA's translated DLSS 4 layers produce invalid values and DLSS discards the network's output, so K loses the transformer's image quality. Preset E does not use the native network kernels.

How it works

game (D3D12) ──► OptiScaler (DLSS inputs) ──► d4r_nvngx.dll  (NGX D3D12 API, tools/d4r_nvngx_shim.cpp)
                                                   │  inputs/output stay in VRAM (vkd3d-proton Vulkan interop,
                                                   │  command list split around DLSS for same-frame results)
                                                   ▼
                          official NGX core + nvngx_dlss.dll  (their CUDA path)
                                                   ▼
                          nvcuda.dll  (Wine CUDA bridge, tools/wine_nvcuda_bridge.c)
                                                   ▼
                          ZLUDA  (patches/zluda: PTX → AMDGPU, WMMA, native kernel overrides)
                                                   ▼
                          native RDNA3 and RDNA4 kernels  (kernels/: DLSS 4 and 4.5 network layers)

Details: docs/architecture.md and docs/native-kernels.md.

Install the release

The release zip works like an OptiScaler release: its contents go into the folder that holds the game's main .exe.

  1. Extract d4r-<version>.zip there. It contains:
    • OptiScaler 0.9.4 as dxgi.dll, with an OptiScaler.ini set up for d4r;
    • the d4r-patched vkd3d-proton (d3d12.dll, d3d12core.dll);
    • an d4r folder with the shim, the CUDA bridge, ZLUDA, the ROCm 7.2.4 runtime, the native kernels, this game's d4r.ini, and NVIDIA's nvngx_dlss.dll (310.7) and _nvngx.dll.
  2. In Steam, select GE-Proton 11 for the game and set these launch options: PROTON_FORCE_NVAPI=1 DXVK_NVAPI_GPU_ARCH=AD100 %command%.

ROCm does not need to be installed: the zip includes its runtime (from AMD's Ubuntu 22.04 packages, which run under Steam's container runtime on any distribution). The zip's NVIDIA files and the kernels built from NVIDIA's code are not covered by this repository's license (see NOTICE). The Proton prefix and the system are not changed. packaging/D4R_README.txt is the full guide that ships in the zip; scripts/package_release.sh builds the zip (see docs/building.md).

Requirements (building from source)

Build and run

The full sequence is in docs/building.md. In short:

  1. Build ZLUDA ee2f25a with patches/zluda/0002–0007 applied, including its d4r_emit example for offline texture builds.
  2. Build the patched vkd3d-proton: scripts/build_vkd3d_proton_d4r.sh OUT_DIR.
  3. Build the shim and bridge: scripts/build_d4r_nvngx_shim.sh, scripts/build_wine_nvcuda_bridge.sh.
  4. Stage the runtime with your NVIDIA files: scripts/install_d4r_runtime.sh _nvngx.dll nvngx_dlss.dll.
  5. Build the native kernels: D4R_ROCM_DIR=… D4R_DLSS_DLL=… D4R_ZLUDA_EMIT=… kernels/build.sh.
  6. Fill in ~/.config/d4r/d4r.ini (created from config/d4r.ini.default on first launch) and start the game with scripts/d4r_play.sh.

The launcher backs up and restores everything it touches in the Proton prefix: OptiScaler.ini, the prefix's d3d12.dll/d3d12core.dll, and the game's Engine.ini when cvars are set.

Preset videos

Gameplay recordings of each DLSS model at the Quality, Performance and Ultra Performance presets.

Ready or Not

Model Quality Performance
DLSS 4.5 video video
DLSS 4 video video
DLSS 3 video video

Townfall

Model Quality Ultra Performance
DLSS 4.5 video video
DLSS 4 video video

Repository layout

Path Contents
tools/ the NGX shim, the Wine CUDA bridge, a D3D12 DLSS harness, probes and kernel replay tools
kernels/ native RDNA3/RDNA4 kernels (k/ DLSS 4, m/ DLSS 4.5, tex/ texture-kernel parts, common/ WMMA layouts), their build script, validation tools and numpy reference models
patches/ ZLUDA and vkd3d-proton patches
scripts/ build, install, launch and probe scripts
config/ the default d4r.ini for the developer launcher
packaging/ the release's d4r.ini, OptiScaler settings, user guide and install check
docs/ architecture, build, native kernel and performance notes

Stars

Star History Chart

License

Apache License 2.0 (see LICENSE). The patches in patches/ are offered under the licenses of the projects they modify: ZLUDA (Apache-2.0 or MIT) and vkd3d-proton (LGPL-2.1). See NOTICE.

To contact me my discord is ._ayo.

d4r (countervolts/d4r)

Searching Database…

292 ·GitHub
这是什么?d4r 让 NVIDIA 官方的 DLSS Super Resolution 库在 Linux 和 Proton 下的 Windows 游戏中运行于 AMD Radeon 显卡:通过 ZLUDA(ROCm/HIP 上的 CUDA)转译 DLSS 网络,并用手写的 RDNA3/RDNA4 代码替换最重的内核。它支持 DLSS 3 CNN 模型和 DLSS 4/4.5 transformer 模型;不支持 DLSS 5。
怎么为某个游戏安装它?把发布 zip 解压到包含游戏 .exe 的文件夹,然后在 Steam 里选择 GE-Proton 11 作为兼容工具,并添加启动选项 'PROTONFORCENVAPI=1 DXVKNVAPIGPUARCH=AD100 %command%'。ROCm 不需要单独安装,因为它的运行时已经打包在 zip 里。
需要 NVIDIA 自家的 DLSS 文件吗?需要——你需要 NVIDIA 的 nvngxdlss.dll(310.7)和匹配的 nvngx.dll,因为这些文件以及用 NVIDIA 代码构建的内核不在 d4r 自身许可证的覆盖范围内。如果改为从源码构建,还需要带 HIP 的 ROCm、集成了 OptiScaler 的 GE-Proton 构建、Rust、git-lfs、meson/ninja 以及 MinGW/clang-cl 工具链。
它适合日常游戏使用了吗?没有——作者称它只是概念验证,仅在一张 GPU(RX 7700 XT)上的少数几款游戏里测试过,而且依赖尚未发布的 ZLUDA 和 vkd3d-proton 补丁。RDNA4 的表现在真实硬件上尚未验证,而且有些游戏在原生放大下就有可见伪影。
它能在我的 Radeon 显卡上用吗?原生内核只针对 RDNA3 显卡(RX 7700/7800/7900 系列,gfx1100-1103)和 RDNA4 显卡(RX 9060/9070 系列,gfx1200/1201);RDNA2 及更老的 GPU 不受支持,而且到目前为止只有 RX 7700 XT 真正在实机上测试过。
d4r 实际能带来多少提升?在 RX 7700 XT 上玩《SILENT HILL Townfall》时,DLSS Quality 大约跑在 67-72 fps,而原生渲染为 49.1 fps,不过相同设置下仍然落后 AMD 自家的 FSR 4。
这是 NVIDIA 或 AMD 的官方项目吗?不是,README 明确声明 d4r 与 NVIDIA 或 AMD 没有任何隶属关系。
DLSS 转译管线实际是怎么工作的?一个 D3D12 垫片拦截 OptiScaler 转发来的游戏 NGX 调用,Wine 侧的 CUDA 桥把它们转交给 ZLUDA,ZLUDA 为 AMD 显卡转译 NVIDIA 的 PTX 代码,手写的原生内核则替换掉最重的 DLSS 网络层以换取速度。
如果我的显卡没有可用的原生内核会怎样?桥接会退回到 ZLUDA 的通用 PTX 转译,但缺少原生内核时,NVIDIA 转译出的 DLSS 4 transformer 层会产生无效输出并被丢弃,导致画质下降。
Size
4.2 MB
Stars
292
Age
20d
Commits · 90 Days