【环境搭建】40系一些奇奇怪怪的环境问题

【设备信息】我的设备是4070ti,支持cuda12.0,但是目前用的还是11.7

1)fatal error: cusparse.h: No such file or directory

因为cuda版本和改名的原因,这个在cuda版本中比较有效的解决办法是:

sudo apt search libcusparse

得到结果如下(不同版本cuda得到的结果应该不相同):
在这里插入图片描述
进一步选择后缀中含有dev的进行下载

sudo apt-get install  libcusparse-dev-11-7

2)fatal error: cusolverDn.h: No such file or directory

参考网上的解决办法:[BUG] fatal error: cusolverDn.h: No such file or directory

sudo apt install nvidia-cuda-dev

能解决我的问题,但是可能会引入其他问题,详见参考

3)SystemError: initialization of _internal failed without raising an exception

numpy版本不兼容,重装numpy

pip install numpy==1.23.4

4) ImportError: libc10_cuda.so: cannot open shared object file: No such file or directory

出现这个问题的我猜想是因为版本上不兼容,我的方式是删除现在的pytorch重装:

conda install pytorch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0 pytorch-cuda=11.7 -c pytorch -c nvidia

5)用户名/pytorch3d/_C.cpython-39-x86_64-linux-gnu.so: undefined symbol:…

使用的是 conda install pytorch3d -c pytorch3d 进行安装可能是导致这个原因发生的主要问题!建议是直接使用pytorch3d源码进行编译

git clone https://github.com/facebookresearch/pytorch3d.git
cd pytorch3d && pip install -e .

【参考】https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md

6) invalid value for --gpu-architecture (-arch)

版本不兼容,参考【出错 invalid value for --gpu-architecture (-arch)】选用torch==1.13.0+cu17

猜你喜欢

转载自blog.csdn.net/weixin_50862344/article/details/131031100