使用命令
从源代码构建启用GPU的TensorFlow版本时bazel build -c opt --verbose_failures --config=cuda //tensorflow/cc:tutorials_example_trainer
我收到错误:
INFO: From Compiling external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.cc:
python2: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory`
.so文件位于我的LD_LIBRARY_PATH:
中指向的目录中echo $LD_LIBRARY_PATH
/opt/rh/python27/root/usr/lib64:/share/sw/free/cuDNN/cudnn-6.5-linux-x64-v2:/share/sw/free/cuDNN/cudnn-6.5-linux-x64-v2:/share/sw/free/cuda/7.0/lib64`
为了提供更多信息,这里是我得到的整个错误消息:
bazel build -c opt --verbose_failures --config=cuda //tensorflow/cc:tutorials_example_trainer
WARNING: Output base '/home/jderose/.cache/bazel/_bazel_jderose/a0466e9ddb344902e2cf080e42365397' is on NFS. This may lead to surprising failures and undetermined behavior.
WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.io/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.
INFO: Found 1 target...
INFO: From Compiling external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.cc:
python2: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
ERROR: /home/jderose/.cache/bazel/_bazel_jderose/a0466e9ddb344902e2cf080e42365397/external/gemmlowp/BUILD:77:1: C++ compilation of rule '@gemmlowp//:eight_bit_int_gemm' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command
(cd /home/jderose/.cache/bazel/_bazel_jderose/a0466e9ddb344902e2cf080e42365397/tensorflow && \
exec env - \
INTERCEPT_LOCALLY_EXECUTABLE=1 \
PATH=/share/sw/free/cuda/7.0/bin:/share/sw/free/bazel/0.1.1/bin:/home/jderose/.local/bin:/home/jderose/bin:/home/jderose/projects:/opt/rh/python27/root/usr/bin:/share/sw/srcc/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/ganglia/bin:/opt/ganglia/sbin:/usr/java/latest/bin:/opt/pdsh/bin:/opt/rocks/bin:/opt/rocks/sbin:/opt/dell/srvadmin/bin \
TMPDIR=/local-scratch/jderose/39523 \
third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++11' -iquote . -iquote bazel-out/local_linux-opt/genfiles -isystem tools/cpp/gcc3 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-opt/bin/external/gemmlowp/_objs/eight_bit_int_gemm/external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.o' -MD -MF bazel-out/local_linux-opt/bin/external/gemmlowp/_objs/eight_bit_int_gemm/external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.d -c external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.cc -o bazel-out/local_linux-opt/bin/external/gemmlowp/_objs/eight_bit_int_gemm/external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127: crosstool_wrapper_driver_is_not_gcc failed: error executing command
(cd /home/jderose/.cache/bazel/_bazel_jderose/a0466e9ddb344902e2cf080e42365397/tensorflow && \
exec env - \
INTERCEPT_LOCALLY_EXECUTABLE=1 \
PATH=/share/sw/free/cuda/7.0/bin:/share/sw/free/bazel/0.1.1/bin:/home/jderose/.local/bin:/home/jderose/bin:/home/jderose/projects:/opt/rh/python27/root/usr/bin:/share/sw/srcc/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/ganglia/bin:/opt/ganglia/sbin:/usr/java/latest/bin:/opt/pdsh/bin:/opt/rocks/bin:/opt/rocks/sbin:/opt/dell/srvadmin/bin \
TMPDIR=/local-scratch/jderose/39523 \
third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++11' -iquote . -iquote bazel-out/local_linux-opt/genfiles -isystem tools/cpp/gcc3 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-opt/bin/external/gemmlowp/_objs/eight_bit_int_gemm/external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.o' -MD -MF bazel-out/local_linux-opt/bin/external/gemmlowp/_objs/eight_bit_int_gemm/external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.d -c external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.cc -o bazel-out/local_linux-opt/bin/external/gemmlowp/_objs/eight_bit_int_gemm/external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127.
Target //tensorflow/cc:tutorials_example_trainer failed to build
谢谢!
答案 0 :(得分:0)
你能够构建TensorFlow的非Cuda版本吗?它会告诉我们是否你的python环境在某种程度上被TensorFlow破坏了。