[Notes] Ubuntu安装nvidia-docker2
ubuntu版本为16.04.1 LTS (Xenial Xerus)。
本系统已安装nvidia驱动,但是未安装docker。
参考官方文档进行安装:https://docs.docker.com/install/linux/docker-ce/ubuntu/
然后在参考nvidia-docker github页进行安装:https://github.com/NVIDIA/nvidia-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 - echo "chekc the fingureprint!" 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 # install nvidia-docker2 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 sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit sudo systemctl restart docker
如果安装的docker版本比较新,那么nvidia-docke2可能就自带了,上面脚本的下半截可能就没啥用(从distribution开始)。
下面验证安装 成功,参考:https://github.com/NVIDIA/nvidia-docker
例如本机有两块显卡,运行下述验证:
docker run --gpus 2 nvidia/cuda:9.0-base nvidia-smi
相关推荐
lxyd000 2020-10-30
changecan 2020-11-19
changecan 2020-09-22
王道革 2020-11-25
bwyyziq 2020-11-22
pigsmall 2020-11-19
helloWorldAndYou 2020-11-16
nginxs 2020-11-14
红石丶 2020-11-13
WanKaShing 2020-11-12
yangkang 2020-11-12
滴水穿石点石成金 2020-11-12
张荣珍 2020-11-12
wuxunanjing 2020-11-11
魅惑青花瓷 2020-11-11
lihongtai 2020-11-09
yangkang 2020-11-09
worldsnow 2020-11-06