首先要把这个repo clone过来
git clone https://github.com/NVlabs/tiny-cuda-nn.git --recursive
一定别忘这个recursive
然后安装https://github.com/NVlabs/tiny-cuda-nn/时cmake说cuda版本不对。
– Obtained CUDA architectures automatically from installed GPUs
CMake Warning at CMakeLists.txt:161 (message):
CUDA version 10.1 is too low for detected architecture 86. Targeting the
CUDA version 10.1 is too low for detected architecture 86. Targeting the
CUDA version 10.1 is too low for detected architecture 86. Targeting the
highest supported architecture 75 instead.
– Targeting CUDA architectures: 75
CMake Error at CMakeLists.txt:202 (message):
CUDA version too low. tiny-cuda-nn require CUDA 10.2 or higher.
– Configuring incomplete, errors occurred!
See also “/home/yyang/research/avatar/tiny-cuda-nn/build/CMakeFiles/CMakeOutput.log”.
这时候设置cuda path什么的其实没有用。
用这个命令直接指定到你要用的cuda,就解决了。如果你之前已经build失败过。需要先rm -rf build删除掉你编译过的东西。
cmake -DCMAKE_CUDA_COMPILER=/usr/local/cuda-11.6/bin/nvcc . -B build
之后就
cmake --build build --config RelWithDebInfo -j
cd bindings/torch
python setup.py install
这就好了。一开始我没有编译,直接到torch里面搞。要我用pypa去装,这个是misleading的。一定是先把前面的cmake做完了,再弄后面的,这样就不会报错了。