System Requirements
Ubuntu Linux 16.04 or 18.04
NVIDIA Graphics Card / Modern CPU
sudo add-apt-repository -y ppa:graphics-drivers/ppasudo apt-get updatesudo apt-get -y install $(ubuntu-drivers list | sort | uniq | tail -n1)
The command ubuntu-drivers will return the latest drivers once you have updated the repository
Reboot your system now!
We must first install Docker to the target system
sudo apt-get -y remove docker docker-engine docker.io containerd runcsudo apt-get -y install \apt-transport-https \ca-certificates \curl \gnupg-agent \software-properties-commoncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -sudo add-apt-repository -y \"deb [arch=amd64] https://download.docker.com/linux/ubuntu \$(lsb_release -cs) \stable"sudo apt-get updatesudo apt-get install -y docker-ce docker-ce-cli containerd.io
Used to help orchestrate multiple docker containers in the future
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-composesudo chmod +x /usr/local/bin/docker-compose
Post Installation Steps
Most likely required for your system if you are not "root" / home users
sudo groupadd dockersudo usermod -aG docker $USERsudo chown "$USER":"$USER" /home/"$USER"/.docker -Rsudo chmod g+rwx "$HOME/.docker" -R
You have now installed Docker on your system! Now we can install nvidia-docker
Once you're strong enough, save the world:
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containersdocker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -fsudo apt-get purge -y nvidia-docker# Add the package repositoriescurl -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.listsudo apt-get update# Install nvidia-docker2 and reload the Docker daemon configurationsudo apt-get install -y nvidia-docker2sudo pkill -SIGHUP dockerd
Reboot your system now!
sudo add-apt-repository -y ppa:graphics-drivers/ppasudo apt-get updatesudo apt-get -y install $(ubuntu-drivers list | sort | uniq | tail -n1)#Reboot Recommended Heresudo apt-get -y remove docker docker-engine docker.io containerd runcsudo apt-get -y install \apt-transport-https \ca-certificates \curl \gnupg-agent \software-properties-commoncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -sudo add-apt-repository -y \"deb [arch=amd64] https://download.docker.com/linux/ubuntu \$(lsb_release -cs) \stable"sudo apt-get updatesudo apt-get install -y docker-ce docker-ce-cli containerd.iosudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-composesudo chmod +x /usr/local/bin/docker-composesudo groupadd dockersudo usermod -aG docker $USERsudo chown "$USER":"$USER" /home/"$USER"/.docker -Rsudo chmod g+rwx "$HOME/.docker" -R#Reboot Recommended Here# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containersdocker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -fsudo apt-get purge -y nvidia-docker# Add the package repositoriescurl -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.listsudo apt-get update# Install nvidia-docker2 and reload the Docker daemon configurationsudo apt-get install -y nvidia-docker2sudo pkill -SIGHUP dockerd#Reboot Recommended Here