Skip to content

Instantly share code, notes, and snippets.

@neocxi
Last active April 15, 2016 12:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save neocxi/f0020ff895b29488940f to your computer and use it in GitHub Desktop.
Save neocxi/f0020ff895b29488940f 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
@SpudInNZ
Copy link

This worked perfectly. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment