I.MX8MP opencv runtime error, with eIQ SDK build using yocto

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

I.MX8MP opencv runtime error, with eIQ SDK build using yocto

Jump to solution
2,971 Views
mbrundler
Contributor II

Hi,

I built an I.MX8M target image as well as the eIQ Machine Learning SDK, using yocto with the imx-5.10.52-2.1.0.xml manifest.

I'm totally new to yocto/bitbake, so I followed the i.MX Yocto Project User's Guide guidelines :

repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-hardknott -m imx-5.10.52-2.1.0.xml
repo sync
DISTRO=fsl-imx-wayland MACHINE=imx8mp-lpddr4-evk source imx-setup-release.sh -b build
I then add the following lines to the conf/local.conf file :

UBOOT_CONFIG = "sd"
TOOLCHAIN_TARGET_TASK_append += " tensorflow-lite-dev armnn-dev onnxruntime-dev"

Then :

bitbake imx-image-full
bitbake imx-image-full -c populate_sdk

All is OK.

I flashed the image to the target board, then installed the SDK on the host with :

./build/tmp/deploy/sdk/fsl-imx-wayland-glibc-x86_64-imx-image-full-cortexa53-crypto-imx8mp-lpddr4-evk-toolchain-5.10-hardknott.sh

So as to check everything's OK, I followed the i.MX Machine Learning User's Guide and
compiled the " armnn-mnist" example provided by Arm using the cross compilers provoded by the SDK.

It executes without problem on the target :

tests> ./mnist_tf
Predicted: 7
Actual: 7

Everything's OK so far. The problem arises when I add a "cv::imread(IMG_FILE);" to the code. It still compiles/link OK (after adding the opencv libs -lopencv_core, ... to the link).

Unfortunately I get a runtime error when executing the progam on the target :

tests> ./mnist_tf

terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.5.2) /usr/src/debug/opencv/4.5.2.imx-r0/git/modules/highgui/src/window.cpp:667: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvDestroyWindow'

I guess something's missing in my yocto build to have the expected libraries generated (note that libgtk-3.so.0 is installed on my target).

Thanks for help

Marc Brundler

0 Kudos
Reply
1 Solution
2,940 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello mbrundler,

Yes, you might try the xwayland Distro. This error is present when you have a bad image or it has no installed completely OpenCV.

Regards

 

View solution in original post

0 Kudos
Reply
4 Replies
2,147 Views
ejmfrancisco
Contributor I

Hi, I am building the same workflow. However, I am stuck with a "do_compile" error which I posted in https://community.nxp.com/t5/i-MX-Processors/Yocto-hardknott-15-10-72-2-2-2-imx8m-lpddr4-evk-build-e...

Everything is working fine until I run "bitbake imx-image-full".

May I know if it has something to do with my host machine?

Thanks.

0 Kudos
Reply
2,943 Views
mbrundler
Contributor II

It appears that (unlike I wrote in my original post) the issue is not with cv::imread functions that are actually OK,  but with functions that deal with windows such as cv::destroyWindow (as displayed on the error message ...).

I built with Wayland support only, not X. Does opencv supports Wayland ?

Would simply re-building with DISTRO=fsl-imx-xwayland solve this issue ?

 

0 Kudos
Reply
2,941 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello mbrundler,

Yes, you might try the xwayland Distro. This error is present when you have a bad image or it has no installed completely OpenCV.

Regards

 

0 Kudos
Reply
2,922 Views
mbrundler
Contributor II

Hi,

Re-building with DISTRO=fsl-imx-xwayland as you suggested actually solved this issue.

Thank you for the help.

0 Kudos
Reply