Wind-River / meta-tensorflow

Other
13 stars 18 forks source link

tensorflow 2.4 on armv7 does not build #11

Open RobertBerger opened 3 years ago

RobertBerger commented 3 years ago

After building a couple of hours I get this error on arm32.

It builds on x86-64.

Linking of rule '//tensorflow/lite/examples/label_image:label_image' failed (Exit 1): arm-resy-linux-gnueabi-gcc failed: error executing command 
  /workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/external/yocto_compiler/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi/arm-resy-linux-gnueabi-ar @bazel-out/arm-opt/bin/tensorflow/lite/tools/delegates/libnnapi_delegate_provider.lo-2.params) 
SUBCOMMAND: # //tensorflow/lite/examples/label_image:label_image [action 'Linking tensorflow/lite/examples/label_image/label_image', configuration: fe514663a42db0ce8ce2e417bb1bd7373bcf85317a2e2587c9e7bf739b053306, execution platform: @local_execution_config_platform//:platform] 
(cd /workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/execroot/org_tensorflow && \ 
  exec env - \ 
    PATH=/workdir/build/container-arm-v7-tensorflow-master/tmp/sysroots-uninative/x86_64-linux/usr/bin:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/usr/bin/python3-native:/workdir/sources/poky-master/scripts:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot/usr/bin/crossscripts:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/usr/sbin:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/usr/bin:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/sbin:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/bin:/workdir/sources/poky-master/bitbake/bin:/workdir/build/container-arm-v7-tensorflow-master/tmp/hosttools \ 
    PWD=/proc/self/cwd \ 
    PYTHON_BIN_PATH=/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3 \ 
    PYTHON_LIB_PATH=/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/usr/lib/python3.9/site-packages \ 
    TF2_BEHAVIOR=1 \ 
    TF_CONFIGURE_IOS=0 \ 
  /workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/external/yocto_compiler/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi/arm-resy-linux-gnueabi-gcc @bazel-out/arm-opt/bin/tensorflow/lite/examples/label_image/label_image-2.params) 
ERROR: /workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/git/tensorflow/lite/examples/label_image/BUILD:15:10: Linking of rule '//tensorflow/lite/examples/label_image:label_image' failed (Exit 1): arm-resy-linux-gnueabi-gcc failed: error executing command  
  (cd /workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/execroot/org_tensorflow && \ 
  exec env - \ 
    PATH=/workdir/build/container-arm-v7-tensorflow-master/tmp/sysroots-uninative/x86_64-linux/usr/bin:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/usr/bin/python3-native:/workdir/sources/poky-master/scripts:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot/usr/bin/crossscripts:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/usr/sbin:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/usr/bin:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/sbin:/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/bin:/workdir/sources/poky-master/bitbake/bin:/workdir/build/container-arm-v7-tensorflow-master/tmp/hosttools \ 
    PWD=/proc/self/cwd \ 
    PYTHON_BIN_PATH=/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3 \ 
    PYTHON_LIB_PATH=/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/recipe-sysroot-native/usr/lib/python3.9/site-packages \ 
    TF2_BEHAVIOR=1 \ 
    TF_CONFIGURE_IOS=0 \ 
/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/external/yocto_compiler/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi/../../libexec/arm-resy-linux-gnueabi/gcc/arm-resy-linux-gnueabi/10.2.0/ld: neon_tensor_utils.cc:(.text._ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii[_ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii]+0x2fe): undefined reference to `ruy::Pack8bitColMajorForNeonOutOfOrder4Cols(ruy::PackParams8bit const&)' 
/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/external/yocto_compiler/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi/../../libexec/arm-resy-linux-gnueabi/gcc/arm-resy-linux-gnueabi/10.2.0/ld: neon_tensor_utils.cc:(.text._ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii[_ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii]+0x384): undefined reference to `ruy::Pack8bitColMajorForNeonOutOfOrder4Cols(ruy::PackParams8bit const&)' 
collect2: error: ld returned 1 exit status 
INFO: Elapsed time: 22848.401s, Critical Path: 3315.50s 
INFO: 23289 processes: 2757 internal, 20532 local. 
FAILED: Build did NOT complete successfully 
FAILED: Build did NOT complete successfully 
WARNING: /workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/temp/run.do_compile.28847:162 exit 1 from '/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/bazel build --config=v2 -c opt --cpu=arm --subcommands --explain=/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/temp/explain.log --verbose_explanations --verbose_failures --crosstool_top=@local_config_yocto_compiler//:toolchain --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --verbose_failures --copt -DTF_LITE_DISABLE_X86_NEON //tensorflow:libtensorflow.so //tensorflow:libtensorflow_cc.so //tensorflow:libtensorflow_framework.so //tensorflow/tools/benchmark:benchmark_model //tensorflow/tools/pip_package:build_pip_package tensorflow/examples/label_image/... //tensorflow/lite/examples/label_image:label_image' 
WARNING: Backtrace (BB generated script):  
        #1: do_compile, /workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/temp/run.do_compile.28847, line 162 
        #2: main, /workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/temp/run.do_compile.28847, line 323 

Backtrace (metadata-relative locations): 
        #1: do_compile, /workdir/sources/poky-master/../meta-tensorflow-master/recipes-framework/tensorflow/tensorflow_2.4.0.bb, line 94 

Is there any easy way to skip this test case?

RobertBerger commented 3 years ago

I think this problem is caused by undefined references:

cat log.do_compile | grep "undefined reference"
neon_tensor_utils.cc:(.text._ZN3ruy9RunKernelINS_6KernelILNS_4PathE16EaaiiEEE3RunENS_6TuningERKNS_8SidePairINS_5PEMatEEEPKvRKNS6_IiEESF_PNS_4EMatE[_ZN3ruy9RunKernelINS_6KernelILNS_4PathE16EaaiiEEE3RunENS_6TuningERKNS_8SidePairINS_5PEMatEEEPKvRKNS6_IiEESF_PNS_4EMatE]+0x152): undefined reference to `ruy::Kernel8bitNeonOutOfOrder(ruy::KernelParams8bit<4, 2> const&)'
/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/external/yocto_compiler/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi/../../libexec/arm-resy-linux-gnueabi/gcc/arm-resy-linux-gnueabi/10.2.0/ld: neon_tensor_utils.cc:(.text._ZN3ruy9RunKernelINS_6KernelILNS_4PathE16EaaiiEEE3RunENS_6TuningERKNS_8SidePairINS_5PEMatEEEPKvRKNS6_IiEESF_PNS_4EMatE[_ZN3ruy9RunKernelINS_6KernelILNS_4PathE16EaaiiEEE3RunENS_6TuningERKNS_8SidePairINS_5PEMatEEEPKvRKNS6_IiEESF_PNS_4EMatE]+0x19e): undefined reference to `ruy::Kernel8bitNeonOutOfOrder1Col(ruy::KernelParams8bit<4, 2> const&)'
neon_tensor_utils.cc:(.text._ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi2EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii[_ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi2EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii]+0xe8): undefined reference to `ruy::Pack8bitColMajorForNeonOutOfOrder2Cols(ruy::PackParams8bit const&)'
/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/external/yocto_compiler/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi/../../libexec/arm-resy-linux-gnueabi/gcc/arm-resy-linux-gnueabi/10.2.0/ld: neon_tensor_utils.cc:(.text._ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi2EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii[_ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi2EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii]+0x184): undefined reference to `ruy::Pack8bitRowMajorForNeon(unsigned char const*, int, int, int, int, int, int, signed char*, int, int, int*, int, int)'
/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/external/yocto_compiler/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi/../../libexec/arm-resy-linux-gnueabi/gcc/arm-resy-linux-gnueabi/10.2.0/ld: neon_tensor_utils.cc:(.text._ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi2EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii[_ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi2EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii]+0x200): undefined reference to `ruy::Pack8bitColMajorForNeonOutOfOrder2Cols(ruy::PackParams8bit const&)'
/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/external/yocto_compiler/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi/../../libexec/arm-resy-linux-gnueabi/gcc/arm-resy-linux-gnueabi/10.2.0/ld: neon_tensor_utils.cc:(.text._ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi2EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii[_ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi2EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii]+0x296): undefined reference to `ruy::Pack8bitColMajorForNeonOutOfOrder2Cols(ruy::PackParams8bit const&)'
/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/external/yocto_compiler/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi/../../libexec/arm-resy-linux-gnueabi/gcc/arm-resy-linux-gnueabi/10.2.0/ld: neon_tensor_utils.cc:(.text._ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi2EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii[_ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi2EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii]+0x30e): undefined reference to `ruy::Pack8bitColMajorForNeonOutOfOrder2Cols(ruy::PackParams8bit const&)'
neon_tensor_utils.cc:(.text._ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii[_ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii]+0x114): undefined reference to `ruy::Pack8bitColMajorForNeonOutOfOrder4Cols(ruy::PackParams8bit const&)'
/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/external/yocto_compiler/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi/../../libexec/arm-resy-linux-gnueabi/gcc/arm-resy-linux-gnueabi/10.2.0/ld: neon_tensor_utils.cc:(.text._ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii[_ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii]+0x1b0): undefined reference to `ruy::Pack8bitRowMajorForNeon(unsigned char const*, int, int, int, int, int, int, signed char*, int, int, int*, int, int)'
/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/external/yocto_compiler/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi/../../libexec/arm-resy-linux-gnueabi/gcc/arm-resy-linux-gnueabi/10.2.0/ld: neon_tensor_utils.cc:(.text._ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii[_ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii]+0x240): undefined reference to `ruy::Pack8bitColMajorForNeonOutOfOrder4Cols(ruy::PackParams8bit const&)'
/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/external/yocto_compiler/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi/../../libexec/arm-resy-linux-gnueabi/gcc/arm-resy-linux-gnueabi/10.2.0/ld: neon_tensor_utils.cc:(.text._ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii[_ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii]+0x2fe): undefined reference to `ruy::Pack8bitColMajorForNeonOutOfOrder4Cols(ruy::PackParams8bit const&)'
/workdir/build/container-arm-v7-tensorflow-master/tmp/work/armv7at2hf-vfp-resy-linux-gnueabi/tensorflow/2.4.0-r0/bazel/output_base/external/yocto_compiler/recipe-sysroot-native/usr/bin/arm-resy-linux-gnueabi/../../libexec/arm-resy-linux-gnueabi/gcc/arm-resy-linux-gnueabi/10.2.0/ld: neon_tensor_utils.cc:(.text._ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii[_ZN3ruy7RunPackILNS_4PathE16ENS_17FixedKernelLayoutILNS_5OrderE0ELi16ELi4EEEaaEEvNS_6TuningERKNS_4EMatEPNS_5PEMatEii]+0x384): undefined reference to `ruy::Pack8bitColMajorForNeonOutOfOrder4Cols(ruy::PackParams8bit const&)'
RobertBerger commented 3 years ago

This seems similar: https://github.com/tensorflow/tensorflow/issues/42471

RobertBerger commented 3 years ago

tensorflow built:

ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[md5/uuid]=41b6bb33e0bef6b0ed2b57be3dbb6023, not stripped

native arm32 built:

ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=c9bb39f30d4c3ac80d74c461452c9147b0c15ffc, for GNU/Linux 3.2.0, stripped
RobertBerger commented 3 years ago

aarch64 seems to build