Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build libtensorflowlite.so with TensorFlow ops supported for armdf? #48401

Closed
zhangguanqun opened this issue Apr 8, 2021 · 27 comments
Closed
Assignees
Labels
comp:lite TF Lite related issues subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues type:build/install Build and install issues

Comments

@zhangguanqun
Copy link

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: No
  • TensorFlow installed from (source or binary): source
  • TensorFlow version: tf-nightly
  • Python version: 3.6.9
  • Installed using virtualenv? pip? conda?: virtualenv
  • Bazel version (if compiling from source): 3.7.2
  • GCC/Compiler version (if compiling from source): 7.5
  • CUDA/cuDNN version: 10.2
  • GPU model and memory: GTX 1070ti

Describe the problem
I need Tensorflow OPS to run tflite model inference in C++.
But how to build libtensorflowlite.so (for armdf) with TensorFlow ops ?
In document, it mentioned:
Add the TensorFlow ops delegate library dependency to the build dependencies: tensorflow/lite/delegates/flex:delegate
So how to do this?
Modify BUILD file in directory tensorflow_src/tensorflow/lite/ ?

Provide the exact sequence of commands / steps that you executed before running into the problem

Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

@zhangguanqun zhangguanqun added the type:build/install Build and install issues label Apr 8, 2021
@UsharaniPagadala UsharaniPagadala added comp:ops OPs related issues TFLiteConverter For issues related to TFLite converter labels Apr 8, 2021
@abattery abattery added comp:lite TF Lite related issues and removed TFLiteConverter For issues related to TFLite converter comp:ops OPs related issues labels Apr 8, 2021
@abattery
Copy link
Contributor

abattery commented Apr 8, 2021

@thaink could you take a look?

@zhangguanqun
Copy link
Author

Actually, what I need is a C++ library that support interpreting TF ops as libtensorflowlite_flex_jni.so did on Android.

@thaink
Copy link
Member

thaink commented Apr 9, 2021

@zhangguanqun if you use the jni how about building tensorflow-lite.aar and tensorflow-lite-select-tf-ops.aar?

@zhangguanqun
Copy link
Author

@thaink I did build tensorflow-lite.aar, and it works fine on my Android app.
Now I want to run my TFLite model on Raspberry Pi using pure C++ interface.

@thaink
Copy link
Member

thaink commented Apr 9, 2021

You can add "tensorflow/lite/delegates/flex:delegate" to the deps field of the rule "tensorflowlite" in tensorflow/lite/BUILD

@zhangguanqun
Copy link
Author

@thaink Thank u, I will try it.

@zhangguanqun
Copy link
Author

zhangguanqun commented Apr 9, 2021

@thaink @abattery
Build report following errors:
no such package '@local_cuda//': The repository '@local_cuda' could not be resolved and referenced by '@cub_archive//:cub'

Here is my building command:
bazel build --config=elinux_armhf -c opt //tensorflow/lite:libtensorflowlite.so

From errors above, it means that directory "local_cuda" is referenced by target "cub", but it is not found.
In file bazel-tensorflow-src/external/cub_archive/BUILD.bazel, there is:

cc_library(
    name = "cub",
    hdrs = glob(["cub/**"]),
    deps = ["@local_cuda//:cuda_headers"],
)

But the dependency dir "local_cuda" dose not exist in bazel-tensorflow-src/external/, that's why the error occurs.
In bazel-tensorflow-src/external/, there is a directory called "local_config_cuda", and I find the build target "cuda_headers" in local_config_cuda/cuda/BUILD. So is the deps wrong in "/tensorflow_src/third_party/cub.BUILD" ? Maybe deps should be "@local_config_cuda//cuda:cuda_headers"?

@zhangguanqun
Copy link
Author

zhangguanqun commented Apr 12, 2021

After change deps from ["@local_cuda//:cuda_headers"] to ["@local_config_cuda//cuda:cuda_headers"] in file bazel-tensorflow-src/external/cub_archive/BUILD.bazel, I got the following errors:

ERROR: /home/zhangguanqun/tensorflow-master/tensorflow/core/kernels/BUILD:4919:18: C++ compilation of rule '//tensorflow/core/kernels:scatter_op_gpu' failed (Exit 1): aarch64-linux-gnu-gcc failed: error executing command /home/zhangguanqun/.cache/bazel/_bazel_zhangguanqun/9a90fa5c1777f045d849f4cfb9aa189a/external/aarch64_linux_toolchain/bin/aarch64-linux-gnu-gcc -fstack-protector -g0 -O2 -DNDEBUG -ffunction-sections ... (remaining 141 argument(s) skipped)
aarch64-linux-gnu-gcc: error: unrecognized command line option '-Xcuda-fatbinary=--compress-all'
aarch64-linux-gnu-gcc: error: unrecognized command line option '--no-cuda-include-ptx=all'; did you mean '--no-chkp-instrument-calls'?
aarch64-linux-gnu-gcc: error: unrecognized command line option '--cuda-include-ptx=sm_61'
aarch64-linux-gnu-gcc: error: unrecognized command line option '--cuda-gpu-arch=sm_61'
aarch64-linux-gnu-gcc: error: unrecognized command line option '-nvcc_options=relaxed-constexpr'
aarch64-linux-gnu-gcc: error: unrecognized command line option '-nvcc_options=ftz=true'
Target //tensorflow/lite:libtensorflowlite.so failed to build

Tensorflow source version: 2.5.0-dev20210210
CUDA version: 10.2
What should I do?
@thaink @abattery

@thaink
Copy link
Member

thaink commented Apr 12, 2021

@zhangguanqun What platform are you building on? I am not sure about this error, too.

@zhangguanqun
Copy link
Author

@thaink
Ubuntu 18.04 Desktop

@thaink
Copy link
Member

thaink commented Apr 12, 2021

Did you run ./configure?

@zhangguanqun
Copy link
Author

@thaink
Yes, I have already successfully build tensorflow-lite.aar with the same TF source and the AAR file is works fine on my Android App.

@zhangguanqun
Copy link
Author

Or, can I build libtensorflowlite.so without CUDA?
It seems like all errors are related to CUDA.

@thaink
Copy link
Member

thaink commented Apr 12, 2021

Right. cub_archive is only pulled in if if_cuda is true.
So it should not be included here.
Could you double check and share the content of .tf_configure.bazelrc file?

@thaink
Copy link
Member

thaink commented Apr 12, 2021

does adding --config=monolithic help?

@zhangguanqun
Copy link
Author

@thaink
Do you mean run ./configure and set with CUDA=False?
I run configure file with CUDA setting true, here is my .tf_configure.bazelrc file:

build --action_env PYTHON_BIN_PATH="/home/zhangguanqun/anaconda3/bin/python3"
build --action_env PYTHON_LIB_PATH="/home/zhangguanqun/anaconda3/lib/python3.8/site-packages"
build --python_path="/home/zhangguanqun/anaconda3/bin/python3"
build --action_env CUDA_TOOLKIT_PATH="/usr/local/cuda-10.2"
build --action_env TF_CUDA_COMPUTE_CAPABILITIES="6.1"
build --action_env LD_LIBRARY_PATH="/usr/local/cuda-10.2/lib64:/usr/lib/x86_64-linux-gnu/"
build --action_env GCC_HOST_COMPILER_PATH="/usr/bin/x86_64-linux-gnu-gcc-7"
build --config=cuda
build:opt --copt=-Wno-sign-compare
build:opt --host_copt=-Wno-sign-compare
build --action_env ANDROID_NDK_HOME="/home/zhangguanqun/Android/android-ndk-r21b"
build --action_env ANDROID_NDK_API_LEVEL="21"
build --action_env ANDROID_BUILD_TOOLS_VERSION="30.0.3"
build --action_env ANDROID_SDK_API_LEVEL="30"
build --action_env ANDROID_SDK_HOME="/home/zhangguanqun/Android/Sdk"
test --flaky_test_attempts=3
test --test_size_filters=small,medium
test --test_env=LD_LIBRARY_PATH
test:v1 --test_tag_filters=-benchmark-test,-no_oss,-no_gpu,-oss_serial
test:v1 --build_tag_filters=-benchmark-test,-no_oss,-no_gpu
test:v2 --test_tag_filters=-benchmark-test,-no_oss,-no_gpu,-oss_serial,-v1only
test:v2 --build_tag_filters=-benchmark-test,-no_oss,-no_gpu,-v1only

Should I configure CUDA = false?

@zhangguanqun
Copy link
Author

Adding --config=monolithic does not help.

@zhangguanqun
Copy link
Author

zhangguanqun commented Apr 12, 2021

@thaink
UPDATE:
If I set with CUDA to False in runing configure file, .tf_configure.bazelrc file change to

build --action_env PYTHON_BIN_PATH="/usr/bin/python3"
build --action_env PYTHON_LIB_PATH="/usr/lib/python3.6/dist-packages"
build --python_path="/usr/bin/python3"
build:opt --copt=-Wno-sign-compare
build:opt --host_copt=-Wno-sign-compare
build --action_env ANDROID_NDK_HOME="/home/zhangguanqun/Android/android-ndk-r21b"
build --action_env ANDROID_NDK_API_LEVEL="21"
build --action_env ANDROID_BUILD_TOOLS_VERSION="30.0.3"
build --action_env ANDROID_SDK_API_LEVEL="30"
build --action_env ANDROID_SDK_HOME="/home/zhangguanqun/Android/Sdk"
test --flaky_test_attempts=3
test --test_size_filters=small,medium
test:v1 --test_tag_filters=-benchmark-test,-no_oss,-gpu,-oss_serial
test:v1 --build_tag_filters=-benchmark-test,-no_oss,-gpu
test:v2 --test_tag_filters=-benchmark-test,-no_oss,-gpu,-oss_serial,-v1only
test:v2 --build_tag_filters=-benchmark-test,-no_oss,-gpu,-v1only

Than I try to rebuild libtensorflowlite.so with the same command, but got some errors with OPEN-SSL :(

ERROR: /home/zhangguanqun/.cache/bazel/_bazel_zhangguanqun/9a90fa5c1777f045d849f4cfb9aa189a/external/com_github_grpc_grpc/BUILD:1659:16: C++ compilation of rule '@com_github_grpc_grpc//:grpc_secure' failed (Exit 1): arm-linux-gnueabihf-gcc failed: error executing command /home/zhangguanqun/.cache/bazel/_bazel_zhangguanqun/9a90fa5c1777f045d849f4cfb9aa189a/external/armhf_linux_toolchain/bin/arm-linux-gnueabihf-gcc -fstack-protector -g0 -O2 -DNDEBUG -ffunction-sections ... (remaining 68 argument(s) skipped)
In file included from /usr/include/openssl/evp.h:16,
                 from /usr/include/openssl/x509.h:18,
                 from external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.h:28,
                 from external/com_github_grpc_grpc/src/core/lib/security/security_connector/security_connector.h:33,
                 from external/com_github_grpc_grpc/src/core/lib/security/credentials/credentials.h:35,
                 from external/com_github_grpc_grpc/src/core/lib/http/httpcli_security_connector.cc:35:
/usr/include/openssl/bio.h:690:1: error: expected constructor, destructor, or type conversion before 'DEPRECATEDIN_1_1_0'
 DEPRECATEDIN_1_1_0(int BIO_get_port(const char *str, unsigned short *port_ptr))
 ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/asn1.h:23,
                 from /usr/include/openssl/objects.h:15,
                 from /usr/include/openssl/evp.h:28,
                 from /usr/include/openssl/x509.h:18,
                 from external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.h:28,
                 from external/com_github_grpc_grpc/src/core/lib/security/security_connector/security_connector.h:33,
                 from external/com_github_grpc_grpc/src/core/lib/security/credentials/credentials.h:35,
                 from external/com_github_grpc_grpc/src/core/lib/http/httpcli_security_connector.cc:35:
/usr/include/openssl/bn.h:183:43: error: 'BN_ULONG' does not name a type; did you mean 'SHA_LONG'?
 int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w);
                                           ^~~~~~~~
                                           SHA_LONG
/usr/include/openssl/bn.h:186:39: error: 'BN_ULONG' does not name a type; did you mean 'SHA_LONG'?
 int BN_is_word(const BIGNUM *a, const BN_ULONG w);
                                       ^~~~~~~~
                                       SHA_LONG
/usr/include/openssl/bn.h:214:22: error: 'BN_ULONG' was not declared in this scope
 int BN_num_bits_word(BN_ULONG l);
                      ^~~~~~~~
/usr/include/openssl/bn.h:214:22: note: suggested alternative: 'SHA_LONG'
 int BN_num_bits_word(BN_ULONG l);
                      ^~~~~~~~
                      SHA_LONG
/usr/include/openssl/bn.h:266:1: error: 'BN_ULONG' does not name a type; did you mean 'SHA_LONG'?
 BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
 ^~~~~~~~
 SHA_LONG
/usr/include/openssl/bn.h:267:1: error: 'BN_ULONG' does not name a type; did you mean 'SHA_LONG'?
 BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
 ^~~~~~~~
 SHA_LONG
/usr/include/openssl/bn.h:268:28: error: 'BN_ULONG' has not been declared
 int BN_mul_word(BIGNUM *a, BN_ULONG w);
                            ^~~~~~~~
/usr/include/openssl/bn.h:269:28: error: 'BN_ULONG' has not been declared
 int BN_add_word(BIGNUM *a, BN_ULONG w);
                            ^~~~~~~~
/usr/include/openssl/bn.h:270:28: error: 'BN_ULONG' has not been declared
 int BN_sub_word(BIGNUM *a, BN_ULONG w);
                            ^~~~~~~~
/usr/include/openssl/bn.h:271:28: error: 'BN_ULONG' has not been declared
 int BN_set_word(BIGNUM *a, BN_ULONG w);
                            ^~~~~~~~
/usr/include/openssl/bn.h:272:1: error: 'BN_ULONG' does not name a type; did you mean 'SHA_LONG'?
 BN_ULONG BN_get_word(const BIGNUM *a);
 ^~~~~~~~
 SHA_LONG
/usr/include/openssl/bn.h:288:37: error: 'BN_ULONG' has not been declared
 int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
                                     ^~~~~~~~
/usr/include/openssl/bn.h:323:24: error: variable or field 'BN_consttime_swap' declared void
 void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
                        ^~~~~~~~
/usr/include/openssl/bn.h:323:24: error: 'BN_ULONG' was not declared in this scope
/usr/include/openssl/bn.h:323:24: note: suggested alternative: 'SHA_LONG'
 void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
                        ^~~~~~~~
                        SHA_LONG
/usr/include/openssl/bn.h:323:46: error: expected primary-expression before '*' token
 void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
                                              ^
/usr/include/openssl/bn.h:323:47: error: 'a' was not declared in this scope
 void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
                                               ^
/usr/include/openssl/bn.h:323:57: error: expected primary-expression before '*' token
 void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
                                                         ^
/usr/include/openssl/bn.h:323:58: error: 'b' was not declared in this scope
 void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
                                                          ^
/usr/include/openssl/bn.h:323:61: error: expected primary-expression before 'int'
 void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
                                                             ^~~
/usr/include/openssl/bn.h:332:1: error: expected constructor, destructor, or type conversion before 'DEPRECATEDIN_0_9_8'
 DEPRECATEDIN_0_9_8(int
 ^~~~~~~~~~~~~~~~~~
/usr/include/openssl/bn.h:403:1: error: expected constructor, destructor, or type conversion before 'DEPRECATEDIN_0_9_8'
 DEPRECATEDIN_0_9_8(int BN_get_params(int which)) /* 0, mul, 1 high, 2 low, 3
 ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/objects.h:15,
                 from /usr/include/openssl/evp.h:28,
                 from /usr/include/openssl/x509.h:18,
                 from external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.h:28,
                 from external/com_github_grpc_grpc/src/core/lib/security/security_connector/security_connector.h:33,
                 from external/com_github_grpc_grpc/src/core/lib/security/credentials/credentials.h:35,
                 from external/com_github_grpc_grpc/src/core/lib/http/httpcli_security_connector.cc:35:
/usr/include/openssl/asn1.h:555:7: error: expected constructor, destructor, or type conversion before 'unsigned'
 const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x);
       ^~~~~~~~
In file included from /usr/include/openssl/x509.h:22,
                 from external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.h:28,
                 from external/com_github_grpc_grpc/src/core/lib/security/security_connector/security_connector.h:33,
                 from external/com_github_grpc_grpc/src/core/lib/security/credentials/credentials.h:35,
                 from external/com_github_grpc_grpc/src/core/lib/http/httpcli_security_connector.cc:35:
/usr/include/openssl/ec.h:274:1: error: expected constructor, destructor, or type conversion before 'DEPRECATEDIN_1_2_0'
 DEPRECATEDIN_1_2_0(int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p,
 ^~~~~~~~~~~~~~~~~~
/usr/include/openssl/ec.h:543:1: error: expected constructor, destructor, or type conversion before 'DEPRECATEDIN_1_2_0'
 DEPRECATEDIN_1_2_0(int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
 ^~~~~~~~~~~~~~~~~~
/usr/include/openssl/ec.h:631:1: error: expected constructor, destructor, or type conversion before 'size_t'
 size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p,
 ^~~~~~
In file included from /usr/include/openssl/x509.h:25,
                 from external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.h:28,
                 from external/com_github_grpc_grpc/src/core/lib/security/security_connector/security_connector.h:33,
                 from external/com_github_grpc_grpc/src/core/lib/security/credentials/credentials.h:35,
                 from external/com_github_grpc_grpc/src/core/lib/http/httpcli_security_connector.cc:35:
/usr/include/openssl/rsa.h:239:1: error: expected constructor, destructor, or type conversion before 'int'
 int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
 ^~~
In file included from /usr/include/openssl/dsa.h:25,
                 from /usr/include/openssl/x509.h:26,
                 from external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.h:28,
                 from external/com_github_grpc_grpc/src/core/lib/security/security_connector/security_connector.h:33,
                 from external/com_github_grpc_grpc/src/core/lib/security/credentials/credentials.h:35,
                 from external/com_github_grpc_grpc/src/core/lib/http/httpcli_security_connector.cc:35:
/usr/include/openssl/dh.h:142:1: error: expected constructor, destructor, or type conversion before 'int'
 int DH_generate_parameters_ex(DH *dh, int prime_len, int generator,
 ^~~
In file included from /usr/include/openssl/x509.h:26,
                 from external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.h:28,
                 from external/com_github_grpc_grpc/src/core/lib/security/security_connector/security_connector.h:33,
                 from external/com_github_grpc_grpc/src/core/lib/security/credentials/credentials.h:35,
                 from external/com_github_grpc_grpc/src/core/lib/http/httpcli_security_connector.cc:35:
/usr/include/openssl/dsa.h:103:1: error: expected constructor, destructor, or type conversion before 'int'
 int DSA_sign(int type, const unsigned char *dgst, int dlen,
 ^~~
/usr/include/openssl/dsa.h:127:1: error: expected constructor, destructor, or type conversion before 'int'
 int DSA_generate_parameters_ex(DSA *dsa, int bits,
 ^~~
In file included from external/com_github_grpc_grpc/src/core/tsi/ssl_transport_security.h:28,
                 from external/com_github_grpc_grpc/src/core/lib/security/security_connector/security_connector.h:33,
                 from external/com_github_grpc_grpc/src/core/lib/security/credentials/credentials.h:35,
                 from external/com_github_grpc_grpc/src/core/lib/http/httpcli_security_connector.cc:35:
/usr/include/openssl/x509.h:728:1: error: expected constructor, destructor, or type conversion before 'DEPRECATEDIN_1_1_0'
 DEPRECATEDIN_1_1_0(ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl))
 ^~~~~~~~~~~~~~~~~~
Target //tensorflow/lite:libtensorflowlite.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 724.445s, Critical Path: 115.39s
INFO: 3503 processes: 148 internal, 3355 local.
FAILED: Build did NOT complete successfully

My OpenSSL version is: 1.1.1 11 Sep 2018

@UsharaniPagadala UsharaniPagadala added the subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues label Apr 12, 2021
@thaink
Copy link
Member

thaink commented Apr 13, 2021

right. cuda should be config to no.
I am was able to reproduce a similar build error, let me check.

@zhangguanqun
Copy link
Author

@thaink 🙏
Maybe I should downgrade openssl.

@terryheo
Copy link
Member

I hope this is helpful.

  1. According to https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/tools/pip_package/build_pip_package_with_bazel.sh#L39
    you need to hide the system openssl. And you also need to modify /usr/include/curl/curlbuild.h

  2. "--config=monolithic --config=noaws --config=nogcp --config=nohdfs --config=nonccl" is required for Flex build.

  3. To avoid Add support for Python 3.x #1, it's better to use container build tool "tensorflow/tools/ci_build/ci_build.sh" and create your own build script.

@zhangguanqun
Copy link
Author

@terryheo Thanks, advice 1st did help, errors about openssl did not exist, but, at the end of building, linking error reported:

ERROR: /home/zhangguanqun/tensorflow-master/tensorflow/lite/BUILD:887:24: Linking of rule '//tensorflow/lite:libtensorflowlite.so' failed (Exit 1): arm-linux-gnueabihf-gcc failed: error executing command /home/zhangguanqun/.cache/bazel/_bazel_zhangguanqun/9a90fa5c1777f045d849f4cfb9aa189a/external/armhf_linux_toolchain/bin/arm-linux-gnueabihf-gcc ... (remaining 1 argument(s) skipped)
stderr (/home/zhangguanqun/.cache/bazel/_bazel_zhangguanqun/9a90fa5c1777f045d849f4cfb9aa189a/execroot/org_tensorflow/bazel-out/_tmp/actions/stderr-7638) exceeds maximum size of --experimental_ui_max_stdouterr_bytes=1048576 bytes; skipping
Target //tensorflow/lite:libtensorflowlite.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2182.429s, Critical Path: 474.31s
INFO: 4542 processes: 493 internal, 4049 local.
FAILED: Build did NOT complete successfully

@thaink
Copy link
Member

thaink commented Apr 13, 2021

How about increase the value of --experimental_ui_max_stdouterr_bytes?

@zhangguanqun
Copy link
Author

@thaink
Yes, I have increated max_stdouterr_bytes to 1073741819, and rebuilding is doing now, this may take several tens of minutes.

@zhangguanqun
Copy link
Author

Finally made it !
Thanks to @abattery @terryheo @thaink, Appreciate.

Cmd that successfully build libtensorflowlite.so:
bazel build --config=monolithic --config=noaws --config=nogcp --config=nohdfs --config=nonccl --config=elinux_armhf --experimental_ui_max_stdouterr_bytes=1073741819 -c opt //tensorflow/lite:libtensorflowlite.so

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@520jefferson
Copy link

520jefferson commented Jan 24, 2022

@zhangguanqun how did you solve the problem below?
" The repository '@local_cuda' could not be resolved and referenced by '@cub_archive//:cub' "
if i comment out the cuda, is it right when i start the model?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:lite TF Lite related issues subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

7 participants