OAID / TengineKit

TengineKit - Free, Fast, Easy, Real-Time Face Detection & Face Landmarks & Face Attributes & Hand Detection & Hand Landmarks & Body Detection & Body Landmarks & Iris Landmarks & Yolov5 SDK On Mobile.
Other
2.37k stars 318 forks source link

please advice: TengineKit/Khadas/sample/Face/bin/Face crash with error of load plugin failed: libvxplugin.so: cannot open shared object file: No such file or directory #29

Open GalShalif opened 3 years ago

GalShalif commented 3 years ago

Hello TengineKit,

Please adivce: TengineKit/Khadas/sample/Face/bin/Face crash with error of "load plugin failed: libvxplugin.so: cannot open shared object file: No such file or directory"

Note: A similar library (OpenVX implementation?) exist with the Khadas VIM3 NPU SDK at: .../aml_npu_sdk_6.4.3/linux_sdk/linux_sdk_6.4.3/build/sdk/drivers_64/libovxlib.so

Appended below are the detailes of the build and run.

Build the VIM3 NPU test - ​https://github.com/OAID/TengineKit :

Reference:

  1. SSH to a Khadas VIM3 board (i.e. Amlogic A311D 4GB RAM with a 5 TOPS int8 NPU - ​​https://www.khadas.com/product-page/vim3 ) ssh -X noveto@vim3-001 1.1. The Khadas VIM3 board is installed with a Ubuntu 20.04 desktop and the default 4.9.x kernel:

$ uname -a Linux vim3-001 4.9.241 #1 SMP PREEMPT Sun Dec 27 17:09:46 IST 2020 aarch64 aarch64 aarch64 GNU/Linux

$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal

$ g++ --version g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  1. Setup dependencies sudo apt-get install cmake make g++ git

  2. Build the TEngine lite dependency - follow build instructions from ​https://gitee.com/OAL/Tengine/blob/tengine-lite/doc/compile.md cd /opt/noveto/src/FaceDetection ... ... ... 3.1. After build + install, the install located is /opt/noveto/src/FaceDetection/Tengine-Lite/build/install

  3. Download sources of TengineKit cd /opt/noveto/src/FaceDetection git clone https://github.com/OAID/TengineKit && cd TengineKit

  4. Verify $ git log commit 5672e38a70ff08d331bbe674a773657c77f0e377 (HEAD -> master, origin/master, origin/HEAD) Author: zhangjun 572872554@qq.com Date: Fri Jan 15 17:46:22 2021 +0800

    Linux sample ... ... ...

  5. Fixup: add the expected link to the TEngine lite libraries cd /opt/noveto/src/FaceDetection/TengineKit/Khadas/sample/Face ln -s /opt/noveto/src/FaceDetection/Tengine-Lite/build/install/lib libs

  6. Build cd /opt/noveto/src/FaceDetection/TengineKit/Khadas/sample/Face bash make.sh

  7. Run cd /opt/noveto/src/FaceDetection/TengineKit/Khadas/sample/Face/bin ./Face load plugin failed: libvxplugin.so: cannot open shared object file: No such file or directory Load vx plugin failed. Segmentation fault (core dumped) 8.1. Look for the offending code (i.e. the loading of libvxplugin.so) $ git blame Khadas/sample/Face/src/manager.cpp | grep libvxplugin.so b6cd822b (zhangjun 2021-01-04 15:23:04 +0800 19) if (load_tengine_plugin(VXDEVICE, "libvxplugin.so", "vx_plugin_init") < 0) { 8.2. the change description is: $ git show b6cd822b | head commit b6cd822b6e542ecdf9ce70cf04002ba0a38f4d34 Author: zhangjun 572872554@qq.com Date: Mon Jan 4 15:23:04 2021 +0800

    update khadas

Crusoekid commented 3 years ago

You must use the latest khadas board, because khadas has just updated the latest driver to accept Tengine npu. You can try with the latest board, tengine is pre-installed.

GalShalif commented 3 years ago

Thank. I had installed the package (from https://dl.khadas.com/repos/vim3/pool/main/t/tengine-libs/) with: sudo apt install tengine-libs

wuqiangch commented 3 years ago

@GalShalif Have you run the demo successfully? I can't run it. Tengine plugin allocator TIMVX is registered. vsiplugin reshape output tensor addr is 0x55a4c31d10 vsiplugin reshape output tensor addr is 0x55a4c31db0 vsiplugin reshape output tensor addr is 0x55a4c31e50 vsiplugin reshape output tensor addr is 0x55a4c31ef0 vsiplugin reshape output tensor addr is 0x55a4c32530 vsiplugin reshape output tensor addr is 0x55a4c320b0 vsiplugin reshape output tensor addr is 0x55a4c32150 vsiplugin reshape output tensor addr is 0x55a4c321f0 TENGINE_LAYOUT_NCHW goto RELEASE data size is 4472. data size is 4472. form : 3 ,to : 0 vsiplugin reshape output tensor addr is 0x55a5af9cc0 TENGINE_LAYOUT_NCHW goto RELEASE data size is 128. TENGINE_LAYOUT_NCHW goto RELEASE data size is 1724. init Over Detect Run Graph cost:1.22803 1 Run Over Tensor size mismatch 256 vs 512. /home/khadas/projects/khadas/vsiplugin-master/vxnpu/driver/vx_device.c:363 set input data for tensor 0 failed run subgraph 2 error! Landmark Run Graph cost:1.41992 Run Over

Crusoekid commented 3 years ago

31