Skip to content

Latest commit

 

History

History
107 lines (76 loc) · 2.5 KB

setup_tensorflow_in_ubuntu.org

File metadata and controls

107 lines (76 loc) · 2.5 KB

Set up dev env for Tensorflow

NVIDIA driver

  • Download latest version of driver from NVIDIA
  • Remove recently installed drivers
sudo apt-get purge nvidia*
  • Log in tty1
    • Press Ctrl + Alt + F1
    • Type in your username and hit Enter
    • Type in your password and hit Enter
  • Shut down X server.
# unity
sudo service lightdm stop
# gnome
sudo service gdm stop
  • Make the installer file excutable.
chmod +x <path-to-file>
  • Run the executable install file
sudo sh <path-to-file>
  • Start X server
# unity
sudo service lightdm start
# gnome
sudo service gdm start

You can use Alt + Left to switch back to GUI.

Note: Don’t delete the installer file. You need it to uninstall driver later.

sudo sh <path-to-file> --uninstall

Reference: http://www.yourownlinux.com/2016/06/how-to-install-nvidia-367-27-stable-graphics-drivers-in-linux.html

Install CUDA 7.5

Install pip

  • Download latest version of get-pip.py
  • Run the following:
python get-pip.py

Install CuDNN v4

  • Download cuDNN v4.
  • Uncompress archive file and copy files into toolkit directory
tar xvzf <cudnn-file>
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
  • Set environment variables. Adding the command below to ~/.bashrc
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64"
export CUDA_HOME=/usr/local/cuda
  • Activate the env variables
source ~/.bashrc

Reference:

Install Tensorflow 0.10 with pip

  • Before intalling Tensorflow, you should check the latest avaiable version. I use 0.10 as an example.
  • Follow instructions from Tensorflow
  • Test Tensorflow Installation
import tensorflow as tf
sess = tf.InteractiveSession()

If you don’t run into any error, it means Tensorflow is ready to go on your machine.