NVlabs / nvdiffrast

Nvdiffrast - Modular Primitives for High-Performance Differentiable Rendering
Other
1.31k stars 139 forks source link

WSL2 #86

Closed nick-klothed closed 2 years ago

nick-klothed commented 2 years ago

Hi and thanks for the awesome work !

After spending some time to make this work, I am right to assume that given WSL2's inability to support CUDA-OpenGL interop (https://docs.nvidia.com/cuda/wsl-user-guide/index.html), it is not possible to use this package in such a setting? Or am I missing something?

The current situation is that it works natively locally on a Win11 machine, it works natively on an Ubuntu machine, but does not work on a WSL2 Docker instance.

The following is WSL2's nvidia-smi output:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.57       Driver Version: 516.59       CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:01:00.0  On |                  N/A |
|  0%   45C    P8    23W / 170W |   2668MiB / 12288MiB |      3%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
s-laine commented 2 years ago

I haven't used WSL2, but if it doesn't support CUDA/OpenGL interop then that unfortunately prevents running nvdiffrast's rasterizer op.

Thank you for reporting this. I have been considering including a CUDA-only rasterizer as a fallback solution for environments with OpenGL compatibility problems, and it's good to know that WSL2 is yet another environment that would benefit from that.