Skip to content

Commit 93f84e9

Browse files
committed
WSL 2 support, bump nanobind & drjit versions
1 parent 8698699 commit 93f84e9

File tree

5 files changed

+72
-3
lines changed

5 files changed

+72
-3
lines changed

docs/index.rst

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ This command will also install :monosp:`Dr.Jit` on your system if not already av
3535
See the :ref:`developer guide <sec-compiling>` for complete instructions on building
3636
from the git source tree.
3737

38+
When using the `Windows Subsystem for Linux 2 (WSL2)
39+
<https://learn.microsoft.com/en-us/windows/wsl/compare-versions#whats-new-in-wsl-2>`__,
40+
you must follow the :ref:`linked instructions <optix-wsl2>` to enable hardware-accelerated
41+
ray tracing on NVIDIA GPUs.
42+
3843
Requirements
3944
^^^^^^^^^^^^
4045

@@ -149,5 +154,6 @@ When using Mitsuba 3 in academic projects, please cite:
149154
:hidden:
150155

151156
src/gallery
157+
src/optix_setup
152158
release_notes
153159
zz_bibliography

docs/src/developer_guide.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ Going further
6363
developer_guide/documentation
6464
developer_guide/variants_cpp
6565
developer_guide/writing_plugin
66-
developer_guide/testing
66+
developer_guide/testing

docs/src/optix_setup.rst

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.. _optix-wsl2:
2+
3+
Mitsuba on WSL 2
4+
----------------
5+
6+
Mitsuba uses the `NVIDIA OptiX
7+
<https://developer.nvidia.com/rtx/ray-tracing/optix>`__ framework for
8+
hardware-accelerated ray tracing. While OptiX is not yet officially supported
9+
on the `Windows Subsystem for Linux 2 (WSL 2)
10+
<https://learn.microsoft.com/en-us/windows/wsl/compare-versions#whats-new-in-wsl-2>`__,
11+
it *is* possible to get it to run in practice. The following instructions are
12+
based on an NVIDIA `forum post by @dhart
13+
<https://forums.developer.nvidia.com/t/problem-running-optix-7-6-in-wsl/239355/8>`__
14+
Use them at your own risk.
15+
16+
- Determine your driver version using the ``nvidia-smi`` command. This is a number
17+
such as ``560.94`` shown in the middle of the first row.
18+
19+
- Go to the `NVIDA driver webpage <https://www.nvidia.com/en-us/drivers>`__ to
20+
download a similar driver version for Linux (64 bit). You may have to click on
21+
the "New feature branch" tab to find newer driver versions.
22+
23+
- Following this step, you should have file named
24+
``NVIDIA-Linux-x86_64-*.run``. Move it to your WSL home directory but *do
25+
not install it*. Instead, merely extract its contents within a WSL session using
26+
the following command:
27+
28+
.. code-block:: console
29+
30+
$ bash NVIDIA-Linux-x86_64-*.run -x --target driver
31+
32+
Create a symbolic link that exposes the already installed CUDA driver to runtime loading:
33+
34+
.. code-block:: console
35+
36+
$ ln -s /usr/lib/wsl/lib/libcuda.so /usr/lib/x86_64-linux-gnu/
37+
38+
Next, copy-paste and run the following command:
39+
40+
.. code-block:: console
41+
42+
$ mkdir driver-dist && cp driver/libnvoptix.so.* driver-dist/libnvoptix.so.1 && cp driver/libnvidia-ptxjitcompiler.so.* driver-dist/libnvidia-ptxjitcompiler.so.1 && cp driver/libnvidia-rtcore.so.* driver-dist && cp driver/libnvidia-gpucomp.so.* driver-dist && cp driver/nvoptix.bin driver-dist && explorer.exe driver-dist && explorer.exe "C:\Windows\System32\lxss\lib"
43+
44+
This will open two Explorer windows: one to a system path containing internal
45+
WSL driver files (``C:\Windows\System32\lxss\lib``), and another to a newly
46+
created ``driver-dist`` directory containing files that need to be copied to
47+
``C:\Windows\System32\lxss\lib``. Perform this copy manually using Explorer and
48+
overwrite existing files if present. It will warn you that this is dangerous,
49+
and you will need to give permission.
50+
51+
Close all WSL windows, and enter the following command in a ``cmd.exe`` or
52+
PowerShell session:
53+
54+
.. code-block:: pwsh-session
55+
56+
C:\Users\...> wsl --shutdown
57+
58+
Following this, OptiX should be usable within WSL.
59+
60+
.. warning::
61+
62+
Using CUDA and OptiX through WSL degrades performance. Please do not collect
63+
performance data within WSL, since the results will not be representative.

ext/nanobind

Submodule nanobind updated 76 files

0 commit comments

Comments
 (0)