Search code examples
pythontensorflowmagenta

Bazel test build fails


I'm using anaconda env. for building magenta, and followed the installation steps as per the README

After running the command

bazel test //magenta/...

it says

Executed 5 out of 5 tests: 5 fail locally

The test.log is as follows

Traceback (most recent call last):
File "/home/ff/.cache/bazel/_bazel_ff/e20bdd5a13b0197259100b3aae16dd49/execroot/magenta/bazel-out/local-opt/bin/magenta/scripts/convert_midi_dir_to_note_sequences_test.runfiles/__main__/magenta/scripts/convert_midi_dir_to_note_sequences_test.py", line 20, in <module>
import tensorflow as tf
File "/home/ff/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/home/ff/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 48, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/ff/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/home/ff/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory

In the same directory, if I try to import tensorflow in python cmd,

import tensorflow
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.so.4 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcurand.so locally

What am I doing wrong?


Solution

  • The solution (as explained in an issue)) helped. The error was that the programs were not able to find cuda libraries. So installing "cuda-ld-conf" library solved the problem.