bazel: Error while building tensorflow 0.11.0 - cache (directory not empty)

I’m trying to install tensorflow 0.11.0 by running

./configure

I’m getting an error saying :

ERROR: /home/abc/.cache/bazel/_bazel_abc/235fe154e0/server (Directory not empty).

I’m not sure if they are related, but before the error message, I also get a warning saying:

WARNING: Output base '/home/abc/.cache/bazel/_bazel_abc/235fe154e0' is on NFS.     
This may lead to surprising failures and undetermined behavior.

I have no clue what the error message means, but if I try running ./configure right after this error message, I get another message saying:

/home/rkohli1/.cache/bazel/_bazel_rkohli1/235fe154e0a4c7e0c0527cd185fe6b6b/server/
.nfs00000000820050bd00000e9e (Device or resource busy).

At this point, I just tried deleting the entire .cache folder (I had to first kill a process which was preventing me from deleting it). I tried running configure with the --expunge_async flag as well but it doesn’t help. It takes me back to the first error message.

Not sure if it’s relevant, but I’m trying to install tensorflow with GPU support and use cuda 8.0 and cudNN 5

I raised this issue on stackoverflow (http://stackoverflow.com/questions/40144776/tensorflow-installation-error-directory-not-empty), and someone pointed out that it’s due to a bug in bazel. Please advise me if I’m wrong.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 15 (2 by maintainers)

Most upvoted comments

I attempted both solutions suggest by @sfincke and @yselivonchyk, but without luck. Finally, I managed to change the cache location by running TEST_TMPDIR=/tmp/bazel/ ./configure, which solved the issue.

This global variable sets the overall cache directory as described here: https://bazel.build/versions/master/docs/output_directories.html.

No sure if this is correct, but after I make the following change in the configure file:

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 #bazel clean --expunge bazel clean --expunge_async fi bazel fetch //tensorflow/… }

I can install tensorflow 0.11 from source, with

  • bazel 0.3.1
  • cuDNN 5
  • Cuda 8.0

Jian

I was trying to build TF0.12 from source with bazel using NFS.

Neither of the suggestions from above worked for me:

  1. editing .config file and adding --output_base did not work for fetch
  2. everything from that thread resulted in the same NFS warning and issue with bazel’s cache

This solution seems to be helping: http://stackoverflow.com/questions/40144776/tensorflow-installation-error-directory-not-empty

Solution: edit .config file and replace bazel clean --expunge with bazel clean --expunge_async