Enabling eIQ for i.MX6QP

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

Enabling eIQ for i.MX6QP

2,008 Views
jeongin
Contributor II

Hi, I'm new in ARM and I have a iMX6QP SABRE board.

I'm following https://www.nxp.com/docs/en/nxp/user-guides/UM11226.pdf  with little modification as below:

(I'm trying in VirtualBox with ubuntu 18.04.3 LTS.)

--------------------------------------------------------------------------------------------------

from :

EULA=1 MACHINE=imx8qmmek DISTRO=fsl-imx-xwayland source ./fsl-setup-release.sh -b buildxwayland

PACKAGECONFIG_remove_pn-opencv_mx8 = "python3"
PACKAGECONFIG_append_pn-opencv_mx8 = " dnn python2 qt5 jasper openmp test neon"

PACKAGECONFIG_remove_pn-opencv_mx8 = "opencl"

to :

EULA=1 MACHINE=imx6qpsabresd DISTRO=fsl-imx-xwayland source ./fsl-setup-release.sh -b buildxwayland

PACKAGECONFIG_remove_pn-opencv_mx6 = "python3"
PACKAGECONFIG_append_pn-opencv_mx6 = " dnn python2 qt5 jasper openmp test neon"

PACKAGECONFIG_remove_pn-opencv_mx6 = "opencl"

(I already modified the tensorflow_1.12.0.bb with COMPATIBLE_MACHINE = "(imx8qm|imx6q)")

--------------------------------------------------------------------------------------------------

And I ran bitbake with this settings:

--------------------------------------------------------------------------------------------------

Build Configuration:
BB_VERSION = "1.38.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "ubuntu-18.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "imx6qpsabresd"
DISTRO = "fsl-imx-xwayland"
DISTRO_VERSION = "4.14-sumo"
TUNE_FEATURES = "arm armv7a vfp neon callconvention-hard cortexa9"
TARGET_FPU = "hard"
meta
meta-poky = "HEAD:c9bd4984f8f471ca2c43052714f4413ba99cf171"
meta-oe
meta-multimedia = "HEAD:8760facba1bceb299b3613b8955621ddaa3d4c3f"
meta-freescale = "HEAD:27ca94f8a4336790ba117b4298566f6820e7e74c"
meta-freescale-3rdparty = "HEAD:82037216280a39957fb4272581637abec734ad50"
meta-freescale-distro = "HEAD:f7e2216e93aff14ac32728a13637a48df436b7f4"
meta-bsp
meta-sdk = "HEAD:8eeb420fad668b733ab95b460895e1c337c66b25"
meta-browser = "HEAD:75640e14e325479c076b6272b646be7a239c18aa"
meta-gnome
meta-networking
meta-python
meta-filesystems = "HEAD:8760facba1bceb299b3613b8955621ddaa3d4c3f"
meta-qt5 = "HEAD:d4e7f73d04e8448d326b6f89908701e304e37d65"
meta-imx-machinelearning = "HEAD:7e9294dead55d1f6b4f1cfe486e0c4e0c5097953"

--------------------------------------------------------------------------------------------------

But I got some errors in configuring armnn as below:

--------------------------------------------------------------------------------------------------

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/build/CMakeFiles/CMakeTmp

Run Build Command:"ninja" "cmTC_f562e"
[1/2] Building C object CMakeFiles/cmTC_f562e.dir/CheckSymbolExists.c.o
[2/2] Linking C executable cmTC_f562e
FAILED: cmTC_f562e
: && /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1=/usr/src/debug/armnn/19.02-r1 -fdebug-prefix-map=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot= -fdebug-prefix-map=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot-native= -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -rdynamic CMakeFiles/cmTC_f562e.dir/CheckSymbolExists.c.o -o cmTC_f562e && :
CMakeFiles/cmTC_f562e.dir/CheckSymbolExists.c.o: In function `main':
/usr/src/debug/armnn/19.02-r1/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:13: undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

File /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/build/CMakeFiles/CMakeTmp

Run Build Command:"ninja" "cmTC_6baaf"
[1/2] Building C object CMakeFiles/cmTC_6baaf.dir/CheckFunctionExists.c.o
[2/2] Linking C executable cmTC_6baaf
FAILED: cmTC_6baaf
: && /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1=/usr/src/debug/armnn/19.02-r1 -fdebug-prefix-map=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot= -fdebug-prefix-map=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot-native= -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot -DCHECK_FUNCTION_EXISTS=pthread_create -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -rdynamic CMakeFiles/cmTC_6baaf.dir/CheckFunctionExists.c.o -o cmTC_6baaf -lpthreads && :
/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/7.3.0/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.


Determining if the include file valgrind/memcheck.h exists failed with the following output:
Change Dir: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/build/CMakeFiles/CMakeTmp

Run Build Command:"ninja" "cmTC_6073b"
[1/2] Building C object CMakeFiles/cmTC_6073b.dir/CheckIncludeFile.c.o
FAILED: CMakeFiles/cmTC_6073b.dir/CheckIncludeFile.c.o
/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1=/usr/src/debug/armnn/19.02-r1 -fdebug-prefix-map=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot= -fdebug-prefix-map=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot-native= -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot -fPIE -o CMakeFiles/cmTC_6073b.dir/CheckIncludeFile.c.o -c CheckIncludeFile.c
CheckIncludeFile.c:1:10: fatal error: valgrind/memcheck.h: No such file or directory
#include <valgrind/memcheck.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.

--------------------------------------------------------------------------------------------------

This is the part of logfile:

--------------------------------------------------------------------------------------------------

Log data follows:
| DEBUG: Executing shell function do_configure
| -- The C compiler identification is GNU 7.3.0
| -- The CXX compiler identification is GNU 7.3.0
| -- Check for working C compiler: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
| -- Check for working C compiler: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -- works
| -- Detecting C compiler ABI info
| -- Detecting C compiler ABI info - done
| -- Detecting C compile features
| -- Detecting C compile features - done
| -- Check for working CXX compiler: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
| -- Check for working CXX compiler: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ -- works
| -- Detecting CXX compiler ABI info
| -- Detecting CXX compiler ABI info - done
| -- Detecting CXX compile features
| -- Detecting CXX compile features - done
| -- Looking for pthread.h
| -- Looking for pthread.h - found
| -- Looking for pthread_create
| -- Looking for pthread_create - not found
| -- Looking for pthread_create in pthreads
| -- Looking for pthread_create in pthreads - not found
| -- Looking for pthread_create in pthread
| -- Looking for pthread_create in pthread - found
| -- Found Threads: TRUE
| -- Boost version: 1.66.0
| -- Found the following Boost libraries:
| -- unit_test_framework
| -- system
| -- filesystem
| -- log
| -- program_options
| -- date_time
| -- log_setup
| -- thread
| -- regex
| -- chrono
| -- atomic
| -- Flatbuffers headers are located at: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot/usr/include
| -- Flatbuffers library located at: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot/usr/lib/libflatbuffers.a
| -- Tf Lite generated header found at: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot/usr/share/armnn-tensorflow-lite
| -- Looking for valgrind/memcheck.h
| -- Looking for valgrind/memcheck.h - not found
| -- Armnn Serializer support is disabled
| -- ArmNN Quantizer support is disabled
| Including backend common library into the build: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/git/src/backends/aclCommon/common.cmake
| Including backend common library into the build: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/git/src/backends/backendsCommon/common.cmake
| Including backend into the build: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/git/src/backends/cl/backend.cmake
| CL backend is disabled
| Including backend into the build: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/git/src/backends/neon/backend.cmake
| Including backend into the build: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/git/src/backends/reference/backend.cmake
| Adding object library dependency to armnn: armnnAclCommon
| Adding object library dependency to armnn: armnnBackendsCommon
| Adding object library dependency to armnn: armnnClBackend
| Adding object library dependency to armnn: armnnNeonBackend
| Adding object library dependency to armnn: armnnNeonBackendWorkloads
| Adding object library dependency to armnn: armnnRefBackend
| Adding object library dependency to armnn: armnnRefBackendWorkloads
| -- The ASM compiler identification is GNU
| -- Found assembler: /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
| Adding object library dependency to UnitTests: armnnAclCommonUnitTests
| Adding object library dependency to UnitTests: armnnBackendsCommonUnitTests
| Adding object library dependency to UnitTests: armnnNeonBackendUnitTests
| Adding object library dependency to UnitTests: armnnRefBackendUnitTests
| CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
| Please set them or make sure they are set and tested correctly in the CMake files:
| ARMCOMPUTE_INCLUDE
| used as include directory in directory /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/git
...

--------------------------------------------------------------------------------------------------

I thought the problem came from lack of setting for pthread and valgrind.

So I tried to add -lpthread option in toolchain.make and make symbolic link of valgrind to sysroot like below,

but it didn't work :

--------------------------------------------------------------------------------------------------

for valgrind:

sudo ln -s /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/valgrind/3.13.0-r0/image/usr/include/valgrind /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot/usr/include/valgrind

sudo ln -s /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/valgrind/3.13.0-r0/image/usr/lib/valgrind /home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot/usr/lib/valgrind

for pthread:

set( CMAKE_C_LINK_FLAGS " -lpthread -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed " CACHE STRING "LDFLAGS" )
set( CMAKE_CXX_LINK_FLAGS " -lpthread -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1=/usr/src/debug/armnn/19.02-r1 -fdebug-prefix-map=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot= -fdebug-prefix-map=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot-native= -fvisibility-inlines-hidden -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/s1/fsl-arm-yocto-bsp/build-xwayland/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/armnn/19.02-r1/recipe-sysroot -fopenmp -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed" CACHE STRING "LDFLAGS" )

(Actually, the error messages for pthread are changed, but finally fails :

Determining if the function pthread_create exists in the pthreads failed with the following output:

> Determining if the function pthread_create exists in the pthreads passed with the following output:)

--------------------------------------------------------------------------------------------------

Eventually, all the compile process excepts armnn, onnx, and tensorflow were succeeded.

(armnn : error in configure, rest : error in compile)

How do I avoid these problems? 

Or, is it impossible to enable eIQ for iMX6?

Thanks in advance.

4 Replies

1,629 Views
raluca_popa
NXP Employee
NXP Employee

Hi,

eIQ is supported only for i.IMX8 family of SoCs.

Regards,

Raluca

0 Kudos

1,629 Views
jeongin
Contributor II

Thanks for reply. 

Then, can I run tensorflow-lite without using eIQ? 

0 Kudos

1,629 Views
andreamarson
Contributor II

Hi,

recently, I posted an article about using Tensorflow on i.MX6 SoC's:

SBCX-TN-005: Using TensorFlow to implement a Deep Learning image classifier based on Azure Custom Vi... 

Maybe it is useful for you to run Tensorflow Lite on the i.MX6QP.

1,629 Views
jeongin
Contributor II

Thanks for reply. 

0 Kudos