Eu uso o Ubuntu 15.10. Atualmente estou construindo o TensorFlow a partir do código-fonte, seguindo as instruções aqui .
Minha instalação é bem-sucedida, salve na última etapa, "Construa seu destino com suporte a GPU".
Quando executo bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer --verbose_failures
, vejo a seguinte saída:
INFO: Found 1 target...
ERROR: /home/me/tensorflow/tensorflow/cc/BUILD:28:1: Linking of rule '//tensorflow/cc:ops/nn_ops_gen_cc' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command
(cd /home/me/.cache/bazel/_bazel_me/38a03c514c8dc954778fc9a555bce3de/tensorflow && \
exec env - \
third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -o bazel-out/host/bin/tensorflow/cc/ops/nn_ops_gen_cc '-Wl,-rpath,$ORIGIN/../../../_solib_local/_U_S_Sthird_Uparty_Sgpus_Scuda_Ccudart___Uthird_Uparty_Sgpus_Scuda_Slib64' -Lbazel-out/host/bin/_solib_local/_U_S_Sthird_Uparty_Sgpus_Scuda_Ccudart___Uthird_Uparty_Sgpus_Scuda_Slib64 bazel-out/host/bin/tensorflow/cc/libcc_op_gen_main.a -Wl,-whole-archive bazel-out/host/bin/tensorflow/core/libnn_ops_op_lib.lo -Wl,-no-whole-archive -Wl,-whole-archive bazel-out/host/bin/tensorflow/core/libframework_internal.lo -Wl,-no-whole-archive bazel-out/host/bin/tensorflow/core/liblib_internal.a bazel-out/host/bin/external/jpeg_archive/libjpeg.a bazel-out/host/bin/external/png_archive/libpng.a bazel-out/host/bin/external/re2/libre2.a bazel-out/host/bin/tensorflow/core/libprotos_all_cc.a bazel-out/host/bin/google/protobuf/libprotobuf.a bazel-out/host/bin/google/protobuf/libprotobuf_lite.a bazel-out/host/bin/_solib_local/_U_S_Sthird_Uparty_Sgpus_Scuda_Ccudart___Uthird_Uparty_Sgpus_Scuda_Slib64/libcudart.so.7.5 -lm -ldl -lm -ldl -lz -pthread -lpthread -Wl,-rpath,third_party/gpus/cuda/lib64 -lstdc++ -B/usr/bin/ -pie -Wl,-z,relro,-z,now -no-canonical-prefixes -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S -Wl,--gc-sections): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1: crosstool_wrapper_driver_is_not_gcc failed: error executing command
(cd /home/me/.cache/bazel/_bazel_me/38a03c514c8dc954778fc9a555bce3de/tensorflow && \
exec env - \
third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -o bazel-out/host/bin/tensorflow/cc/ops/nn_ops_gen_cc '-Wl,-rpath,$ORIGIN/../../../_solib_local/_U_S_Sthird_Uparty_Sgpus_Scuda_Ccudart___Uthird_Uparty_Sgpus_Scuda_Slib64' -Lbazel-out/host/bin/_solib_local/_U_S_Sthird_Uparty_Sgpus_Scuda_Ccudart___Uthird_Uparty_Sgpus_Scuda_Slib64 bazel-out/host/bin/tensorflow/cc/libcc_op_gen_main.a -Wl,-whole-archive bazel-out/host/bin/tensorflow/core/libnn_ops_op_lib.lo -Wl,-no-whole-archive -Wl,-whole-archive bazel-out/host/bin/tensorflow/core/libframework_internal.lo -Wl,-no-whole-archive bazel-out/host/bin/tensorflow/core/liblib_internal.a bazel-out/host/bin/external/jpeg_archive/libjpeg.a bazel-out/host/bin/external/png_archive/libpng.a bazel-out/host/bin/external/re2/libre2.a bazel-out/host/bin/tensorflow/core/libprotos_all_cc.a bazel-out/host/bin/google/protobuf/libprotobuf.a bazel-out/host/bin/google/protobuf/libprotobuf_lite.a bazel-out/host/bin/_solib_local/_U_S_Sthird_Uparty_Sgpus_Scuda_Ccudart___Uthird_Uparty_Sgpus_Scuda_Slib64/libcudart.so.7.5 -lm -ldl -lm -ldl -lz -pthread -lpthread -Wl,-rpath,third_party/gpus/cuda/lib64 -lstdc++ -B/usr/bin/ -pie -Wl,-z,relro,-z,now -no-canonical-prefixes -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S -Wl,--gc-sections): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
Target //tensorflow/cc:tutorials_example_trainer failed to build
INFO: Elapsed time: 0.348s, Critical Path: 0.20s
O erro principal parece ser aquele Linking of rule '//tensorflow/cc:ops/nn_ops_gen_cc' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command
.
EDITAR:
Aqui está outra mensagem de erro que também vejo:
INFO: Found 1 target...
ERROR: /home/me/tensorflow/tensorflow/core/kernels/BUILD:235:1: error while parsing .d file: /home/miao_gambolputtymeensorflow/bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/constant_op_gpu/tensorflow/core/kernels/constant_op_gpu.cu.d (No such file or directory).
nvcc warning : option '--relaxed-constexpr' has been deprecated and replaced by option '--expt-relaxed-constexpr'.
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
Target //tensorflow/cc:tutorials_example_trainer failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.233s, Critical Path: 0.10s
Algum conselho?