- Ubuntu 20.04
- CUDA 10.2
- Docker Latest
- 1-install-first.sh
- 2-install-cuda.sh -> Reboot
- 3-install-docker.sh -> Reboot
- 4-install-nvidia.sh
#!/bin/sh | |
sudo apt update && sudo apt -y upgrade | |
sudo apt install -y build-essential |
#!/bin/sh | |
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 update | |
sudo apt -y install cuda-drivers | |
sudo systemctl set-default multi-user.target | |
sudo reboot |
#!/bin/sh | |
sudo apt -y 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 add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
sudo apt update | |
sudo apt -y install docker-ce docker-ce-cli containerd.io | |
sudo usermod -aG docker $USER | |
sudo reboot |
#!/bin/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 | |
sudo apt update && sudo apt -y install nvidia-container-toolkit | |
sudo systemctl restart docker | |
docker run --gpus all --pid host nvidia/cuda:10.2-runtime nvidia-smi |
@eyalhir74 if you ran all the .sh files verbatim you most likely wouldn't complete the update correctly. From my experience alot of getting it to work properly is knowing what nvidia drivers (and thusly cuda version) you are running. Check that by simply running $ nvidia-smi and checking the first line of the output.
I believe that as of driver version 430+ cuda is built in, so step 2 above is not required. (That also assumes you have the appropriate nvidia drivers installed prior to tackling the docker install)
Go figure, I found this article from IBM (of all places) very straight forward: Installing nvidia-docker2 - follow x86 Ubuntu instructions
Then subbing in the cuda version (to do the verification) that matches your output from before (with the assist from: Supported CUDA tags)
@eyalhir74 I followed these steps that redirected me here.
I suggest you to reboot between the steps and verify your installations. If it does not work, just find another guide by googling "nvidia docker ubuntu 20.04" :)
I'm on Ubuntu 22.04
I believe that as of driver version 430+ cuda is built in, so step 2 above is not required
Because of this comment, I started at step 3 and it worked out
Why is this so complicated?
In step 4, altough I have ubuntu 20.04, the .list file contains references to ubuntu 18. Later on the apt update fails..
Any idea why?