配置不出来GPU版本,感觉DGL低版本和pytorch,cuda之间充满了矛盾,因此只能使用CPU跑,环境如下图:
以下是对GPU版本配置的尝试:
1. 环境最好使用python=3.7,因为会使用到dgl-cuda=0.4.3只能适配py3.5-3.8,且GTX3090需要使用cuda11.0以上的版本,torch只能支持py3.7以上的版本
代码要求使用dgl0.5.3以下的版本,不然会有报错,但是这些版本都不支持cuda11.0,就很无语,最后要么dgl构图时报错,要么cuda版本不匹配
2. dgl-cuda安装
上述网站找到dgl-cuda10.0-0.4.3post2-py36_0.tar.bz2
tar -xjvf dgl-cuda11.6-0.9.0-py36_0.tar.bz2
或使用
conda install -c dglteam dgl-cuda10.2==0.4.3post2
安装pytorch
conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=11.0 -c pytorch
python版本与torch版本对应表