DCN环境配置遇到问题(2080ti以及3080ti)

             2080ti的CUDA版本为10.1,3080ti的版本为11.3
             需要注意的是30系列显卡适配CUDA版本11以上,
             老环境需要进行相应调整。

1. 3080ti编译时ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

查看CUDA版本显示
cat /usr/local/cuda/version.txt
11.3
用pytorch打印版本
print(torch.version.cuda)
10.2

意味着安装的pytorch包不是通过CUDA11.3编译的,而是使用10.2版本编译的,解决方案:

pip install torch+cu113

2. 通过上述方式没有解决问题,有可能是CUDA环境变量设置有误,可以在终端中更改或者vi ~/.bashrc。

通过终端更改

export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
    
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

export CUDA_HOME=/usr/local/cuda

通过bashrc更改,最后加上

source ~./bashrc

3. 编译DCNv2时RuntimeError: Jacobian mismatch for output 0 with respect to input 0
这是因为torch的gradcheck需要double,而输入的都是float类型。这一项并不影响DCNv2的编译,可以忽略。

4. 安装Cupy时报错
安装Cupy不能直接使用pip install cupy安装,进度条会一直卡住。网上很多教程说的是根据CUDA版本用命令

pip3.8 install cupy-cuda102

我的电脑配置时会产生如下错误

ImportError: CuPy is not correctly installed.
If you are using wheel distribution (cupy-cudaXX), make sure that the version of CuPy you installed matches with the version of CUDA on your host.
Also, confirm that only one CuPy package is installed:
  $ pip freeze
If you are building CuPy from source, please check your environment, uninstall CuPy and reinstall it with:
  $ pip install cupy --no-cache-dir -vvvv
  Check the Installation Guide for details:
  https://docs-cupy.chainer.org/en/latest/install.html

这个问题困扰我很长时间,直到找到非常简单的解决思路:

conda install cupy

这样conda就会自动补齐环境中缺少的部分,cupy就使用成功了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

生成滞涨网络~

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值