Notes Docker Cuda nvidia

Voir https://www.tensorflow.org/install/docker

Voir aussi :

https://devblogs.nvidia.com/nvidia-docker-gpu-server-application-deployment-made-easy/

https://www.jbnet.fr/systeme/docker/docker-configurer-lutilisation-du-gpu-nvidia.html/comment-page-1

Installation nvidia-docker (old)

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

Test

docker run -it --rm --gpus all ubuntu nvidia-smi nvidia-docker run --rm hello-world

Install de CUDA Docker sous Debian avec les paquets .deb

Install nvidia drivers and cuda

Prereq

wget http://security.ubuntu.com/ubuntu/pool/main/s/screen-resolution-extra/screen-resolution-extra_0.17.1.1~16.04.1_all.deb wget http://fr.archive.ubuntu.com/ubuntu/pool/main/x/x-kit/python3-xkit_0.5.0ubuntu2_all.deb dpkg -i screen-resolution-extra_0.17.1.1~16.04.1_all.deb python3-xkit_0.5.0ubuntu2_all.deb apt-get install -f

Source : https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=deblocal

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 wget http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb sudo dpkg -i cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb sudo apt-key add /var/cuda-repo-10-2-local-10.2.89-440.33.01/7fa2af80.pub sudo apt-get update sudo apt-get -y install cuda
apt-get install build-essential binutils g++ mpich dkms libxmu-dev libxi-dev linux-headers-$(uname -r) linux-headers-amd64 wget http://us.download.nvidia.com/XFree86/Linux-x86_64/440.59/NVIDIA-Linux-x86_64-440.59.run

Install Docker

wget http://ftp.fr.debian.org/debian/pool/main/d/docker.io/docker.io_19.03.5+dfsg1-2_amd64.deb wget http://ftp.fr.debian.org/debian/pool/main/r/runc/runc_1.0.0~rc10+dfsg1-1_amd64.deb wget http://ftp.fr.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.4.1-2~bpo10+1_amd64.deb dpkg -i libseccomp2_2.4.1-2~bpo10+1_amd64.deb runc_1.0.0~rc10+dfsg1-1_amd64.deb docker.io_19.03.5+dfsg1-2_amd64.deb apt-get -f install apt-get install docker-compose mkdir /etc/systemd/system/docker.service.d/ cat <<EOF > /etc/systemd/system/docker.service.d/http-proxy.conf [Service] Environment="HTTP_PROXY=http://192.168.22.20:3128/" "HTTPS_PROXY=http://192.168.22.20:3128/" "NO_PROXY=localhost,127.0.0.0/8,192.168.0.0/16" EOF systemctl daemon-reload systemctl restart docker

Autres

ls -la /dev | grep nvidia cat /proc/driver/nvidia/version