Skip to content

Instantly share code, notes, and snippets.

@perryism
Last active September 26, 2017 23:33
Show Gist options
  • Save perryism/87e382cbc9d6ef0e73ba247bd99a1f0c to your computer and use it in GitHub Desktop.
Save perryism/87e382cbc9d6ef0e73ba247bd99a1f0c to your computer and use it in GitHub Desktop.
Use TensorFlow with GPU support
# https://www.tensorflow.org/install/install_linux
# https://developer.nvidia.com/cuda-downloads
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb -qO cuda.deb
sudo dpkg -i cuda.deb
sudo apt-get update
sudo apt-get install -y python-pip python-dev build-essential libcupti-dev cuda
sudo pip install -U pip
sudo echo export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64" >> ~/.profile
sudo echo export CUDA_HOME=/usr/local/cuda >> ~/.profile
source ~/.profile
# download the cudnn driver from nvida website
# https://developer.nvidia.com/rdp/cudnn-download
sudo cp -r cuda/include/* $CUDA_HOME/include/
sudo cp -r cuda/lib64/* $CUDA_HOME/lib64/
sudo pip install tensorflow-gpu
#
python -c "import tensorflow"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment