IAM

OPENSOURCEFAN STUDYING
STUDYINGCOMPUTERSCIENCEANDMATH COMPUTERSCIENCE

Check out the latest superpixel benchmark — Superpixel Benchmark (2016) — and let me know your opinion! @david_stutz

SERIES»Working with Ubuntu«

Building Tensorflow in an NFS-mounted $HOME, CUDA 8.0 Without Manual Driver Installation

This blog series collects useful insights for working with Ubuntu. In this article, I describe how to avoid building problems when building Tensorflow on an NFS-mounted $HOME directory and how to install CUDA 8.0 without a manual driver installation.

When trying to build Tensorflow from source on an NFS-mounted $HOME directory Bazel may complain as follows:

INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
ERROR: ~/.cache/bazel/_bazel/0c35697bae86f012211c10b7d080ea97/server (Directory not empty).

As described here (and indicated by the error message), this can be avoided using the --expunge_async option at the correct place in configure. The following snippet illustrates the change:

function bazel_clean_and_fetch() {
  # bazel clean --expunge currently doesn't work on Windows
  # TODO(pcloudy): Re-enable it after bazel clean --expunge is fixed.
  if ! is_windows; then
    # THIS NEEDS TO BE CHANGED DUE TO THE NFS HOME DIR!
    bazel clean --expunge_async
    # TODO(https://github.com/bazelbuild/bazel/issues/2220) Remove the nested `bazel query`.
    bazel fetch $(bazel query "//tensorflow/... -//tensorflow/examples/android/...")
  else
    # TODO(pcloudy): Also filter out //tensorflow/examples/android/... on Windows after
    # https://github.com/bazelbuild/bazel/issues/2248 is fixed.
    bazel fetch //tensorflow/...
  fi
}

When upgrading to CUDA 8.0 on Ubuntu 16.04, I came across an easier way to install the necessary graphic drivers (in contrast to the description here). Instead of installing the latest NVidia driver manually (through the included runfile in the CUDA 8.0 download), it is sufficiently to:

$ sudo apt-get install nvidia-367 # might need to be adapted for future versions
# This could be used to easily install CUDA 7.5, jsut saying ...
# sudo apt-get install nvidia-cuda-dev nvidia-cuda-toolkit

This potentially also avoids problems after the manual installation, such as the login loop described here. Now, CUDA 8.0 can be downloaded from the webiste, choosing Linux > x86_64 > Ubuntu > 16.04 > runfile. The downloaded runfile should be extracted as follows:

$ ./cuda_8.0.44_linux.run -extract=~/Downloads/nvidia_installers

Then, CUDA 8.0 can be installed by running the corresponding runfile in ~/Downloads/nvidia_installers. I am not sure if a similar approach will also work on Ubuntu 14.04.

More from »Working with Ubuntu«:

What is your opinion on this article? Did you find it interesting or useful? Let me know your thoughts in the comments below or get in touch with me:

@david_stutz