Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ignaciotcrespo/a2652f3945d16625e0f61b67458752d9 to your computer and use it in GitHub Desktop.
Save ignaciotcrespo/a2652f3945d16625e0f61b67458752d9 to your computer and use it in GitHub Desktop.
Install CUDA, Docker, and Nvidia Docker on a new Paperspace GPU machine
#!/bin/bash
# 1. Install CUDA
echo "Installing CUDA..."
# Only install if CUDA is not already installed.
if ! dpkg-query -W cuda; then
# The 16.04 installer works with 16.10.
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
dpkg -i ./cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
apt-get update
apt-get install cuda -y
fi
# 2. Install Docker-CE
echo "Installing Docker-CE..."
# install packages to allow apt to use a repository over HTTPS:
apt-get -y install \
apt-transport-https ca-certificates curl software-properties-common
# add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
# set up the Docker stable repository.
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# update the apt package index:
apt-get -y update
# finally, install docker
apt-get -y install docker-ce
# 3. Install Nvidia-docker
echo "Installing Nvidia-docker..."
wget https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1-1_amd64.deb
dpkg -i nvidia-docker*.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment