Tensorflow 0.12, Ubuntu16.04, CUDA 8

Task: install Tensorflow framework on Ubuntu 16.04 with CUDA 8.0

Update the system

  • Install build essentials:
    • sudo apt-get install build-essential
  • Install latest version of kernel headers:
    • sudo apt-get install linux-headers-uname -r

Install CUDA

  • Install curl (for the CUDA download):
    • sudo apt-get install curl
  • Download CUDA 8.0 to Downloads folder
  • Make the downloaded installer file runnable:
    • chmod +x cuda_8.0.44_linux.run
  • Run the CUDA installer:
    • sudo ./cuda_8.0.44_linux.run --kernel-source-path=/usr/src/linux-headers-`uname -r`/
      • Accept the EULA
      • Do NOT install the graphics card drivers (since we are in a virtual machine)
      • Install the toolkit (leave path at default)
      • Install symbolic link
      • Install samples (leave path at default)
  • Update the library path
    • echo 'export PATH=/usr/local/cuda/bin:$PATH' >> ~/.bashrc
    • echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/lib' >> ~/.bashrc
    • source ~/.bashrc 

Install pip

  • Install pip:
    • sudo apt-get install python-pip python-dev

Install Tensorflow

  • Install Tensorflow:
    • pip install tensorflow

Test Tensorflow:

  • Test Tensorflow:
    • python
    • import tensor flow as tf

Congralutations!!! You have successfully installed Tensorflow into Ubuntu 16.04 with CUDA 8.0. Let’s enjoy it now.

Advertisements