diff --git a/README.md b/README.md index 6f9695d..c4a375c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 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](https://github.com/vosen/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. +**Supported DLSS models:** DLSS 3 CNN (E), DLSS 4 transformer (K, default), and DLSS 4.5 transformer (M). DLSS 5 is PURPOSELY 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. @@ -49,23 +49,25 @@ On the same GPU DLSS starts at a disadvantage: its networks were designed for NV ## Known issues -- In some games native upscaling can show visible artifacting. +- In some games using some models native upscaling can show visible artifacting. + +For users who prioritize fidelity over speed, set `[Kernels] PreferAccuracy = true` in `d4r/d4r.ini` and restart the game. It defaults to `false`. This selects accuracy variants of every native kernel and restores conservative translation settings. It aims to match NVIDIA's arithmetic; 1:1 image quality against RTX DLSS is not yet proven. See [native kernel numerics](docs/native-kernels.md#numerics). ## 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. +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 by this project on a real GPU; an external video reports DLSS 4.5 running through d4r 0.1.2 on an RX 7900 XTX. 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 7900 GRE / XT / XTX, Radeon PRO W7800 / W7900 | gfx1100 | widened to f16 | RX 7900 XTX: [external video](https://www.youtube.com/watch?v=_GLjJ2Dn5pU) (DLSS 4.5); other cards 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. +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 and can be much slower. Earlier translated K layers produced invalid values; preserving FP16 denormal handling fixes that failure in recorded captures, but RTX image-quality parity remains unverified. Preset E does not use the native network kernels. ## How it works @@ -154,9 +156,15 @@ Gameplay recordings of each DLSS model at the Quality, Performance and Ultra Per | `packaging/` | the release's `d4r.ini`, OptiScaler settings, user guide and install check | | `docs/` | architecture, build, native kernel and performance notes | -## Stars +## Star History -[![Star History Chart](https://api.star-history.com/svg?repos=countervolts/d4r&type=Date)](https://star-history.com/#countervolts/d4r&Date) + + + + + Star History Chart + + ## License diff --git a/SUPPORTED_GAMES.md b/SUPPORTED_GAMES.md index e7aa511..97878a8 100644 --- a/SUPPORTED_GAMES.md +++ b/SUPPORTED_GAMES.md @@ -19,6 +19,10 @@ The following DirectX 12 games run DLSS Super Resolution through d4r on the test | Ratchet & Clank: Rift Apart | Works; occasional artifacts in the pause menu | Works; minor artifacts with HDR enabled and occasionally in the pause menu | Works; occasional artifacts in the pause menu | | Dying Light: The Beast | Works | Works | Works; small visual artifacts throughout | +Unsupported games: + +- **DOOM: The Dark Ages:** the game uses Vulkan and has no D3D12 mode. d4r currently supports D3D12 DLSS only, so its DLSS calls cannot reach d4r. The game's hardware ray-tracing requirement is separate from this limitation. + General notes: - Select DLSS in the game's graphics settings where it is offered. OptiScaler can also feed DLSS from a game's FSR or XeSS inputs, but those are a fallback for games that hide DLSS and can ghost or show a black screen. diff --git a/config/d4r.ini.default b/config/d4r.ini.default index a28ccd6..bdd17db 100644 --- a/config/d4r.ini.default +++ b/config/d4r.ini.default @@ -36,9 +36,15 @@ Model = K FrameAge = 0 [Kernels] +; Prefer NVIDIA's original arithmetic over speed for every native kernel and the translated fallback. +; Restores intermediate FP8 quantization, per-MMA f16 rounding and original denormal handling; keeps +; NGX's synchronizations. Selects accuracy variants in NativeKernelDir*/accuracy (or a marked accuracy +; directory directly). Missing accuracy kernels use translated PTX, never the fast set. Slower; this +; aims for fidelity, but RTX image parity is not proven. (D4R_PREFER_ACCURACY) +PreferAccuracy = false ; Native RDNA3 / RDNA4 kernels for the DLSS 4 and 4.5 network layers (replace ZLUDA's translated code). -; fast = native kernels with relaxed numerics (visually identical to exact, ~15% faster) -; exact = native kernels that reproduce NVIDIA's FP8/f16 rounding bit for bit +; fast = native kernels with relaxed numerics (unless PreferAccuracy is true) +; exact = a separately built directory with conservative FP8/f16 rounding; not an RTX parity guarantee ; off = ZLUDA-translated kernels only ; fast/exact need the code objects built by the native-kernel tools ([Paths] NativeKernelDir*). NativeKernels = off @@ -127,3 +133,4 @@ LogDir = auto [Env] ; Anything else, passed through as environment variables (one per line): ; D4R_SHIM_SPLIT_TIMEOUT_MS = 200 +; D4R_SHIM_BLOCKING_SYNC = 1 ; yield CPU while waiting for DLSS output diff --git a/docs/architecture.md b/docs/architecture.md index 5199cbb..3a1533d 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -39,7 +39,7 @@ Without the vkd3d-proton patch the shim shows the newest finished result instead - **CUDA NGX instead of D3D12 NGX.** NVIDIA's D3D12 path needs NVIDIA's driver. The CUDA path only needs a CUDA driver API, which ZLUDA provides. - **The Ada identity.** NGX picks network weights by GPU architecture. The weights have to match the PTX that ZLUDA compiles, which is sm_89 for DLSS 310. -- **Native kernels.** ZLUDA translates NVIDIA's warp-level matrix code faithfully but slowly (register pressure, lane shuffles, per-instruction mode switches). In the DLSS 4 transformer, ZLUDA's translation also produced non-finite outputs, which the final kernel masks, so the network had no effect. The native layers fix both. +- **Native kernels.** Translating NVIDIA's warp-level matrix code is slow (register pressure, lane shuffles, per-instruction mode switches). Earlier translated K layers also produced non-finite outputs that the final kernel masked. Native layers avoid that path; the compiler now preserves FP16 denormal requirements too, which fixes the translated failure in recorded captures. Numerical and image-quality parity with RTX hardware remains unverified. - **The GPU-side hand-offs.** With DLSS itself fast, most of the remaining gap to FSR 4 was the GPU idling while CPU threads waited on each other. Moving the waits onto the GPU raised GPU utilisation from about 95% to 99%. ## Configuration @@ -51,6 +51,7 @@ Without the vkd3d-proton patch the shim shows the newest finished result instead | `[DLSS] Model` | `D4R_DLSS_PRESET` | DLSS network: `E` (CNN), `K` (DLSS 4), `M` (DLSS 4.5) | | `[Latency] FrameAge` | `D4R_SHIM_SPLIT_FRAME`, `D4R_SHIM_MAX_IN_FLIGHT` | 0 = same-frame results; higher values pipeline frames | | `[Kernels] NativeKernels` | `D4R_ZLUDA_NATIVE_DIR` | native kernel directory (`fast` / `exact` / `off`) | +| `[Kernels] PreferAccuracy` | `D4R_PREFER_ACCURACY` | default off; accuracy variants for every native family and conservative translation/synchronization settings | | `[Interop] VramInterop` | `D4R_SHIM_VRAM_INTEROP` | keep inputs and output in VRAM | | `[Interop] GpuWait` | `D4R_SHIM_GPU_WAIT` | GPU-side wait for the game's inputs | | `[Interop] LinearInputs` | `D4R_SHIM_LINEAR_INPUTS` | NGX samples the input buffers in place | @@ -88,3 +89,12 @@ The release zip (`scripts/package_release.sh`) is unpacked into the folder that ## Logs The launcher writes each run's logs to `~/.cache/d4r-dlss-captures/game--