安装方法1
pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
用上述语句安装,报错:
Failed to build tinycudann; Could not build wheels for tinycudann; Could not find filesystem; xxx.so.xx no such file or directory
Failed to build tinycudann; Could not build wheels for tinycudann; Could not find filesystem; xxx.so.xx no such file or directory
安装方法2
$ git clone --recursive https://github.com/nvlabs/tiny-cuda-nn
$ cd tiny-cuda-nn
tiny-cuda-nn$ cmake . -B build
tiny-cuda-nn$ cmake --build build --config RelWithDebInfo -j
这里没安装cmake记得装一下
tiny-cuda-nn$ cd bindings/torch
tiny-cuda-nn/bindings/torch$ python setup.py install
最后这句install的时候报错:
Can't install "tiny cuda nn" - host_config.h(231): fatal error C1083: Cannot open include file: 'crtdefs.h': No such file or directory
错误原因:
安装过程中检测不到visual studio中的配置.h文件
解决方法:
在虚拟环境nerfstudio下运行C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat文件
#此处路径根据自己的文件路径做调整
start C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat
之后弹出新的cmd
#方法一
pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
#方法二
# 到tinycudann所在的位置重新执行install
tiny-cuda-nn/bindings/torch$ python setup.py install
测试:
python
import tinycudann
不报错,则安装成功!
参考
https://github.com/NVlabs/tiny-cuda-nn/issues/280
https://github.com/NVlabs/tiny-cuda-nn