OpenCV dependencies not found

Which system do you use? Android, Ubuntu, OOWOW or others?

Others

Which version of system do you use? Please provide the version of the system here:

Yocto based image with kernel version 6.0 + NPU patches

Please describe your issue below:

I am trying to build & run apps (e.g., yolov8n_demo_x11_usb) on top of Linux kernel built using Yocto, that use Khadas VIM3 NPU. I used pre-built libraries (e.g., libGAL.so, libOpenVX.so, libOpenCL.so, …) & header files available in the .deb package in the path below:

I used a recipe with name npu-bins_1.0.bb, to install prebuilt libraries to the system rootfs.

However, I am not successful (in building the NPU test app) because the OpenCV lib is depending upon the following, and are not found:

  • libVSC.so (I assume that this can be replaced by libVSC_lite.so)
  • libCLC.so
  • libSPIRV_viv.so

I can extract these libs from ubuntu image (I think so), but I would like to get these libs from a release package or repo.

If steps to build these libs from source are provided, it would be much appreciated. Thanks.

Post a console log of your issue below:


ERROR: npu-bins-1.0-r0 do_package_qa: QA Issue: /usr/lib/libOpenCL.so contained in package npu-bins requires libVSC.so()(64bit), but no providers found in RDEPENDS:npu-bins? [file-rdeps]
ERROR: npu-bins-1.0-r0 do_package_qa: QA Issue: /usr/lib/libOpenCL.so contained in package npu-bins requires libCLC.so()(64bit), but no providers found in RDEPENDS:npu-bins? [file-rdeps]
ERROR: npu-bins-1.0-r0 do_package_qa: QA Issue: /usr/lib/libOpenCL.so contained in package npu-bins requires libSPIRV_viv.so()(64bit), but no providers found in RDEPENDS:npu-bins? [file-rdeps]
ERROR: npu-bins-1.0-r0 do_package_qa: Fatal QA errors were found, failing task.
ERROR: Logfile of failure stored in: /home/emb-aanahcn/labs/CarIQ/build-ccn/tmp/work/cortexa73-cortexa53-poky-linux/npu-bins/1.0/temp/log.do_package_qa.2640055
ERROR: Task (/home/emb-aanahcn/labs/CarIQ/build-ccn/../yocto/meta-cariq/recipes-npu/npu_sdk/npu-bins_1.0.bb:do_package_qa) failed with exit code '1'

Maybe you can remove the libOpenCL.so library in npu package and try again? If you just want to run the NPU demo this library is not needed.

Yes, removing libOpenCL.so library resolves the above mentioned error. But I thought we need this OpenCL library to run a full-fledged AI applications that needed to use NPU on VIM3. Right?

No, it is not needed.

Ok, thank you for confirmation. If libOpenCV.so file is removed, the dependencies issue is resolved. But I have a question in the bottom of this message.

I tried building yolov8n_demo_x11_usb app, I got the following error:

| /home/emb-aanahcn/labs/CarIQ/build-ccn/tmp/work/cortexa73-cortexa53-poky-linux/npu-tests/1.0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/14.2.0/ld: cannot find -lamcodec: No such file or directory
| /home/emb-aanahcn/labs/CarIQ/build-ccn/tmp/work/cortexa73-cortexa53-poky-linux/npu-tests/1.0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/14.2.0/ld: cannot find -lamadec: No such file or directory
| /home/emb-aanahcn/labs/CarIQ/build-ccn/tmp/work/cortexa73-cortexa53-poky-linux/npu-tests/1.0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/14.2.0/ld: cannot find -lamvdec: No such file or directory
| /home/emb-aanahcn/labs/CarIQ/build-ccn/tmp/work/cortexa73-cortexa53-poky-linux/npu-tests/1.0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/14.2.0/ld: cannot find -lamavutils: No such file or directory
| /home/emb-aanahcn/labs/CarIQ/build-ccn/tmp/work/cortexa73-cortexa53-poky-linux/npu-tests/1.0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/14.2.0/ld: cannot find -lge2d: No such file or directory
| /home/emb-aanahcn/labs/CarIQ/build-ccn/tmp/work/cortexa73-cortexa53-poky-linux/npu-tests/1.0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/14.2.0/ld: cannot find -lion: No such file or directory

When I tried building sample_demo_x11 app, I got these errors:

|   COMPILE /home/emb-aanahcn/labs/CarIQ/build-ccn/tmp/work/cortexa73-cortexa53-poky-linux/npu-tests/1.0/git/detect_library/sample_demo_x11/main.cpp
| main.cpp:38:10: fatal error: linux/meson_ion.h: No such file or directory
|    38 | #include <linux/meson_ion.h>

Both suggests me that these apps depends on Ion (the Android’s memory f/w). The question is, are these apps meant to work on Android? If yes, do we have any NPU demo apps that runs on Linux?

This demo is used for Linux, and we build it on VIM3 directly not crsoo build.

Such libraries are not needed, you can change your build script to remove them.