Skip to content

Instantly share code, notes, and snippets.

@satomacoto satomacoto/
Last active Apr 20, 2018

What would you like to do?
curl -fsSL | bash
curl -fsSL | bash
# nvcc
## 2.6 Pre-installation Actions (Download the NVIDIA CUDA Toolkit)
## 3.6 Package Manager Installation (Ubuntu)
sudo dpkg -i cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
sudo apt-key adv --fetch-keys
sudo apt-get update
sudo apt-get install -y cuda
## 7.1.1 Post-installation Actions (Environment Setup)
echo 'export PATH=/usr/local/cuda-9.1/bin${PATH:+:${PATH}}' >> ~/.bashrc
source ~/.bashrc
# Docker
# Uninstall the old version
sudo apt-get remove docker docker-engine
# Set up the repository
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
curl -fsSL | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] \
$(lsb_release -cs) \
# Install docker CE
sudo apt-get update
sudo apt-get -y install docker-ce
sudo usermod -a -G docker ubuntu
# nvidia-docker
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo apt-get purge -y nvidia-docker
# Add the package repositories
curl -s -L | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
# Install nvidia-docker2 and reload the Docker daemon configuration
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd
# Test nvidia-smi with the latest official CUDA image
# docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
# docker-compose
sudo curl -L$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.