d4r README

项目的 README,来自 github.com/countervolts/d4r。合并为一个 markdown 文件:README.md。

d4r (dlss 4 radeon)

want to run xess (xmx) on radeon? check out x4r!

nightly releases for d4r can be found here

d4r runs NVIDIA's official DLSS Super Resolution (nvngx_dlss.dll) and experimental Ray Reconstruction (nvngx_dlssd.dll) in DirectX 12 games on AMD Radeon GPUs, on Linux (Proton) and natively on Windows. The game asks for DLSS as usual; OptiScaler hands the call to d4r, which runs the network on the AMD GPU: on d4r's own native engine where it covers the model, otherwise through ZLUDA (CUDA on ROCm/HIP) with the heaviest kernels replaced by hand-written RDNA2, RDNA3 and RDNA4 code.

Supported DLSS models: DLSS 3 CNN (E), DLSS 4 transformer (K, default), and DLSS 4.5 transformer (M, plus L for Ultra Performance). Ray Reconstruction presets D, E and F are experimental. DLSS 5 is PURPOSELY not supported.

Proof of concept: d4r shows that dlss can be ran on radeon gpus. See supported games for the tested games and models.

Not affiliated with NVIDIA or AMD.

To contact me my discord is ._ayo. or join the d4r discord server

Install

The release zips do not contain NVIDIA's files. Their installers download the pinned official DLSS, Ray Reconstruction and NGX files from NVIDIA, check their SHA-256 hashes and keep a verified copy in a per-user cache.

Linux (Proton)

  1. Extract d4r-<version>.zip into the folder that holds the game's main .exe (OptiScaler 10.0.0-pre1 as dxgi.dll with its OptiScaler/ dependencies, d4r_boot.dll, the d4r-patched vkd3d-proton, AMD's FSR files and the d4r folder).
  2. Run bash install.sh there. It installs NVIDIA's DLLs into d4r/ and builds the native engine's models from them. Needs Bash, curl, sha256sum, 7-Zip and python3 with numpy; no sudo, ROCm not required.
  3. In Steam, select a Proton version for the game (tested: GE-Proton11-3). No launch options are needed.

d4r_boot.dll, which d4r's dxgi.dll loads first, shows the game an NVIDIA GPU (what PROTON_FORCE_NVAPI=1 DXVK_NVAPI_GPU_ARCH=AD100 did before; those options still work and can be removed). When updating, replace dxgi.dll, d4r_boot.dll, d3d12.dll, d3d12core.dll and d4r/nvngx.dll together.

The full guide ships in the zip as D4R_README.txt. Already using OptiScaler? The -asi zip adds d4r as a plugin (ASI guide).

DLSS Frame Generation (NVIDIA's own, 2x-6x, and FG Lite) runs on RDNA3 and RDNA4: install.sh sets it up (it downloads DLSS-G 310.9.16 from NVIDIA's Streamline SDK and translates it on your machine), also for games without DLSS-G of their own through OptiScaler; d4r.ini [FrameGeneration] Model = auto uses FG Lite on RDNA3 and the full model on RDNA4 (docs/frame-generation.md).

Northlight games (Control, Alan Wake 2) keep their original motion vectors by default. Experimental display-resolution motion-vector reconstruction requires [Interop] NativeMotionVectors = true in d4r.ini and a matching patched driver. It can cause motion artifacts; restart the game after changing it.

Windows

  1. Extract the Windows release zip into the folder that holds the game's main .exe. If the folder already has a dxgi.dll or OptiScaler.ini from another OptiScaler install, move those out of the way first.
  2. Double-click install.cmd (install.bat in the HIP/ZLUDA build). It downloads NVIDIA's files and prepares the native models; Python and the other tools it needs are included or set up privately.
  3. Launch the game normally and select DLSS.

Needs Windows 10 or 11 with a current AMD Adrenalin driver; ROCm and the HIP SDK are not needed. Full guides: native D3D12 release, HIP/ZLUDA release. Avoid games with anti-cheat: OptiScaler injects a DLL.

Switching models and FSR in game

Open OptiScaler's menu (Insert):

Both are on by default; [OptiScaler] FollowPresets and Fsr4 in d4r.ini turn them off. Change OptiScaler settings and use Save INI normally; d4r's ASI setup preserves your choices after the initial installation.

On Linux the vkhip backend runs preset K on RDNA3 and is on by default. Experimental XeFG/FSR frame generation and XeLL/Anti-Lag latency conversion are bundled in the OptiScaler/ folder: enable FG in OptiScaler's Insert menu or use the per-game setup command with INI backups. Fresh installs keep FG off.

In some games some models can show visible artifacting with native upscaling. For fidelity over speed, set [Kernels] PreferAccuracy = true in d4r/d4r.ini (native kernel numerics).

Results

RDNA3, DLSS 4 (K), 2560x1440 output.

Windows, native D3D12

Mode Input FPS K GPU mean K GPU median
Quality 1712x960 98.2 2.221 ms 2.111 ms
Balanced 1512x848 105.4 2.224 ms 2.223 ms
Performance 1280x720 114.0 2.201 ms 2.208 ms
Ultra Performance 856x480 125.6 2.120 ms 2.124 ms

Presets M and L at their intended modes, RX 7700 XT, network on the native HIP layers (d3dhip). GPU median per upscale from the D3D12 harness (scripts/hillclimb/perf/bench.py, 3 interleaved rounds):

Preset Mode Input 2560x1440 output Input (4K) 3840x2160 output
M Performance 1280x720 5.25 ms 1920x1080 11.57 ms
L Ultra Performance 854x480 4.33 ms 1280x720 9.64 ms

Linux, RX 7700 XT, Ghost of Tsushima (2026-11-12, highest graphics settings, no approximations)

Mode FPS 1% low K GPU time FSR 4.1.1 FPS FSR 1% low FSR GPU time
Native AA (DLAA / FSR AA) 56.5 51.3 1.72 ms 53.9 48.8 2.20 ms
Quality 73.7 67.1 1.66 ms 70.4 63.3 2.19 ms
Balanced 78.0 68.3 1.64 ms 74.1 66.7 2.16 ms
Performance 80.8 72.2 1.61 ms 77.1 66.4 2.14 ms
Ultra Performance 85.7 75.8 1.57 ms 78.9 68.0 2.09 ms

K is 4.7–8.6% faster than FSR 4.1.1 at every mode, with upscale times about 0.5 ms lower.

The Windows and Linux runs used different benchmark runs and probably different settings, so compare within a table rather than across them. More measurements: performance, videos.

GPU support

GPU Chip Native kernels
RX 7700 XT, RX 7800 XT, RX 7700, Radeon PRO W7700 gfx1101 K, M, L (WMMA)
RX 7900 GRE / XT / XTX, Radeon PRO W7800 / W7900 gfx1100 K, M, L (WMMA)
RX 7600 / 7600 XT, RX 7650 GRE, RDNA3 integrated GPUs gfx1102, gfx1103 K, M, L (WMMA)
RDNA 3.5 integrated GPUs gfx1150–gfx1154 K, M L (WMMA)
RX 9070 XT / 9070 / 9070 GRE, Radeon AI PRO R9700 gfx1201 K, M, L (WMMA, native FP8)
RX 9060 XT / 9060 gfx1200 K, M, L (WMMA, native FP8)
RX 6000 series, Steam Deck, RDNA2 integrated GPUs gfx1030–gfx1036 K (software matrix products)
RDNA1 and older unsupported

Kernels missing for a GPU fall back to ZLUDA and can be much slower. Details: native kernels, Windows GPU coverage.

How it works

On Linux the shim keeps the game's inputs and output in VRAM through vkd3d-proton's Vulkan interop, and the native inference engine records K, M, L and Ray Reconstruction into the game's frame. On Windows the D3D12 engine records them directly into the game's D3D12 command list. Anything the engines do not cover runs NVIDIA's DLSS through ZLUDA with native kernels in place of the heaviest ones. Details: architecture.

Building from source

Path Contents
tools/ the NGX shims (Linux and Windows), the Wine CUDA bridge, DLSS harnesses, probes
kernels/ native kernels (k/ DLSS 4, m/ DLSS 4.5, tex/ texture tails, common/ matrix layouts) and their tools
engine/ the native K/L/M and Ray Reconstruction engines (Vulkan; d3d12/ for Windows)
patches/ ZLUDA, vkd3d-proton and OptiScaler patches
scripts/, config/, packaging/, docs/ build/launch scripts, the developer d4r.ini, release files, documentation

Star History

Star History Chart

License

GNU General Public License, version 3 only (GPL-3.0-only; 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. The downloaded NVIDIA files and the kernels built from NVIDIA's code are not covered by this license.

d4r (countervolts/d4r)

正在搜索数据库…

355 ·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 层会产生无效输出并被丢弃,导致画质下降。
大小
8.4 MB
星标
355
时长
2个月
提交 · 90 天