Skip to content

Instantly share code, notes, and snippets.

@EvanZ
Forked from neocxi/gist:f0020ff895b29488940f
Created March 18, 2016 00:38
Show Gist options
  • Save EvanZ/f0e6f7655b37166b8cd9 to your computer and use it in GitHub Desktop.
Save EvanZ/f0e6f7655b37166b8cd9 to your computer and use it in GitHub Desktop.
Install cuda 7.0 & docker on ec2
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.0-28_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_7.0-28_amd64.deb
sudo apt-get update
# Note that we do upgrade and not dist-upgrade so that we don't install
# new kernels; this script will install the nvidia driver in the *currently
# running* kernel.
# sudo apt-get upgrade -y
sudo apt-get install -y git python-pip vim htop
sudo apt-get clean
# Nvidia's driver depends on the drm module, but that's not included in the default
# 'virtual' ubuntu that's on the cloud (as it usually has no graphics). It's
# available in the linux-image-extra-virtual package (and linux-image-generic supposedly),
# but just installing those directly will install the drm module for the NEWEST available
# kernel, not the one we're currently running. Hence, we need to specify the version
# manually. This command will probably need to be re-run every time you upgrade the
# kernel and reboot.
#sudo apt-get install -y linux-headers-virtual linux-source linux-image-extra-virtual
sudo apt-get install -y linux-image-extra-`uname -r` linux-headers-`uname -r` linux-image-`uname -r`
sudo apt-get install -y cuda-7.0
sudo apt-get clean
# install docker
curl -sSL https://get.docker.com/ | sh
# avoid the sudo boilerplate
sudo usermod -aG docker ubuntu
# note nvidia-smi is somehow broken on ec2, specifically when it tries to fetch temperature information. We hence disable it
# sudo mv `which nvidia-smi` `which nvidia-smi`.bak
/usr/local/cuda/bin/cuda-install-samples-7.0.sh .
cd ~/NVIDIA_CUDA-7.0_Samples/1_Utilities/deviceQuery
make
./deviceQuery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment