OpenDLSS: A Vulkan Reimplementation of Nvidia's DLSS 5 Neural Rendering Network
OpenDLSS: A Vulkan-Based Recreation of Nvidia's DLSS 5 Neural Rendering
This project, hosted at maanHimself/OpenDLSS-NR, provides a high-fidelity Vulkan reimplementation of the DLSS 5 Neural Rendering (NR) network. The implementation is designed to be bit-exact compared to the original NVIDIA version.
🚀 Project Overview
The core of this project is a 71-block Swin/ViT network, mirroring the DLSS-NR build 310.8.0. It leverages tensor cores to execute using precision.
Note on Accuracy: This is not just a visual approximation. The intermediates are identical; all 75 block boundaries match the original byte-for-byte.
Implementation Variants
- Vulkan Path: The primary version utilizing tensor cores and for maximum performance.
- WebGPU Path: Located in
ports/browser-webgpu/, this is a standalone implementation. It achieves the same bit-exact results in a browser environment without relying on or tensor cores.
🧠 Network Architecture
The system utilizes a U-net structure composed of shifted-window transformer blocks, anchored by a global ViT at the base.
Technical Specifications
- Structure: 71 blocks distributed across six pooling levels.
- Precision: activations with accumulation.
- Weight Size: .
- Function:
UpscalingGenerative Neural Rendering.
What is "Generative Neural Rendering"?
According to NVIDIA, this process re-renders a frame already produced by the engine. It injects noise to generate fine detail and modifies the skin, structure, and tone based on a specific style setting.
Input/Output Flow:
- Inputs:
- A low-dynamic-range (LDR) proxy of the rendered frame.
- Three channels of Gaussian noise.
- A reprojected version of the previous frame's output.
- Five scalar conditioning values.
- Outputs: Four channels per pixel (consisting of an RGB residual and one temporal-blend logit).
Example: WebGPU port at resolution.
🛠️ Build and Execution
Setup Checklist
- Run
fetch_tools.ps1to getglslang,Vulkan-Headers,volk,CMake, andNinja. - Run
build.ps1to compile shaders, PTX, and thedlss5vk.exebinary. - Run
fetch_filament.ps1andbuild_filament.ps1to set up the demo environment. - Run
build_demo.ps1to generatedlss5-demo.exe.
Command Line Interface
You can interact with the tool using the following commands:
# Benchmark performance
build\dlss5vk.exe bench --model <dir> --width 768 --height 768
# Profile per-dispatch timings
build\dlss5vk.exe profile --model <dir> --width 768 --height 768
# Verify bit-exactness against a fixture
build\dlss5vk.exe parity --model <dir> --fixture <dir>
# Bisect kernels for block-0
build\dlss5vk.exe verify --model <dir> --fixture <dir>
The demo application can be launched via double-click, loading scenes from build\scenes or via a glTF command-line argument.
📈 Performance Metrics
Tested on an RTX 4070 SUPER (minimum values over 40 frames).
| Resolution | Execution Time |
|---|---|
| 2.8 ms | |
| 7.8 ms | |
| 12.6 ms | |
| 29.3 ms |
Note: Medians are slightly higher due to the GPU alternating between two clock states.
📂 Project Structure
| Component | Location | Details |
|---|---|---|
| Host | src/ | C++20 logic: Vulkan context, weight re-layout, and CPU reference. |
| GLSL Kernels | shaders/ | Reference path: FP8 GEMMs, QKV window attention, and expert MLP. |
| PTX Kernels | scripts/ptx/ | Fast path: mma.sync E4M3, cp.async rings, and split-K GEMMs. |
| Demo | demo/ | Integrated with Filament (Apache-2.0) and ImGui. |
| WebGPU Port | ports/browser-webgpu/ | Browser-based, bit-exact implementation without hardware acceleration. |
📋 Requirements
Hardware & Software
- OS: Windows.
- GPU: NVIDIA Ada Lovelace or newer.
- Vulkan Extensions:
VK_KHR_cooperative_matrixVK_NV_cooperative_matrix2VK_EXT_shader_float8VK_NV_cuda_kernel_launch
- Toolchain:
- Visual Studio 2022+ (C++ x64 toolset).
- Python 3 (for PTX generation).
- Node.js + npm & Pillow (for scene conversion).
- Git.
Tooling
The tools/ directory (git-ignored) manages:
glslang 16.6.0Vulkan-Headers v1.4.363CMake 3.31&Ninja 1.13