Open FrankdenUijl opened 1 year ago
I was able to build it via installing ubuntu via the windows store, and then run the following command:
cmake .. -DCMAKE_TOOLCHAIN_FILE=~/wksp/android-ndk-r25c/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-23 -DANDROID_STL=c++_static -DCONFIG=A311D
Now this worked! The problem I have is when running make vx_delegate
:
make vx_delegate
[ 0%] Building CXX object _deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/vx/builtin_op.cc.o
/bin/sh: 1: /home/frank/wksp/tflite-vx-delegate/build/_deps/tim-vx-build/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++: not found
make[3]: *** [_deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/build.make:76: _deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/vx/builtin_op.cc.o] Error 127
make[2]: *** [CMakeFiles/Makefile2:6734: _deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:1320: CMakeFiles/vx_delegate.dir/rule] Error 2
make: *** [Makefile:169: vx_delegate] Error 2
Any idea how to solve this? Ofcours my first question still is valid, but if you can build vx_delegate myself I can test it myself :)
When I download the requested package gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu
myself and extract it, Im stuck at the next problem:
make vx_delegate
[ 0%] Building CXX object _deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/vx/builtin_op.cc.o
aarch64-linux-gnu-g++: error: unrecognized command line option ‘--target=armv7-none-linux-androideabi28’
aarch64-linux-gnu-g++: error: unrecognized command line option ‘-mthumb’
make[3]: *** [_deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/build.make:76: _deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/vx/builtin_op.cc.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:6734: _deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:1320: CMakeFiles/vx_delegate.dir/rule] Error 2
make: *** [Makefile:169: vx_delegate] Error 2
seems like --target=armv7-none-linux-androideabi28
is not supported? Not sure what -mthumb
is?
I didn't get any further with make
so I tried bazel
, but also no luck:
frank@DESKTOP-1OFUK9C:~/wksp10/tflite-vx-delegate$ bazel build --config=android_arm :vx_delegate.so
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=120
INFO: Reading rc options for 'build' from /home/frank/wksp10/tflite-vx-delegate/.bazelrc:
Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /home/frank/wksp10/tflite-vx-delegate/.bazelrc:
'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --java_toolchain=//third_party/toolchains/java:tf_java_toolchain --host_java_toolchain=//third_party/toolchains/java:tf_java_toolchain --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --noincompatible_prohibit_aapt1 --enable_platform_specific_config --config=v2
INFO: Found applicable config definition build:v2 in file /home/frank/wksp10/tflite-vx-delegate/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:android_arm in file /home/frank/wksp10/tflite-vx-delegate/.bazelrc: --config=android --cpu=armeabi-v7a --fat_apk_cpu=armeabi-v7a
INFO: Found applicable config definition build:android in file /home/frank/wksp10/tflite-vx-delegate/.bazelrc: --crosstool_top=//external:android/crosstool --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --noenable_platform_specific_config --copt=-w --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
DEBUG: Rule 'io_bazel_rules_docker' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1556410077 -0400"
DEBUG: Repository io_bazel_rules_docker instantiated at:
/home/frank/wksp10/tflite-vx-delegate/WORKSPACE:26:14: in <toplevel>
/home/frank/.cache/bazel/_bazel_frank/2d94a7f5d8109712bec02b48c04f03b8/external/org_tensorflow/tensorflow/workspace0.bzl:105:34: in workspace
/home/frank/.cache/bazel/_bazel_frank/2d94a7f5d8109712bec02b48c04f03b8/external/bazel_toolchains/repositories/repositories.bzl:37:23: in repositories
Repository rule git_repository defined at:
/home/frank/.cache/bazel/_bazel_frank/2d94a7f5d8109712bec02b48c04f03b8/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
WARNING: /home/frank/.cache/bazel/_bazel_frank/2d94a7f5d8109712bec02b48c04f03b8/external/tim_vx/prebuilt-sdk/x86_64_linux/BUILD:11:11: in linkstatic attribute of cc_library rule @tim_vx//prebuilt-sdk/x86_64_linux:VIV_SDK_LIB: setting 'linkstatic=1' is recommended if there are no object files
INFO: Analyzed target //:vx_delegate.so (72 packages loaded, 2634 targets configured).
INFO: Found 1 target...
ERROR: /home/frank/.cache/bazel/_bazel_frank/2d94a7f5d8109712bec02b48c04f03b8/external/com_google_absl/absl/strings/BUILD.bazel:83:11: Compiling absl/strings/internal/escaping.cc failed: (Exit 1): false failed: error executing command /bin/false -MD -MF bazel-out/armeabi-v7a-opt/bin/external/com_google_absl/absl/strings/_objs/internal/escaping.pic.d ... (remaining 28 argument(s) skipped)
Target //:vx_delegate.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 11.980s, Critical Path: 2.85s
INFO: 105 processes: 93 internal, 12 local.
FAILED: Build did NOT complete successfully
I was able to build it via installing ubuntu via the windows store, and then run the following command:
cmake .. -DCMAKE_TOOLCHAIN_FILE=~/wksp/android-ndk-r25c/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-23 -DANDROID_STL=c++_static -DCONFIG=A311D
Now this worked! The problem I have is when running
make vx_delegate
:make vx_delegate [ 0%] Building CXX object _deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/vx/builtin_op.cc.o /bin/sh: 1: /home/frank/wksp/tflite-vx-delegate/build/_deps/tim-vx-build/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++: not found make[3]: *** [_deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/build.make:76: _deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/vx/builtin_op.cc.o] Error 127 make[2]: *** [CMakeFiles/Makefile2:6734: _deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/all] Error 2 make[1]: *** [CMakeFiles/Makefile2:1320: CMakeFiles/vx_delegate.dir/rule] Error 2 make: *** [Makefile:169: vx_delegate] Error 2
Any idea how to solve this? Ofcours my first question still is valid, but if you can build vx_delegate myself I can test it myself :)
Please don't use "-DCONFIG=A311D" when you build for Android.
I was able to build it via installing ubuntu via the windows store, and then run the following command:
cmake .. -DCMAKE_TOOLCHAIN_FILE=~/wksp/android-ndk-r25c/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-23 -DANDROID_STL=c++_static -DCONFIG=A311D
Now this worked! The problem I have is when running
make vx_delegate
:make vx_delegate [ 0%] Building CXX object _deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/vx/builtin_op.cc.o /bin/sh: 1: /home/frank/wksp/tflite-vx-delegate/build/_deps/tim-vx-build/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++: not found make[3]: *** [_deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/build.make:76: _deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/vx/builtin_op.cc.o] Error 127 make[2]: *** [CMakeFiles/Makefile2:6734: _deps/tim-vx-build/src/tim/CMakeFiles/tim-vx.dir/all] Error 2 make[1]: *** [CMakeFiles/Makefile2:1320: CMakeFiles/vx_delegate.dir/rule] Error 2 make: *** [Makefile:169: vx_delegate] Error 2
Any idea how to solve this? Ofcours my first question still is valid, but if you can build vx_delegate myself I can test it myself :)
Please don't use "-DCONFIG=A311D" when you build for Android.
If I understand correctly I can build an External Delegate (for example:
libvx_delegate.so
) via this repository and run TensorFlow Lite models on the NPU of the A311D processor?My first question, do I need to modify TensorFlow Lite to run this delegate, or can I swap this delegate with a different external delegate with a pre-build TensorFlow Lite plugin?
For example replace the external delegate on this location with the
libvx_delegate.so
(this runs TensorFlow Lite): https://github.com/asus4/tf-lite-unity-sample/tree/master/Packages/com.github.asus4.tflite/Plugins/Android/armeabi-v7aMy second question is, I'm unable to build this external delegate:
Our A311D processor runs on Android 32-bit.
Any help is appreciated, thanks!