Skip to content

Instantly share code, notes, and snippets.

@olegakbarov
Forked from erikbern/install-tensorflow.sh
Created December 10, 2016 20:29
Show Gist options
  • Select an option

  • Save olegakbarov/4ff97c06065a913db8c5aa6d18af3ef1 to your computer and use it in GitHub Desktop.

Select an option

Save olegakbarov/4ff97c06065a913db8c5aa6d18af3ef1 to your computer and use it in GitHub Desktop.
Installing TensorFlow on EC2
# Install various packages
sudo apt-get update
sudo apt-get upgrade -y # choose “install package maintainers version”
sudo apt-get install -y build-essential python-pip python-dev git
# Not sure why this is needed
sudo apt-get install linux-image-extra-virtual
sudo reboot # especially this??
# Blacklist Noveau which has some kind of conflict with the nvidia driver
echo -e "blacklist nouveau\nblacklist lbm-nouveau\noptions nouveau modeset=0\nalias nouveau off\nalias lbm-nouveau off\n" | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
# Reboot (annoying you have to do this in 2015!)
sudo update-initramfs -u
sudo reboot
# Install latest Linux headers
sudo apt-get install linux-source linux-headers-`uname -r`
# Install CUDA 7.0
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.0-28_amd64.deb
chmod +x cuda_7.0.28_linux.run
./cuda_7.0.28_linux.run -extract=`pwd`/nvidia_installers
cd nvidia_installers
sudo ./NVIDIA-Linux-x86_64-346.46.run
sudo modprobe nvidia
sudo ./cuda-linux64-rel-7.5.18-19867135.run
cd
# Install tensorflow
sudo pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
# Clone source as well (for examples)
git clone https://github.com/tensorflow/tensorflow
cd tensorflow/tensorflow/model/image/mnist
python convolutional.py
# I tensorflow/core/common_runtime/gpu/gpu_device.cc:611] Ignoring gpu device (device: 0, name: GRID K520, pci bus id: 0000:00:03.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment