Vx delegate issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vx delegate issue

417 Views
Mohan51
Contributor II

Hi, I want to build ML models to GPU. for that I am trying to build Vx delegate by following the document(https://www.nxp.com/docs/en/user-guide/IMX-MACHINE-LEARNING-UG.pdf). but facing aarch64 errors.I will paste the error below..please provide any updated document for IMX-MACHINE-LEARNING-UG.it will help for us to build the Vx delegate.and I am using Linux and I am using IMX8M nano board

 

 

Error:

ERROR: /tensorflow/docker-build/external/png/BUILD.bazel:8:11: Compiling pngrtran.c failed: (Exit 1): aarch64-none-linux-gnu-gcc failed: error executing command 
  (cd /tensorflow/docker-build/execroot/org_tensorflow && \
  exec env - \
    PATH=/root/.cache/bazelisk/downloads/bazelbuild/bazel-5.3.0-linux-x86_64/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/dist-packages \
    TF2_BEHAVIOR=1 \
  /tensorflow/docker-build/external/aarch64_linux_toolchain/bin/aarch64-none-linux-gnu-gcc -fstack-protector -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -MD -MF bazel-out/aarch64-opt/bin/external/png/_objs/png/pngrtran.d '-frandom-seed=bazel-out/aarch64-opt/bin/external/png/_objs/png/pngrtran.o' -iquote external/png -iquote bazel-out/aarch64-opt/bin/external/png -iquote external/zlib -iquote bazel-out/aarch64-opt/bin/external/zlib -isystem external/png -isystem bazel-out/aarch64-opt/bin/external/png -isystem external/zlib -isystem bazel-out/aarch64-opt/bin/external/zlib -Wno-all -Wno-extra -Wno-deprecated -Wno-deprecated-declarations -Wno-ignored-attributes -Wno-array-bounds -Wunused-result '-Werror=unused-result' -Wswitch '-Werror=switch' '-Wno-error=unused-but-set-variable' -DAUTOLOAD_DYNAMIC_KERNELS -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -no-canonical-prefixes -fno-canonical-system-headers -c external/png/pngrtran.c -o bazel-out/aarch64-opt/bin/external/png/_objs/png/pngrtran.o)
# Configuration: 485b9507bda8d2fa62e14239a83e554ed230487d471f3cb807f51d070873f3cc
# Execution platform: @local_execution_config_platform//:platform
external/png/pngrtran.c: In function 'convert_gamma_value':
external/png/pngrtran.c:275:4: internal compiler error: Illegal instruction
  275 |    output_gamma = floor(output_gamma + .5);
      |    ^~~~~~~~~~~~
0x1739600 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1], diagnostic_t)
  ???:0
0x173a286 internal_error(char const*, ...)
  ???:0
0xc26e2f crash_signal(int)
  ???:0
0x1946167 __gmpn_tdiv_qr
  ???:0
0x191a197 parsed_string_to_mpfr
  ???:0
0x191aa9a mpfr_strtofr
  ???:0
0xb924ac real_from_string(real_value*, char const*)
  ???:0
0xb92e8b real_from_string3(real_value*, char const*, format_helper)
  ???:0
0x781be6 interpret_float(cpp_token const*, unsigned int, char const*, overflow_type*)
  ???:0
0x782c07 c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int)
  ???:0
0x70b11e c_lex_one_token(c_parser*, c_token*, bool)
  ???:0
0x71b8bc c_parser_cast_expression(c_parser*, c_expr*)
  ???:0
0x71c366 c_parser_binary_expression(c_parser*, c_expr*, tree_node*)
  ???:0
0x71ce85 c_parser_conditional_expression(c_parser*, c_expr*, tree_node*)
  ???:0
0x71d484 c_parser_expr_no_commas(c_parser*, c_expr*, tree_node*)
  ???:0
0x71e043 c_parser_expr_list(c_parser*, bool, bool, vec<tree_node*, va_gc, vl_embed>**, unsigned int*, tree_node**, vec<unsigned int, va_heap, vl_ptr>*, unsigned int*)
  ???:0
0x71f42e c_parser_postfix_expression_after_primary(c_parser*, unsigned int, c_expr)
  ???:0
0x70eb9d c_parser_postfix_expression(c_parser*)
  ???:0
0x71a812 c_parser_unary_expression(c_parser*)
  ???:0
0x71b8e6 c_parser_cast_expression(c_parser*, c_expr*)
  ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.linaro.org/> for instructions.
Target //tensorflow/lite/delegates/flex/test:benchmark_model_plus_flex_full failed to build
INFO: Elapsed time: 0.547s, Critical Path: 0.13s
INFO: 10 processes: 10 internal.
FAILED: Build did NOT complete successfully

0 Kudos
7 Replies

305 Views
Mohan51
Contributor II

Always getting this error Compiling tensorflow/compiler/mlir/tensorflow/ir/tf_ops.cc [for host] failed: (Exit 1): gcc failed: error executing command..please help me.I am referring "https://www.nxp.com/docs/en/user-guide/IMX-MACHINE-LEARNING-UG.pdf" 2.6.2.3 step2 while using bazel

0 Kudos

305 Views
Mohan51
Contributor II

Hi @brian14  getting this error while building Vx delegate reduced flux-ERROR: /tensorflow/tensorflow/compiler/mlir/tensorflow/BUILD:593:11: Compiling tensorflow/compiler/mlir/tensorflow/ir/tf_ops.cc [for host] failed: (Exit 1): gcc failed: error executing command
(cd /tensorflow/docker-build/execroot/org_tensorflow && \
exec env - \
PATH=/root/.cache/bazelisk/downloads/bazelbuild/bazel-5.3.0-linux-x86_64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \

0 Kudos

331 Views
Mohan51
Contributor II

please someone could help me to findout a way for building Vx delegate..tried many ways but end up with this error

0 Kudos

388 Views
brian14
NXP TechSupport
NXP TechSupport

Hi @Mohan51

Thank you for contacting NXP Support.

Here is the latest manual from our website:
i.MX Machine Learning User's Guide (nxp.com)

Could you please point me to the chapter or section that you are following?

0 Kudos

367 Views
Mohan51
Contributor II

Hi @brian14  thank you for your reply. I got stuck while doing 2.6.2.3  in Page-9

Step2:"Build the benchmark_model_plus_flex target with a full TensorFlow Operator Set" .

Command: bazel --output_base=/tensorflow/docker-build/ build --config=monolithic
--config=elinux_aarch64 -c opt --cxxopt='--std=c++17' --
host_crosstool_top=@bazel_tools//tools/cpp:toolchain //tensorflow/lite/
delegates/flex/test:benchmark_model_plus_flex_full

 

I am getting error while doing this step.All the steps and configurations before this step is done successfully.I am posting the error again for your reference.

ERROR: /tensorflow/docker-build/external/png/BUILD.bazel:8:11: Compiling pngrtran.c failed: (Exit 1): aarch64-none-linux-gnu-gcc failed: error executing command 
  (cd /tensorflow/docker-build/execroot/org_tensorflow && \
  exec env - \
    PATH=/root/.cache/bazelisk/downloads/bazelbuild/bazel-5.3.0-linux-x86_64/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/dist-packages \
    TF2_BEHAVIOR=1 \
  /tensorflow/docker-build/external/aarch64_linux_toolchain/bin/aarch64-none-linux-gnu-gcc -fstack-protector -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -MD -MF bazel-out/aarch64-opt/bin/external/png/_objs/png/pngrtran.d '-frandom-seed=bazel-out/aarch64-opt/bin/external/png/_objs/png/pngrtran.o' -iquote external/png -iquote bazel-out/aarch64-opt/bin/external/png -iquote external/zlib -iquote bazel-out/aarch64-opt/bin/external/zlib -isystem external/png -isystem bazel-out/aarch64-opt/bin/external/png -isystem external/zlib -isystem bazel-out/aarch64-opt/bin/external/zlib -Wno-all -Wno-extra -Wno-deprecated -Wno-deprecated-declarations -Wno-ignored-attributes -Wno-array-bounds -Wunused-result '-Werror=unused-result' -Wswitch '-Werror=switch' '-Wno-error=unused-but-set-variable' -DAUTOLOAD_DYNAMIC_KERNELS -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -no-canonical-prefixes -fno-canonical-system-headers -c external/png/pngrtran.c -o bazel-out/aarch64-opt/bin/external/png/_objs/png/pngrtran.o)
# Configuration: 485b9507bda8d2fa62e14239a83e554ed230487d471f3cb807f51d070873f3cc
# Execution platform: @local_execution_config_platform//:platform
external/png/pngrtran.c: In function 'convert_gamma_value':
external/png/pngrtran.c:275:4: internal compiler error: Illegal instruction
  275 |    output_gamma = floor(output_gamma + .5);
      |    ^~~~~~~~~~~~
0x1739600 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1], diagnostic_t)
  ???:0
0x173a286 internal_error(char const*, ...)
  ???:0
0xc26e2f crash_signal(int)
  ???:0
0x1946167 __gmpn_tdiv_qr
  ???:0
0x191a197 parsed_string_to_mpfr
  ???:0
0x191aa9a mpfr_strtofr
  ???:0
0xb924ac real_from_string(real_value*, char const*)
  ???:0
0xb92e8b real_from_string3(real_value*, char const*, format_helper)
  ???:0
0x781be6 interpret_float(cpp_token const*, unsigned int, char const*, overflow_type*)
  ???:0
0x782c07 c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int)
  ???:0
0x70b11e c_lex_one_token(c_parser*, c_token*, bool)
  ???:0
0x71b8bc c_parser_cast_expression(c_parser*, c_expr*)
  ???:0
0x71c366 c_parser_binary_expression(c_parser*, c_expr*, tree_node*)
  ???:0
0x71ce85 c_parser_conditional_expression(c_parser*, c_expr*, tree_node*)
  ???:0
0x71d484 c_parser_expr_no_commas(c_parser*, c_expr*, tree_node*)
  ???:0
0x71e043 c_parser_expr_list(c_parser*, bool, bool, vec<tree_node*, va_gc, vl_embed>**, unsigned int*, tree_node**, vec<unsigned int, va_heap, vl_ptr>*, unsigned int*)
  ???:0
0x71f42e c_parser_postfix_expression_after_primary(c_parser*, unsigned int, c_expr)
  ???:0
0x70eb9d c_parser_postfix_expression(c_parser*)
  ???:0
0x71a812 c_parser_unary_expression(c_parser*)
  ???:0
0x71b8e6 c_parser_cast_expression(c_parser*, c_expr*)
  ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.linaro.org/> for instructions.
Target //tensorflow/lite/delegates/flex/test:benchmark_model_plus_flex_full failed to build
INFO: Elapsed time: 0.547s, Critical Path: 0.13s
INFO: 10 processes: 10 internal.
FAILED: Build did NOT complete successfully

0 Kudos

320 Views
brian14
NXP TechSupport
NXP TechSupport

Hi @Mohan51

I'm trying to replicate the issue.
In the meantime, could you please try with the BSP version L6.1.36_2.1.0​?

Have a great day!

0 Kudos

313 Views
Mohan51
Contributor II

Hi, I am unable to find the BSP L6. so cloning the latest branch lf-6.6.3.-1.0.0

0 Kudos