安装curl:
sudo apt-get update sudo apt install curl
安装nvidia-docker:
可能要删除之前的
sudo yum remove docker docker-common container-selinux docker-selinux docker-engine nvidia-docker
https://github.com/NVIDIA/nvidia-docker
$ https://github.com/NVIDIA/nvidia-docker $ 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 run --gpus all -it -v /home/haiou/work/bert:/home/work tensorflow/tensorflow:1.13.1-gpu-py3
才能使用gpu(不同版本docker不一样)