5
$\begingroup$

I've been tearing my hair out for the last 3 days and I just can't get it to work.

I recently got a GTX 1070 and I went to a fresh install with:

  • Ubuntu 16.04/15.10/15.04
  • PPA drivers nvidia-367
  • Cuda 7.5

Somehow every step of the way I couldn't get CUDA to detect my GPU despite following various instructions:

https://askubuntu.com/questions/693145/installing-cuda-7-5-toolkit-on-ubuntu-15-10

https://www.pugetsystems.com/labs/hpc/GTX-1080-CUDA-performance-on-Linux-Ubuntu-16-04-preliminary-results-nbody-and-NAMD-803/

Has anyone been able to get 1070/1080 running CUDA and tensorflow correctly and can guide me thru this painful process?

(I can't do Ubuntu 14.04 as it doesn't register my wifi card, which then I can't do anything)

$\endgroup$
  • $\begingroup$ Congrats, I didn't even get past the login screen without the system crashing. (I dumped it and went with Windows and Theano, which worked fine) $\endgroup$ – stmax Jul 11 '16 at 7:44
4
$\begingroup$

I was in the same boat, but now that I have figured it out, I have listed the steps for installing tensorflow 0.9 with cuda toolkit 8.0, cudnn 5.1, bazel 0.3 on Ubuntu 16.04 LTS here: http://abhay.harpale.net/blog/machine-learning/deep-learning/getting-tensorflow-to-work-with-gpu-nvidia-gtx-1080-on-ubuntu-16-04-lts/

Here's the gist

  1. Install NVidia Cuda Toolkit
  2. Install NVidia CuDNN
  3. Install Tensorflow dependencies such as swig, python-dev, numpy, python-wheel, zlib1g, g++
  4. Configure and build tensorflow using Bazel
| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Thank you, and welcome to DataScience.SE! Please post the gist of it here because blogs come and go, and we like our answers to be self-contained. $\endgroup$ – Emre Jul 23 '16 at 4:58
  • 1
    $\begingroup$ Thanks. I have added the gist. Sorry, I am new to this process. $\endgroup$ – abhay Jul 25 '16 at 4:55
1
$\begingroup$

This helped me run on GTX 1080 on a 16.04 ubuntu machine (driver 367.27): http://yangcha.github.io/Tensorflow/

It basically says install CUDA 8RC, CuDNN 5 and build TensorFlow from source by following the instructions.

I assume the GTX 1070 should behave the same to GTX 1080 on that regard.

| improve this answer | |
$\endgroup$
1
$\begingroup$

This took me quite a while to get just right but here is what I did Download Ubuntu 16.04 .iso Download unetbootin Boot from drive to install ubuntu use 3rd parter drivers to avoid wireless issues Download the driver for the NVIDIA 1070 card 367.27 Hit ctrl-alt-f1 to open a virtual terminal sudo service lightdm stop cd ~/Downloads sudo chmod 755 "name of driver".run sudo ./"name of driver".run cd reboot

Download CUDA 8.0 and patch 1
Hit ctrl-alt-f1 to open a virtual terminal
sudo service lightdm stop
cd ~/Downloads
sudo chmod 755 "name of CUDA installer".run
sudo ./"name of CUDA installer".run --override
*Do not install the driver since we already did
sudo chmod 755 "name of CUDA installer".run
sudo ./"name of CUDA installer".run --override
sudo chmod 755 "name of CUDA patch".run
sudo ./"name of CUDA patch".run
cd
reboot

Download cuDNN 5.1
cd ~/Downoads

tar xvzf cudnn-8.0-linux-x64-v5.1.tgz
sudo cp cuda/include/cudnn.h /usr/local/cuda-8.0/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda-8.0/lib64
sudo chmod a+r /usr/local/cuda-8.0/include/cudnn.h /usr/local/cuda-8.0/lib64/libcudnn*

Run and add the following to bash file

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda-8.0/lib64:/usr/local/cuda-8.0/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda-8.0


sudo apt-get install python-pip python-dev

sudo apt-get install git


$ git clone https://github.com/tensorflow/tensorflow

sudo apt-get install openjdk-8-jdk


sudo apt-get install pkg-config zip g++ zlib1g-dev unzip

Download bazel-0.3.1 for linux


 chmod +x bazel-version-installer-os.sh
 ./bazel-version-installer-os.sh --user

sudo apt-get install python-numpy swig python-dev python-wheel

cd ~/tensorflow

./configure

use CUDA 8.0 and cudnn 5.1.5

bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer


bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu

bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

sudo pip install /tmp/tensorflow_pkg/tensorflow-0.10.0rc0-py2-none-any.whl


cd tensorflow/models/image/mnist
python convolutional.py
| improve this answer | |
$\endgroup$
1
$\begingroup$

I've created some GIST file with steps how to "Install TensorFlow v 0.11 and CUDA 8.1 | CUDNN 5.1 on Ubuntu 16.04"

https://gist.github.com/denti/41860cb6b55e0847b4f2685016c7f14e

It works perfect for me for fresh 16.04. You can skip last part with install bazel and tensorflow from scratch.

| improve this answer | |
$\endgroup$
1
$\begingroup$

The easiest thing would be to download a Docker Image. I recently created a Docker Image with CUDA 9.0, cudnn, tensorlflow and keras. I have a gtx 1070 and it worked without any issue.

https://hub.docker.com/r/deejay217/cuda9_python3_tensorflow17/

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.