天天看點

wsl安裝gpu版mindspore(一)

剛出爐的新機,wsl和windows的nvidia共享

wsl安裝gpu版mindspore(一)

win+shift+s截圖

wget https://gitee.com/mindspore/mindspore/raw/r1.8/scripts/install/ubuntu-gpu-pip.sh
PYTHON_VERSION=3.9 MINDSPORE_VERSION=1.8.1 bash -i ./ubuntu-gpu-pip.sh
           

這裡要選擇yes

wsl安裝gpu版mindspore(一)
wsl安裝gpu版mindspore(一)

難道是我移動網卡的問題?

把網卡拔了,用本地網。

wsl安裝gpu版mindspore(一)

ping通,那麼不是我的問題

wsl安裝gpu版mindspore(一)
echo 'deb https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64' > /etc/apt/sources.list.d/cuda.list
           

E: Malformed entry 1 in list file /etc/apt/sources.list.d/cuda.list (Suite)

E: The list of sources could not be read.

說明該方法不行

gpg --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
           
wsl安裝gpu版mindspore(一)

成功!

如果沒有nvidia-smi,這個邏輯可以在bash裡面實作?

sudo apt install nvidia-utils-390

出了錯,重來又在下載下傳了,建議建立一個如果已有檔案不再下載下傳的邏輯。

提個pr

安裝後半截驗證

[ERROR] ME(31402,7f3c64a52740,python):2022-09-12-17:05:24.234.635 [mindspore/ccsrc/runtime/hardware/device_context_manager.cc:93] WaitTaskFinishOnDevice] SyncStream failed, exception:The stream_id: 0 is greater than stream array size: 0

出錯了,那我們

sudo apt install nvidia-cuda-toolkit

排錯

WARNING: The scripts f2py, f2py3 and f2py3.9 are installed in ‘/home/kewei/.local/bin’ which is not on PATH.

Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

WARNING: The script cache_admin is installed in ‘/home/kewei/.local/bin’ which is not on PATH.

Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

然後,我突然發現一鍵運作的腳本是不支援wsl的,這下搞崩了,隻有重新下載下傳wsl,卸了重來。

解除安裝

wsl --list
Ubuntu替換成要解除安裝的核心
wsl --unregister Ubuntu