NVlabs / tiny-cuda-nn

Lightning fast C++/CUDA neural network framework
Other
3.7k stars 450 forks source link

Error while installing from a local clone of tiny-cuda-nn #447

Closed silky1708 closed 3 months ago

silky1708 commented 3 months ago

While installing tiny-cuda-nn using a local clone (Ubuntu 22.04) as follows:

git clone https://github.com/NVlabs/tiny-cuda-nn.git
cd bindings/torch
python setup.py install

I got the following error:

cc1plus: fatal error: ../../dependencies/fmt/src/format.cc: No such file or directory
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1

PyTorch v2.3.0 (as recommended) torchvision v0.18.0 cuda 11.8 (I got the following warning while installing: UserWarning: The detected CUDA version (11.5) has a minor version mismatch with the version that was used to compile PyTorch (11.8). Most likely this shouldn't be a problem.) g++, gcc version 11.4.0 path to cuda set:

export PATH="/usr/lib/cuda/bin:$PATH"
export LD_LIBRARY_PATH="/usr/lib/cuda/lib64:$LD_LIBRARY_PATH"
silky1708 commented 3 months ago

Inside tiny-cuda-nn/dependencies/, delete and clone the following repositories from scratch:

rm -r cutlass
rm -r fmt
git clone https://github.com/NVIDIA/cutlass.git
git clone https://github.com/fmtlib/fmt.git

This solved the issue for me.

silky1708 commented 3 months ago

More issues come up later:

/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
  435 |         function(_Functor&& __f)
      |                                                                                                                                                 ^ 
/usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
  530 |         operator=(_Functor&& __f)
      |                                                                                                                                                  ^ 
/usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
error: command '/usr/bin/nvcc' failed with exit code 1

To solve this, I followed this comment and finally installed tinycudann successfully!