nvidia-docker安装

(1)确保NVIDIA Drivers和Docker已经安装好

$nvcc --version

$docker

(2)安装nvidia-docker

(2.1)设置stable存储库和密钥

$ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -

$ distribution=$(. /etc/os-release;echo $ID$VERSION_ID)

$ 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

(2.2)安装nvidia-docker安装包

sudo apt-get install -y nvidia-docker2

(2.3)重启docker

$ sudo systemctl restart docker

(2.4)验证

$ sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi




 

posted @ 2022-05-12 13:38  bluedream1000  阅读(635)  评论(0编辑  收藏  举报