windows WSL2 ubuntu 安装 deepo 深度学习环境
第二步 docker以及deepo
1. windows部分
NVIDIA Drivers for CUDA on WSL, including DirectML Support
安装windows 部分的驱动
2. ubuntu部分-docker
若出错请逐行复制
- nvidian docker
sudo apt-get update
curl <https://get.docker.com> | sh
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L <https://nvidia.github.io/nvidia-docker/gpgkey> | sudo apt-key add -
curl -s -L <https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list> | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
curl -s -L <https://nvidia.github.io/libnvidia-container/experimental/$distribution/libnvidia-container-experimental.list> | sudo tee /etc/apt/sources.list.d/libnvidia-container-experimental.list
sudo apt-get install -y nvidia-docker2
- docker
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install \\
apt-transport-https \\
ca-certificates \\
curl \\
gnupg-agent \\
software-properties-common
curl -fsSL <https://download.docker.com/linux/ubuntu/gpg> | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \\
"deb [arch=amd64] <https://download.docker.com/linux/ubuntu> \\
$(lsb_release -cs) \\
stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo docker run hello-world
- 启动docker
serviece docker start
若报错:docker: unrecognized service
查看 /var/lib/ 目录下是否有 docker 目录,我的是有 docker-desktop,有些是 docker,自己看。 执行命令:sudo rm -rf /var/lib/docker-desktop/
3. ubuntu 部分 cuda toolkits
官网下载对应支持的cuda tookits,离线下载后再安装比较快
例如: ubuntu 20.04
wget <https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin>
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget <https://developer.download.nvidia.com/compute/cuda/11.2.0/local_installers/cuda-repo-ubuntu2004-11-2-local_11.2.0-460.27.04-1_amd64.deb>
sudo dpkg -i cuda-repo-ubuntu2004-11-2-local_11.2.0-460.27.04-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu2004-11-2-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
大文件在浏览器中下载 (命令第三行的网址取出)
进入下载目录,运行安装命令
cd /mnt/c/User/用户名/Downloads
sudo dpkg -i cuda-repo-ubuntu2004-11-2-local_11.2.0-460.27.04-1_amd64.deb
4 deepo 镜像
方法1 在线拉取: 选一个好网(长城宽带,部分校园网不行,可以用热点)
docker pull ufoym/deepo
或者
docker pull [registry.docker-cn.com/ufoym/deepo](<http://registry.docker-cn.com/ufoym/deepo>)
方法2: 离线版本:网盘分享
链接:https://pan.baidu.com/s/1g4alJbefNBcPaIb0lPyAIw 提取码:1111 复制这段内容后打开百度网盘手机App,操作更方便哦--来自百度网盘超级会员V6的分享
cd /mnt c
(例如保存至在c的根目录下)
进入目录后docker load < deepo.tar
等待一段时间即可
5 运行
service docker start
docker run --gpus all -it -p 8888:8888 ufoym/deepo bash
jupyter notebook --allow-root --ip 0.0.0.0
在Windows浏览器中输入 localhost:8888/?xxxxxxxxxxxx (xxxx为命令窗口中的token)