1. 背景提要
在复现其他人的论文,需要配置torch-geometric环境。在实验室其中一个集群上配置cu102对应的torch-geometric各个包的版本完全没问题,但是在另外一个集群上(都是3090显卡)按之前的方式配置会报错:比如
a. OSError:libcusparse.so.10.0:cannot open shared object file:No such file or directory
b. NCCL WARN Cuda failure ‘invalid device function‘ , unhandled cuda error, NCCL version 2.4.8
c. no kernel image is available for execution on the device
2. 解决办法
3090不支持cu102!!最后选择了cu111
在anaconda虚拟环境中输入以下命令:
pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
pip3 install torch-scatter==2.0.6 -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip3 install torch-sparse==0.6.9 -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip3 install torch-cluster==1.5.9 -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip3 install torch-spline-conv==1.2.1 -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip3 install torch-geometric==1.6.3
3. 其他
a. 在想要安装cuda11.1版本的时候,按照网上的教程下载cuda的run文件,然后运行,但是由于没有root权限,失败TAT,后来发现第二点的第一条命令就可以实现下载cu111,具体为何需要之后再研究一下,待补充。
b. 在两个集群中测试相同的模型,发现精确度差了很多,后来发现是torch_geometric版本的问题,统一两个集群的torch_geometric版本之后就好了,当然cuda版本肯定也有影响,但是影响不是很大。