服务器环境:Ubuntu18 + cuda11.3

  1. 安装conda
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_4.8.3-Linux-x86_64.sh --no-check-certificate
bash Miniconda3-py38_4.8.3-Linux-x86_64.sh
  1. 新建环境
conda create --name nerfstudio -y python=3.8
conda activate nerfstudio
python -m pip install --upgrade pip
  1. 安装pytorch
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 -f https://download.pytorch.org/whl/torch_stable.html
  1. 在mac上下载[tinycudann v1.6](tinycudann v1.6) 并上传服务器(此时dependencies中的cutlassfmt是空的)
    a. 从gitee上找相应的两个库并clone到目录中
    b. mac本地跑git clone --recursive https://github.com/nvlabs/tiny-cuda-nn然后把两个文件夹中的内容复制到v1.6版本相应位置
  2. 编译(其中第三行要等挺长时间的)
cd tiny-cuda-nn
cmake . -B build
cmake --build build --config RelWithDebInfo -j
  1. 链接pytorch
cd bindings/torch
python setup.py install

其中就这里的最后一步install容易报很多错误,可以参考【坑】
8. 检查是否安装成功

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 -> #include <experimental/filesystem>
○ https://github.com/nlohmann/json/issues/3090

References
https://docs.nerf.studio/en/latest/quickstart/installation.html
https://aitechtogether.com/python/107699.html
https://zhuanlan.zhihu.com/p/588741279

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐