TensorFlow构建错误:“失败(退出1):crosstool_wrapper_driver_is_not_gcc”

时间:2019-09-24 07:05:32

标签: tensorflow bazel

我目前正在尝试使用Bazel从源代码构建TensorFlow。我正在尝试使用TF 1.14(使用Bazel 0.24.1)和TF 1.13(使用Bazel 0.19.2),但是我总是遇到同样令人讨厌的错误。我看到人们遇到了这些问题,并在网上提到了这些问题,但是TensorFlow的家伙一直在说“我们从头解决了”。但似乎仍然无法正常工作。这是错误和日志:

当我尝试使用以下命令构建1.13时;

bazel build --config=opt --config=nonccl --verbose_failures //tensorflow/tools/pip_package:build_pip_package //tensorflow:libtensorflow_cc.so //tensorflow:libtensorflow_framework.so --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0

大约3-4小时后,我收到以下错误消息:

ERROR: /root/tensorflow/tensorflow/contrib/tensorrt/BUILD:268:1: C++ compilation of rule '//tensorflow/contrib/tensorrt:trt_conversion' failed (Exit 1): crosstool_wrapper_driver_is_not_gcc failed: error executing command 
  (cd /root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/execroot/org_tensorflow && \
  exec env - \
    CUDA_TOOLKIT_PATH=/usr/local/cuda-10.0 \
    CUDNN_INSTALL_PATH=/usr/lib/aarch64-linux-gnu \
    GCC_HOST_COMPILER_PATH=/usr/bin/gcc-5 \
    LD_LIBRARY_PATH=/usr/local/cuda-10.0/targets/aarch64-linux/lib: \
    PATH=/root/bazel/output:/usr/local/cuda-10.0/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
    PWD=/proc/self/cwd \
    PYTHON_BIN_PATH=/usr/bin/python3 \
    PYTHON_LIB_PATH=/usr/lib/python3.6/dist-packages \
    TENSORRT_INSTALL_PATH=/usr/lib/aarch64-linux-gnu \
    TF_CUDA_CLANG=0 \
    TF_CUDA_COMPUTE_CAPABILITIES=7.2 \
    TF_CUDA_VERSION=10.0 \
    TF_CUDNN_VERSION=7 \
    TF_NCCL_VERSION='' \
    TF_NEED_CUDA=1 \
    TF_NEED_OPENCL_SYCL=0 \
    TF_NEED_ROCM=0 \
    TF_TENSORRT_VERSION=5.1.6 \
  external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -MD -MF bazel-out/aarch64-opt/bin/tensorflow/contrib/tensorrt/_objs/trt_conversion/convert_nodes.pic.d '-frandom-seed=bazel-out/aarch64-opt/bin/tensorflow/contrib/tensorrt/_objs/trt_conversion/convert_nodes.pic.o' -D__CLANG_SUPPORT_DYN_ANNOTATION__ -DEIGEN_MPL2_ONLY '-DEIGEN_MAX_ALIGN_BYTES=64' '-DEIGEN_HAS_TYPE_TRAITS=0' -DTF_USE_SNAPPY -iquote . -iquote bazel-out/aarch64-opt/genfiles -iquote bazel-out/aarch64-opt/bin -iquote external/com_google_absl -iquote bazel-out/aarch64-opt/genfiles/external/com_google_absl -iquote bazel-out/aarch64-opt/bin/external/com_google_absl -iquote external/bazel_tools -iquote bazel-out/aarch64-opt/genfiles/external/bazel_tools -iquote bazel-out/aarch64-opt/bin/external/bazel_tools -iquote external/eigen_archive -iquote bazel-out/aarch64-opt/genfiles/external/eigen_archive -iquote bazel-out/aarch64-opt/bin/external/eigen_archive -iquote external/local_config_sycl -iquote bazel-out/aarch64-opt/genfiles/external/local_config_sycl -iquote bazel-out/aarch64-opt/bin/external/local_config_sycl -iquote external/nsync -iquote bazel-out/aarch64-opt/genfiles/external/nsync -iquote bazel-out/aarch64-opt/bin/external/nsync -iquote external/gif_archive -iquote bazel-out/aarch64-opt/genfiles/external/gif_archive -iquote bazel-out/aarch64-opt/bin/external/gif_archive -iquote external/jpeg -iquote bazel-out/aarch64-opt/genfiles/external/jpeg -iquote bazel-out/aarch64-opt/bin/external/jpeg -iquote external/protobuf_archive -iquote bazel-out/aarch64-opt/genfiles/external/protobuf_archive -iquote bazel-out/aarch64-opt/bin/external/protobuf_archive -iquote external/com_googlesource_code_re2 -iquote bazel-out/aarch64-opt/genfiles/external/com_googlesource_code_re2 -iquote bazel-out/aarch64-opt/bin/external/com_googlesource_code_re2 -iquote external/farmhash_archive -iquote bazel-out/aarch64-opt/genfiles/external/farmhash_archive -iquote bazel-out/aarch64-opt/bin/external/farmhash_archive -iquote external/fft2d -iquote bazel-out/aarch64-opt/genfiles/external/fft2d -iquote bazel-out/aarch64-opt/bin/external/fft2d -iquote external/highwayhash -iquote bazel-out/aarch64-opt/genfiles/external/highwayhash -iquote bazel-out/aarch64-opt/bin/external/highwayhash -iquote external/zlib_archive -iquote bazel-out/aarch64-opt/genfiles/external/zlib_archive -iquote bazel-out/aarch64-opt/bin/external/zlib_archive -iquote external/local_config_cuda -iquote bazel-out/aarch64-opt/genfiles/external/local_config_cuda -iquote bazel-out/aarch64-opt/bin/external/local_config_cuda -iquote external/double_conversion -iquote bazel-out/aarch64-opt/genfiles/external/double_conversion -iquote bazel-out/aarch64-opt/bin/external/double_conversion -iquote external/local_config_tensorrt -iquote bazel-out/aarch64-opt/genfiles/external/local_config_tensorrt -iquote bazel-out/aarch64-opt/bin/external/local_config_tensorrt -isystem external/eigen_archive -isystem bazel-out/aarch64-opt/genfiles/external/eigen_archive -isystem bazel-out/aarch64-opt/bin/external/eigen_archive -isystem external/nsync/public -isystem bazel-out/aarch64-opt/genfiles/external/nsync/public -isystem bazel-out/aarch64-opt/bin/external/nsync/public -isystem external/gif_archive/lib -isystem bazel-out/aarch64-opt/genfiles/external/gif_archive/lib -isystem bazel-out/aarch64-opt/bin/external/gif_archive/lib -isystem external/protobuf_archive/src -isystem bazel-out/aarch64-opt/genfiles/external/protobuf_archive/src -isystem bazel-out/aarch64-opt/bin/external/protobuf_archive/src -isystem external/farmhash_archive/src -isystem bazel-out/aarch64-opt/genfiles/external/farmhash_archive/src -isystem bazel-out/aarch64-opt/bin/external/farmhash_archive/src -isystem external/zlib_archive -isystem bazel-out/aarch64-opt/genfiles/external/zlib_archive -isystem bazel-out/aarch64-opt/bin/external/zlib_archive -isystem external/local_config_cuda/cuda -isystem bazel-out/aarch64-opt/genfiles/external/local_config_cuda/cuda -isystem bazel-out/aarch64-opt/bin/external/local_config_cuda/cuda -isystem external/local_config_cuda/cuda/cuda/include -isystem bazel-out/aarch64-opt/genfiles/external/local_config_cuda/cuda/cuda/include -isystem bazel-out/aarch64-opt/bin/external/local_config_cuda/cuda/cuda/include -isystem external/local_config_cuda/cuda/cuda/include/crt -isystem bazel-out/aarch64-opt/genfiles/external/local_config_cuda/cuda/cuda/include/crt -isystem bazel-out/aarch64-opt/bin/external/local_config_cuda/cuda/cuda/include/crt -isystem external/double_conversion -isystem bazel-out/aarch64-opt/genfiles/external/double_conversion -isystem bazel-out/aarch64-opt/bin/external/double_conversion -isystem external/local_config_tensorrt/include -isystem bazel-out/aarch64-opt/genfiles/external/local_config_tensorrt/include -isystem bazel-out/aarch64-opt/bin/external/local_config_tensorrt/include '-std=c++11' -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -fPIC -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -fno-omit-frame-pointer -no-canonical-prefixes -fno-canonical-system-headers -DNDEBUG -g0 -O2 -ffunction-sections -fdata-sections '-march=native' -Wno-sign-compare '-D_GLIBCXX_USE_CXX11_ABI=0' -DEIGEN_AVOID_STL_ARRAY -Iexternal/gemmlowp -Wno-sign-compare -fno-exceptions '-ftemplate-depth=900' '-DGOOGLE_CUDA=1' '-DGOOGLE_TENSORRT=1' -pthread '-DGOOGLE_CUDA=1' '-DGOOGLE_TENSORRT=1' -c tensorflow/contrib/tensorrt/convert/convert_nodes.cc -o bazel-out/aarch64-opt/bin/tensorflow/contrib/tensorrt/_objs/trt_conversion/convert_nodes.pic.o)
tensorflow/contrib/tensorrt/convert/convert_nodes.cc: In constructor 'tensorflow::tensorrt::convert::TRT_TensorOrWeights::TRT_TensorOrWeights(nvinfer1::DataType, const nvinfer1::Dims&, int)':
tensorflow/contrib/tensorrt/convert/convert_nodes.cc:516:60: error: invalid new-expression of abstract class type 'tensorflow::tensorrt::convert::TRT_TensorOrWeights::SimpleITensor'
     : simple_itensor_(new SimpleITensor(trt_dtype, trt_dims)),
                                                            ^
tensorflow/contrib/tensorrt/convert/convert_nodes.cc:459:28: note:   because the following virtual functions are pure within 'tensorflow::tensorrt::convert::TRT_TensorOrWeights::SimpleITensor':
 class TRT_TensorOrWeights::SimpleITensor : public nvinfer1::ITensor {
                            ^
In file included from ./tensorflow/contrib/tensorrt/log/trt_logger.h:23:0,
                 from ./tensorflow/contrib/tensorrt/convert/convert_nodes.h:26,
                 from tensorflow/contrib/tensorrt/convert/convert_nodes.cc:16:
bazel-out/aarch64-opt/genfiles/external/local_config_tensorrt/tensorrt/include/NvInfer.h:774:18: note:  virtual bool nvinfer1::ITensor::dynamicRangeIsSet() const
     virtual bool dynamicRangeIsSet() const = 0;
                  ^
bazel-out/aarch64-opt/genfiles/external/local_config_tensorrt/tensorrt/include/NvInfer.h:779:18: note:  virtual void nvinfer1::ITensor::resetDynamicRange()
     virtual void resetDynamicRange() = 0;
                  ^
bazel-out/aarch64-opt/genfiles/external/local_config_tensorrt/tensorrt/include/NvInfer.h:786:19: note:  virtual float nvinfer1::ITensor::getDynamicRangeMin() const
     virtual float getDynamicRangeMin() const = 0;
                   ^
bazel-out/aarch64-opt/genfiles/external/local_config_tensorrt/tensorrt/include/NvInfer.h:793:19: note:  virtual float nvinfer1::ITensor::getDynamicRangeMax() const
     virtual float getDynamicRangeMax() const = 0;

如果我尝试使用以下命令构建1.14;

bazel build --config=opt --config=nonccl //tensorflow/tools/pip_package:build_pip_package --verbose_failures --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"

我收到以下错误:

ERROR: /opt/tf13/tensorflow/tensorflow/lite/kernels/BUILD:286:1: C++ compilation of rule '//tensorflow/lite/kernels:builtin_op_kernels' failed (Exit 1): crosstool_wrapper_driver_is_not_gcc failed: error executing command 
  (cd /root/.cache/bazel/_bazel_root/8c266c5a221eef177229796f3ca6ace6/execroot/org_tensorflow && \
  exec env - \
    LD_LIBRARY_PATH=/usr/local/cuda-10.0/targets/aarch64-linux/lib: \
    PATH=/root/bazel/output:/usr/local/cuda-10.0/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
    PWD=/proc/self/cwd \
  external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -MD -MF bazel-out/host/bin/tensorflow/lite/kernels/_objs/builtin_op_kernels/depthwise_conv.pic.d '-frandom-seed=bazel-out/host/bin/tensorflow/lite/kernels/_objs/builtin_op_kernels/depthwise_conv.pic.o' -DEIGEN_MPL2_ONLY '-DEIGEN_MAX_ALIGN_BYTES=64' '-DEIGEN_HAS_TYPE_TRAITS=0' -iquote . -iquote bazel-out/host/genfiles -iquote bazel-out/host/bin -iquote external/gemmlowp -iquote bazel-out/host/genfiles/external/gemmlowp -iquote bazel-out/host/bin/external/gemmlowp -iquote external/com_google_absl -iquote bazel-out/host/genfiles/external/com_google_absl -iquote bazel-out/host/bin/external/com_google_absl -iquote external/arm_neon_2_x86_sse -iquote bazel-out/host/genfiles/external/arm_neon_2_x86_sse -iquote bazel-out/host/bin/external/arm_neon_2_x86_sse -iquote external/eigen_archive -iquote bazel-out/host/genfiles/external/eigen_archive -iquote bazel-out/host/bin/external/eigen_archive -iquote external/local_config_sycl -iquote bazel-out/host/genfiles/external/local_config_sycl -iquote bazel-out/host/bin/external/local_config_sycl -iquote external/flatbuffers -iquote bazel-out/host/genfiles/external/flatbuffers -iquote bazel-out/host/bin/external/flatbuffers -iquote external/fft2d -iquote bazel-out/host/genfiles/external/fft2d -iquote bazel-out/host/bin/external/fft2d -iquote external/farmhash_archive -iquote bazel-out/host/genfiles/external/farmhash_archive -iquote bazel-out/host/bin/external/farmhash_archive -isystem external/eigen_archive -isystem bazel-out/host/genfiles/external/eigen_archive -isystem bazel-out/host/bin/external/eigen_archive -isystem tensorflow/lite/schema -isystem bazel-out/host/genfiles/tensorflow/lite/schema -isystem bazel-out/host/bin/tensorflow/lite/schema -isystem external/flatbuffers/include -isystem bazel-out/host/genfiles/external/flatbuffers/include -isystem bazel-out/host/bin/external/flatbuffers/include -isystem external/farmhash_archive/src -isystem bazel-out/host/genfiles/external/farmhash_archive/src -isystem bazel-out/host/bin/external/farmhash_archive/src '-std=c++11' -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -fPIC -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -fno-omit-frame-pointer -no-canonical-prefixes -fno-canonical-system-headers -DNDEBUG -g0 -O2 -ffunction-sections -fdata-sections -g0 '-march=native' -g0 -DFARMHASH_NO_CXX_STRING -Wno-sign-compare '-Wno-error=reorder' -c tensorflow/lite/kernels/depthwise_conv.cc -o bazel-out/host/bin/tensorflow/lite/kernels/_objs/builtin_op_kernels/depthwise_conv.pic.o)
Execution platform: @bazel_tools//platforms:host_platform
In file included from ./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8.h:23:0,
                 from ./tensorflow/lite/kernels/internal/optimized/depthwiseconv_multithread.h:21,
                 from tensorflow/lite/kernels/depthwise_conv.cc:28:
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h: In static member function 'static void tflite::optimized_ops::depthwise_conv::PackMacroBlock<(tflite::DepthwiseConvImplementation)3, (tflite::DepthwiseConvDepthMultiplication)0, 0>::PackMacroBlockNeon(const uint8*, int8*, const tflite::optimized_ops::depthwise_conv::DepthwiseConvDotProdParams*)':
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:5981:24: note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts
           input_data_a = vld1q_u8(input_data_0);
                        ^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:5981:24: error: cannot convert 'uint8x16_t {aka __vector(16) unsigned char}' to 'int8x16_t {aka __vector(16) signed char}' in assignment
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:5982:24: error: cannot convert 'uint8x16_t {aka __vector(16) unsigned char}' to 'int8x16_t {aka __vector(16) signed char}' in assignment
           input_data_b = vld1q_u8(input_data_0 + 1 * input_depth);
                        ^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:5983:24: error: cannot convert 'uint8x16_t {aka __vector(16) unsigned char}' to 'int8x16_t {aka __vector(16) signed char}' in assignment
           input_data_c = vld1q_u8(input_data_0 + 2 * input_depth);
                        ^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:5984:24: error: cannot convert 'uint8x16_t {aka __vector(16) unsigned char}' to 'int8x16_t {aka __vector(16) signed char}' in assignment
           input_data_d = vld1q_u8(input_data_0 + 3 * input_depth);
                        ^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:5993:55: error: cannot convert 'const uint8x16_t {aka const __vector(16) unsigned char}' to 'int8x16_t {aka __vector(16) signed char}' for argument '2' to 'int8x16_t veorq_s8(int8x16_t, int8x16_t)'
             work_reg_a = veorq_s8(work_reg_a, sign_bit);
                                                       ^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:5994:55: error: cannot convert 'const uint8x16_t {aka const __vector(16) unsigned char}' to 'int8x16_t {aka __vector(16) signed char}' for argument '2' to 'int8x16_t veorq_s8(int8x16_t, int8x16_t)'
             work_reg_b = veorq_s8(work_reg_b, sign_bit);
                                                       ^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:6000:26: error: cannot convert 'uint8x16_t {aka __vector(16) unsigned char}' to 'int8x16_t {aka __vector(16) signed char}' in assignment
             input_data_a = vld1q_u8(input_data_0);

这是什么问题?等待4个小时,看到它在同一时间点爆炸,真令人沮丧。我也在tensorflow / lite / tools / make / targets / aarch64_makefile.inc文件中使用-flax-vector-conversions -fomit-frame-pointer标志,但这不能解决问题。我想念什么?

0 个答案:

没有答案