Last active
March 4, 2018 00:06
-
-
Save davidnvq/9564b42d3d51f756e72dc804a33934fa to your computer and use it in GitHub Desktop.
Tensorflow GPU Installation
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
# For more information, visit at | |
# https://www.tensorflow.org/install/install_linux | |
#1. NVIDIA requirements | |
#1.0 Install CUDA Toolkit | |
http://docs.nvidia.com/cuda/cuda-installation-guide-linux/#axzz4VZnqTJ2A | |
# Check which version | |
cat /usr/local/cuda/version.txt | |
#1.1 Create the CUDA_HOME environment variable at .bash_profile | |
export CUDA_HOME=/usr/local/cuda-8.0 | |
export PATH=$CUDA_HOME:$PATH | |
#1.2 Install libcupti-dev library, | |
# which is the NVIDIA CUDA Profile Tools Interface. | |
# if CUDA Toolkit >= 8.0 | |
sudo apt-get install cuda-command-line-tools | |
# if CUDA Toolkit <= 7.5 | |
sudo apt-get install libcupti-dev | |
# Add its path to LD_LIBRARY_PATH | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/extras/CUPTI/lib64 | |
#2. Install Tensorflow via Anaconda | |
# Tensorflow GPU with Python 3.5 | |
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.6.0-cp35-cp35m-linux_x86_64.whl | |
#3. Verification | |
# Run the following python script | |
import tensorflow as tf | |
print(tf.__version__) | |
hello = tf.constant('Hello, TensorFlow!') | |
sess = tf.Session() | |
print(sess.run(hello)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment