NVIDIAGameWorks / kaolin-wisp

NVIDIA Kaolin Wisp is a PyTorch library powered by NVIDIA Kaolin Core to work with neural fields (including NeRFs, NGLOD, instant-ngp and VQAD).
Other
1.45k stars 133 forks source link

Problems setting up wisp (with GUI) on Windows #89

Closed samuele-bortolato closed 1 year ago

samuele-bortolato commented 1 year ago

First, thank you for the work!

I'm having some troubles setting up the library in windows 10 with the interactive GUI working.

First I just tried to install the library using the latest version of each requirement without paying too much attention at the specific version. I tried CUDA 12.0 (with Visual Studio 2022) and pytorch 1.13.1cu116, and I was able to install the wisp library but when I tried to install pycuda to use the interactive mode the problems started: apparently the git version doesn't support windows (it doesn't load the CUDA path correctly) so I installed it using pipwin install pycuda, which made the installation work but when I tried to launch some examples I got RuntimeError: make_default_context() wasn't able to create a context on any of the 1 detected devices same as #60, for which there is still no solution in windows (the proposed solution doesn't work)

I speculated that the problem was with the version of the libraries I installed, and I noriced that kaolin requires torch >= 1.8, <= 1.12.1, and I immagined that it was better to match the cuda version used by torch and pycuda with the one installed manually in the system, so I installed: CUDA 11.6 (with Visual Studio 2019, that doesn't support 2022) pytorch 1.12.1cu116 pycuda-2022.1+cuda116 (installed through pipwin) but now trying to install the wisp package through the setup.py fails with

C:\Users\Sam\miniconda3\lib\site-packages\torch\include\pybind11\cast.h(1429): error: too few arguments for template template parameter "Tuple"
          detected during instantiation of class "pybind11::detail::tuple_caster<Tuple, Ts...> [with Tuple=std::pair, Ts=<T1, T2>]"
(1507): here

C:\Users\Sam\miniconda3\lib\site-packages\torch\include\pybind11\cast.h(1503): error: too few arguments for template template parameter "Tuple"
          detected during instantiation of class "pybind11::detail::tuple_caster<Tuple, Ts...> [with Tuple=std::pair, Ts=<T1, T2>]"
(1507): here

C:\Users\Sam\miniconda3\envs\wisp\kaolin-wisp\wisp\csrc\external\mesh2sdf_kernel.cu(592): warning #177-D: variable "split_factor" was declared but never referenced

2 errors detected in the compilation of "wisp/csrc/external/mesh2sdf_kernel.cu".
error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.6\\bin\\nvcc.exe' failed with exit code 1

I was wondering if anybody managed to make the library work properly with the GUI on Windows 10, and if so if they could provide the versions of the libraries installed and the commit from which to pull the code. Thanks in advance for any help.

other system informations: OS Name Microsoft Windows 10 Home Version 10.0.19045 Build 19045 gpu 3050Ti (Laptop) NVIDIA-SMI 511.23 Driver Version: 511.23 CUDA Version: 11.6 nvcc Build cuda_11.6.r11.6/compiler.30794723_0

orperel commented 1 year ago

Hi @samuele-bortolato ! The official pycuda wheels unfortunately don't include the GL extension, which is why the instructions say you have to build pycuda manually with the GL flag :( We're aware that this makes the installation more cumbersome, and we're actively in the process of making wisp pip installable.

Until that happens: my guess is the CUDA versions you tried were not supported by all packages. My setup usually uses torch==1.12.1+cu113, so I'd recommend you re-install your env on cu113 (and don't forget to build pycuda manually!)

orperel commented 1 year ago

@samuele-bortolato We've updated the installation instructions, so you no longer have to build pycuda and kaolin manually

samuele-bortolato commented 1 year ago

Thank so much, it works now! and it's way easier to install too!

In case there is somebody else trying to install it on Windows, at the moment pipwin stopped working because the site where there are the binaries has the ssh certificate expired (since 9th January), either bypass the ssh check with 'SmartDL(url, dest, verify=False)' in pipwin.py or compile the library manually