wsl安装gpu版mindspore(二)
没办法,网上的一键安装不适用于wsl
我们自己来
参考
https://blog.csdn.net/qq_20291997/article/details/106897324
wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run
sudo apt install build-essential
sudo sh cuda_11.1.1_455.32.00_linux.run
- 1
- 2
- 3
安装cuda
安装cuda时千万记住不要安装驱动,不要安装驱动,不要安装驱动!!!!其余选项该怎么装怎么装,就是不要装驱动!!!!Driver相关一定要N或者X掉!!!!!!
但是貌似这个版本就没有Driver选项
安装后一定有提示,Driver: Not Selected。
echo -e "export PATH=/usr/local/cuda-11.1/bin:\$PATH" >> ~/.bashrc
echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc
source ~/.bashrc
- 1
- 2
- 3
在这里找配套cudnn的版本
https://developer.download.nvidia.com/compute/cudnn/secure/8.5.0/local_installers/11.7/cudnn-linux-x86_64-8.5.0.96_cuda11-archive.tar.xz
下载了这个tar文件后,我们
xz -d cudnn-linux-x86_64-8.5.0.96_cuda11-archive.tar.xz
tar -xvf cudnn-linux-x86_64-8.5.0.96_cuda11-archive.tar
sudo cp cuda/include/cudnn.h /usr/local/cuda-11.1/include
sudo cp cuda/lib/libcudnn* /usr/local/cuda-11.1/lib64
sudo chmod a+r /usr/local/cuda-11.1/include/cudnn.h /usr/local/cuda-11.1/lib64/libcudnn*
访问 https://docs.conda.io/en/latest/miniconda.html
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
sudo bash Miniconda3-latest-Linux-x86_64.sh
/usr/local/miniconda3
/usr/local/miniconda3/bin/conda init bash
- 1
- 2
- 3
- 4
conda安装完成
#conda create -n mindspore_py37 python=3.7.5 -y
#conda activate mindspore_py37
可以就安装在base环境
- 1
- 2
- 3
python自动是3.9.12
安装mpi,便于远程
curl -O https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.gz
tar xzf openmpi-4.0.3.tar.gz
cd openmpi-4.0.3
./configure --prefix=/usr/local/openmpi-4.0.3
make
sudo make install
echo -e "export PATH=/usr/local/openmpi-4.0.3/bin:\$PATH" >> ~/.bashrc
echo -e "export LD_LIBRARY_PATH=/usr/local/openmpi-4.0.3/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc
source ~/.bashrc
cd -
echo 'export PATH=/home/kewei/.local/bin:$PATH' >> ~/.bashrc
python -c "import mindspore;mindspore.run_check()"
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
第一次执行验证语句需要几分钟,请耐心等待。
成功!
文章来源: blog.csdn.net,作者:irrationality,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/weixin_54227557/article/details/126820808
- 点赞
- 收藏
- 关注作者
评论(0)