
Install GPU TensorFlow from Sources with Ubuntu 16.04 and Cuda 8.0 RC - wagonhelm
https://alliseesolutions.wordpress.com/2016/09/08/install-gpu-tensorflow-from-sources-w-ubuntu-16-04-and-cuda-8-0-rc/
======
flx42_
If using Docker is an option, the official Dockerfile works well, you just
need to modify the FROM line to "nvidia/cuda:8.0-cudnn5-devel-ubuntu16.04". Or
"nvidia/cuda:8.0-cudnn5-devel-ubuntu14.04", depending on which version of
Ubuntu you want.

[https://github.com/tensorflow/tensorflow/blob/master/tensorf...](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/Dockerfile.devel-
gpu)

~~~
mnbbrown
What sort of performance impact would Docker have in this situation? Any at
all?

Edit: spelling

~~~
flx42_
No performance impact as long as your I/O is done in volumes, to avoid going
through AUFS.

------
hughperkins
This seems to be a frankenstein of cuda 7.5 instructions and cuda 8.0.
Similarly ubuntu 14.04 and 16.04. As far as i know, these instructions will
fail from gcc 5.4 errors, amongst other issues.

~~~
wagonhelm
Wont GCC fail, includes a patch for GCC, I tested on my system before posting.
Running great!

~~~
flx42_
One of your section is named "Install Nvidia Toolkit 7.5", this is probably
what confused parent @hughperkins.

~~~
wagonhelm
Just found that one and fixed it, also someone confirmed working with a GTX
1080. I am so happy to finally ditch 14.04

------
bobdole1234
Why does it just take following directions to make it to the front page of HN
these days?

~~~
rspeer
Because GPU-accelerated learning is exciting, and most of the directions you
find for setting it up don't work. (Judging from other replies, this post may
be no different.)

This probably has something to do with the fact that GPUs are flaky and
idiosyncratic, and all the software that uses them depends on black-box
libraries handed down by Nvidia, who is completely shit at maintaining
software.

~~~
wagonhelm
[https://www.dropbox.com/s/tlcb7o7k10xaz8a/Screenshot%20from%...](https://www.dropbox.com/s/tlcb7o7k10xaz8a/Screenshot%20from%202016-09-08%2018-27-33.png?dl=0)

Screenshot for the skeptics.

------
trendia
Thank you so much. I tried 3 times in the last week to get it working with
Cuda 8.0

~~~
Florin_Andrei
Have you actually succeeded yet in building a pip package linked with CUDA 8?
I am doing basically the same process, and it only keeps failing.

[https://github.com/tensorflow/tensorflow/issues/2559#issueco...](https://github.com/tensorflow/tensorflow/issues/2559#issuecomment-245148956)

~~~
trendia
The pip package doesn't build for me either. And I even reinstalled Ubuntu to
get a fresh Python installation

~~~
wagonhelm
So strange I wonder why its working for me? Ubuntu 16.04.1? Fresh install?
following exactly? Python 3?

~~~
Florin_Andrei
Which branch are you building?

For the first time I was able to complete a build last night, Ubuntu 16.04,
CUDA 8.0 RC + compiler patch, cuDNN 5.1, nvidia-driver-370, python-2.7, and
compute capability 6.1 (for Pascal GPU) - but only when I switched to the
r0.10 branch.

With r0.10 I see none of the multiple failure modes that I always see with
master. It just went straight ahead and compiled the whole thing.

~~~
wagonhelm
I used master but seems like r.0.10 seems to be solving the problem for most.

------
Florin_Andrei
I'm not sure what Tensorflow source you're compiling, but I've been trying
many times recently and it fails in many, many different ways. It's a
neverending maze of fail, basically. I've __never __seen the end of it yet. It
failed today, too, so the code base is not getting better.

I'm using Ubuntu 16.04, CUDA 8.0RC + the gcc patch, cuDNN 5.1, nvidia-
driver-[367|370], tensorflow-master, python-2.7. My process is basically
identical to yours.

A few issues are listed here:

[https://github.com/tensorflow/tensorflow/issues/2559#issueco...](https://github.com/tensorflow/tensorflow/issues/2559#issuecomment-245148956)

In some cases, Bazel seems to be the culprit. In other cases, it's Tensorflow
itself. I've also seen a "gcc: internal compiler error"
[https://github.com/tensorflow/tensorflow/issues/4214](https://github.com/tensorflow/tensorflow/issues/4214)

Some issues with your howto:

There's a chapter title "Install Nvidia Toolkit 7.5 & CudNN" but the
instructions below use 8.0RC

```

Configure TensorFlow Installation

$ cd ~/tensorflow $ ./configure Use defaults by pressing enter for all except:

Please specify the location of python. [Default is /usr/bin/python]:

```

No. If you do that it won't compile with GPU support. You have to hit Enter on
every question except these ones:

\- Do you wish to build TensorFlow with GPU support? (answer: y)

\- Please specify a list of comma-separated Cuda compute capabilities you want
to build with. (answer: 6.1, or less for older GPUs)

\- Please specify the Cuda SDK version you want to use, e.g. 7.0. [Leave empty
to use system default]: (answer 8.0)

You don't have to specify the cuDNN version, apparently it can detect the
version automatically. It's only the CUDA version detection that fails.
[https://github.com/tensorflow/tensorflow/issues/3985](https://github.com/tensorflow/tensorflow/issues/3985)

"You must also have the 361.42 NVidia drivers installed"

No, that would not work with Pascal GPUs.

The only way I've seen it work is if you install CUDA 7.5 and cuDNN 4, and
install Tensorflow from the binary package. But then you get weird errors if
you run complex models on Pascal GPUs, because CUDA 7.5 doesn't work well with
Pascal.

Seriously, if you made it work on Ubuntu 16.04 with CUDA 8 and it's GPU
enabled, please upload the pip package somewhere. I'd love to give it a try.

~~~
wagonhelm
Just follow the instructions friend.

~~~
Florin_Andrei
I may go ahead and do a literal clone of your instructions. However, looking
at your process, it's what I do, step by step, AFAICT without actually going
ahead and doing it.

It's also the fact that it fails in so many different ways. Bazel bombs out
after ./configure; the master branch today does not even begin to build at
all, the old Bazel workaround is not working anymore. Then there's the gcc
issues.

You may have gotten lucky once, who knows why.

Again, do you still have the pip package you claim you've built using this
procedure? If so, can you upload it somewhere? I would very much like to test
it. Thank you.

~~~
wagonhelm
[https://www.dropbox.com/s/0cdoy7e8xh54wrx/tensorflow-0.10.0r...](https://www.dropbox.com/s/0cdoy7e8xh54wrx/tensorflow-0.10.0rc0-py3-none-
any.whl?dl=0)

Here is the pip3 wheel but I am skeptical given it was built for my system.

------
vonnik
fwiw, deeplearning4j is a much easier install:
[http://deeplearning4j.org/quickstart](http://deeplearning4j.org/quickstart)

