首先要把这个repo clone过来
git clone https://github.com/NVlabs/tiny-cuda-nn.git --recursive
一定别忘这个recursive
如果你之前已经build失败过。需要先
rm -rf build
删除掉你编译过的东西。
编译(其中第三行要等挺长时间的)
cd tiny-cuda-nn
cmake . -B build
cmake --build build --config RelWithDebInfo -j
链接pytorch
cd bindings/torch
python setup.py install
检查是否安装成功
python
import tinycudann
坑
- python版本一定要大于3.8,尽量用conda装(自己试过本地安装python3.8.0, python3.9.14, python3.10都遇到了很多麻烦)
- torch版本要匹配tinycudann版本
- cuda11.3可能安不了高版本tinycudann
- cuda11.7 cuda11.8及更高pytorch可以安官方推荐的torch2.0.1
- 直接跑官方
pip install ninja git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
可能不太行,后续会有问题 - 直接clone github上的tinucudann可能会由于网络问题下不下来(因为要递归装cutlass,这个库有90多M)
- 【报错:filesystem: No such file or directory】
- 解决:将
json.hpp
#include <filesystem> -> #include <experimental/filesystem> - https://github.com/nlohmann/jso
- 解决:将