Add NVIDIA DLSS Ray Reconstruction denoiser - #1957
Conversation
The new 'DLSSDenoiser' class exposes DLSS Ray Reconstruction (DLSS-D) as an alternative to 'OptixDenoiser'. In contrast to the latter it is a real-time denoiser: it is driven with a sequence of independently rendered frames plus a G-buffer (diffuse albedo, shading normals, linear camera-space depth) and screen-space motion vectors, accumulates detail across those frames, and can upscale the result. The NGX integration mirrors the one in Blender's Cycles renderer: the DLSS SDK provides the type definitions at compile time, while the implementation is loaded from the NVIDIA display driver at runtime. Guiding buffers are packed with Dr.Jit and uploaded into CUDA arrays, and the handful of required CUDA driver entry points are resolved through Dr.Jit, so that nothing links against CUDA. Support is gated behind 'MI_ENABLE_DLSS' since the SDK headers are an external dependency; the SDK's Ray Reconstruction library is copied next to the Mitsuba binaries, where the driver is told to look for it. Requires a CUDA variant, an RTX GPU and NVIDIA driver 590 or newer. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
I think it might be problematic for Dr.Jit to ship DLSS binaries from a legal point of view. |
|
My plan was to rely on https://github.com/mitsuba-renderer/mitsuba-oidn for denoising in Mitsuba, which is distributed as a separate package and supports CPU, Metal, and CUDA in a consistent way. It is also an open source project, which makes things legally unproblematic. What benefits would DLSS give? |
True, and this is why the user needs to set the environment variable
Many good points and it makes a lot of sense.
It is a temporal denoiser and upscaler. It basically allows mitsuba to be a real-time viewport (see video using code from above). It could also speed up rendering out long sequences. On the Metal side, metalfx would be similar. Now that I saw Recording.2026-09-08.202151.mp4 |
The implementation is following Mitsuba's OptiX denoiser as well as Blender's DLSS integration (PR #153077).
Proof of Concept, prompted collaboratively with @WeiPhil via Claude.
Feel free to close this if not needed.
Using DLSS with a pre-built Mitsuba (Vibed)
Two independent gates: the first is decided when Mitsuba is compiled, the second on the machine that runs it.
Gate 1: compile
Enable via
MI_ENABLE_DLSS, with the entire class body sitting behind#if defined(MI_ENABLE_CUDA) && defined(MI_ENABLE_DLSS). Without it the bindings fall back to a stub whoseis_available()is a hardcodedreturn false. For the build only the headers are needed.Gate 2: the runtime library
A wheel built with the flag on still couldn't bundle
nvngx_dlssd.dll; the same licensing reason Blender declined, and whyCMakeLists.txtkeeps it out ofinstall. Therefore it needs to be manually provided by the user:pip install mitsubalib/Windows_x86_64/rel/nvngx_dlssd.dll(orlib/Linux_x86_64/rel/libnvidia-ngx-dlssd.so.*)site-packages/mitsuba/, or pointMI_DLSS_LIBRARY_PATHat the directory holding it
mi.set_variant('cuda_ad_rgb')mi.DLSSDenoiser.is_available()Run
Show Real-Time Example Code (requires: 'imgui-bundle' and 'pyopengl') (DLSS part is vibed)