-
-
Save bexcite/7f55dae6cbe40fc93adb51b8f124f231 to your computer and use it in GitHub Desktop.
Installing TensorFlow on EC2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 | |
| # 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 | |
| # Not sure why this is needed | |
| sudo apt-get install linux-image-extra-virtual | |
| sudo reboot # especially this?? | |
| # 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