MARS(nerfstudio)安装——RTX4060, CUDA12.0&&11.8, Pytorch2.0.1,Windows11

一开始的环境是:CUDA12.0,创建了个pytorch-gpu虚拟环境(pip安装的gpu-torch2.0.1),后来发现在编译tiny_cuda_nn过程出现pytorch2.0.1(CUDA11.8)与检测到的已安装的CUDA12.0不匹配,于是安装了CUDA11.8(不需要卸载12.0,去下载CUDA11.8安装过程只选择CUDA选项即可,系统是可以存在多个CUDA的,只需显卡驱动支持所有CUDA或保持最新就行)参考链接:在windows上安装多个cuda版本 - 知乎

于是就有了两个版本:

查看环境变量应该是有如下两个版本的路径:

当11.8的两个环境变量在前面,系统nvcc -V查看时就是11.8:

同理,当12.0的两个环境变量在前面,系统nvcc -V查看时就是12.0(可以自行安装好之后去验证一下)


接下来介绍下安装过程遇到的问题:

conda create --name nerfstudio -y python=3.8
conda activate nerfstudio
python -m pip install --upgrade pip
pip install --upgrade pip setuptools

这一步都没问题。

主要问题在下面过程中:

This section will walk you through the installation process. Our system is dependent on the nerfstudio project.

1.Install tiny-cuda-nn firstly.

$ git clone --recursive https://github.com/nvlabs/tiny-cuda-nn
$ cd tiny-cuda-nn

Then, use CMake to build the project: (on Windows, this must be in a developer command prompt)这里我安装了VS2022(把C++组件选项安装),之后就会有了:

tiny-cuda-nn$ cmake . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
tiny-cuda-nn$ cmake --build build --config RelWithDebInfo -j

这两步过程中需要注意编译失败(失败原因应该能自己解决)后,把构建的build删了再编译,免得找不到方向。

接下来:也就是在这里遇到了CUDA的问题(不清楚为什么CUDA 12.0不兼容11.8的torch,目前pytorch稳定版最高的对应CUDA版本才11.8,所以就安装了另一个版本)注意:我的出现了The installed version of Nsight Visual Studio Edition is newer than the one to be installed. To reinstall, or change the Nsight configuration, first uninstall Nsight and then reinstall.这段话,其实没有必要管它,已经完成了安装。然后就开始install了:

tiny-cuda-nn$ cd bindings/torch
tiny-cuda-nn/bindings/torch$ python setup.py install

上图成功安装好~

最后可以自行测试

tiny-cuda-nn$ ./build/mlp_learning_an_image data/images/albert.jpg data/config_hash.json

2.Install MARS locally with:

git clone git@github.com:OPEN-AIR-SUN/mars.git  #下载不了直接下压缩包
cd mars/nerfstudio
pip install -e .[dev]         # install nerfstudio and its dependencies
可以在后面加上源  -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
cd ..
pip install -e .
ns-install-cli                # optional, only for tab completion

这个过程主要遇到了在pip install -e .[dev]时出现下面错误:

然后我的解决方法是更新pip和setuptools然后再安装时加上源:

python -m pip install --upgrade pip
pip install --upgrade pip setuptools
pip install -e .[dev] -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com

 即可~

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值