[i.MX 8MP] OpenVX Stereo demo crash (in gtec-demo-framework)

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

[i.MX 8MP] OpenVX Stereo demo crash (in gtec-demo-framework)

3,852 Views
hiep_nguyen
Contributor III

Hi NXP's Experts and Community,

I'm trying to run OpenVX Stereo demo in i.MX8M Plus EVK. I used Yocto BSP 5_10_52-2_1_0 for SDK cross compile and deployment.

However, when run on the EVK, the demo was crashed at OpenVX kernel : stereo_matching_kernel_LeftReference.

Debug logs:

 

root@imx8mpevk:~/sgm# ./demo_sgm_vivante
Building program with source
Adding kernel 0
kernel name : com.nxp.extension.CensusTransform
Succeeded to finalize kernel 0 = com.nxp.extension.CensusTransform
Adding kernel 1
kernel name : com.nxp.extension.stereo_matching_kernel_LeftReference
Segmentation fault (core dumped)

 

Coredump:

 

#7 0x0000ffffb03b8db8 in vscCreateKernel () from /usr/lib/libVSC.so
#8 0x0000ffffb0372edc in ?? () from /usr/lib/libVSC.so
#9 0x0000ffffb03766bc in gcLinkKernel () from /usr/lib/libVSC.so
#10 0x0000ffffb1d89bc8 in gcfVX_CreateShader () from /usr/lib/libOpenVX.so.1
#11 0x0000ffffb1d8a2ac in vxoKernel_CreateShaders () from /usr/lib/libOpenVX.so.1
#12 0x0000ffffb1d8a4c8 in vxoKernel_Initialize () from /usr/lib/libOpenVX.so.1
#13 0x0000ffffb1d4d944 in ?? () from /usr/lib/libOpenVX.so.1
#14 0x0000ffffb1d89674 in vxAddKernelInProgramEx () from /usr/lib/libOpenVX.so.1
#15 0x0000ffffb1d8979c in vxAddKernelInProgram () from /usr/lib/libOpenVX.so.1
#16 0x0000aaaac93c77d0 in UserNodes::VXPublishNodeKernels (this=this@entry=0xffffe0743ad0, contextVX=<optimized out>)

 

 

Steps to reproduce :

1/ I attached openvx stereo demo standalone version (copy from gtec-demo-framework and modified to run standalone)

2/ Build with latest Yocto SDK ( I used Yocto BSP version 5_10_52-2_1_0 )

 

Did you meet this kind of issue before ? Could you guide me solve this issue or how to enable OpenVX trace / debug logs? 


Many thanks in advance !

 

BRs,
Hiep

8 Replies

3,008 Views
HME15769
Contributor II

The original NXP's sample has NOT supported on iMX8MP. But it’s not on the instruction.
https://github.com/NXPmicro/gtec-demo-framework/issues/5#issuecomment-944006997

3,767 Views
hiep_nguyen
Contributor III

Regarding the crash issue, the root cause is that : with unknown reason, the vxc_uchar4 array can't access in for loop of vector iterator.

For example in stereo_matching_kernel_RightReference kernel in CTF_kernels_vxc.vx file.

 

vxc_uchar4 ref[10];

for(int i = 0; i < 10; i++)
{
    VXC_OP4(img_load, ref[i], Census_padded_R, census_input_index, 0, VXC_MODIFIER(0, 3, 0, VXC_RM_TowardZero, 0));
    census_input_index.y += ciib_const;
}

 


 So my workaround : directly access to array, it worked perfectly. But I really don't know why access by vector iterator make the crash happen.

 

VXC_OP4(img_load, ref[0], Census_padded_L, census_input_index, 0, VXC_MODIFIER(0, 3, 0, VXC_RM_TowardZero, 0));
census_input_index.y += ciib_const;
VXC_OP4(img_load, ref[1], Census_padded_L, census_input_index, 0, VXC_MODIFIER(0, 3, 0, VXC_RM_TowardZero, 0));
census_input_index.y += ciib_const;
VXC_OP4(img_load, ref[2], Census_padded_L, census_input_index, 0, VXC_MODIFIER(0, 3, 0, VXC_RM_TowardZero, 0));
census_input_index.y += ciib_const;

 

 

3,749 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Is this possible related to Census_padded_L you are using? The demo code is usingCensus_padded_R

0 Kudos
Reply

3,747 Views
hiep_nguyen
Contributor III

Checked again, it's my fault when copied and pasted wrong line to the comment. The kernel code in i.MX 8MP is still correct.

0 Kudos
Reply

3,824 Views
hiep_nguyen
Contributor III

Hi @Zhiming_Liu ,

 

Unluckily, I can't find the OpenVX Stereo example under /opt/imx-gpu-sdk . That's why I have to modify gtec-demo-framework source code to build OpenVX Stereo demo run standalone.

Yocto BSP used: version 5_10_52-2_1_0 with build mode : bitbake imx-image-full

 

root@imx8mpevk:/opt/imx-gpu-sdk/OpenVX# ls -la
total 16
drwxr-xr-x  4 root root 4096 Mar  9  2018 .
drwxr-xr-x 16 root root 4096 Mar  9  2018 ..
drwxr-xr-x  3 root root 4096 Mar  9  2018 SoftISP
drwxr-xr-x  3 root root 4096 Mar 24  2021 VxTutorial1
root@imx8mpevk:/opt/imx-gpu-sdk/OpenVX# 

 


Checked  OpenVX Stereo example, the Fsl.gen file is pretty similar to SoftISP or VxTutorial1 example, but I don't know why Stereo example is disable with : bitbike imx-image-full ?


Do you know how to enable it ? While waiting for your response, I will check older versions to see whether the Stereo demo exist under /opt/imx-gpu-sdk or not.


P/s : I checked Yocto BSP version 5_10_35-2_0_0, built with bitbake imx-image-full , it doesn't contain OpenVX Stereo example under /opt/imx-gpu-sdk/OpenVX as well.

 

 

BRs,
Hiep

0 Kudos
Reply

3,805 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

@hiep_nguyen 

find imx-yocto-build/sources/meta-imx/meta-sdk/recipes-graphics/imx-gpu-sdk/imx-gpu-sdk_5.7.1.bb

 

DEPENDS = " \
assimp \
cmake-native \
devil \
fmt \
gli \
glm \
gstreamer1.0 \
gstreamer1.0-plugins-base \
gtest \
half \
ninja-native \
rapidjson \
stb \
zlib \
opencv \
${DEPENDS_BACKEND} \
${DEPENDS_MX8} \
"

FEATURES_SOC_mx8 = ",OpenCV,Vulkan,OpenGLES3.2,OpenCL1.2,OpenVX1.1,OpenCV4"

Then the Stereo demo will be compiled in yocto

0 Kudos
Reply

3,771 Views
hiep_nguyen
Contributor III

Hi @Zhiming_Liu ,

 

Thank you for your response. It worked like a charm, I could build the OpenVX Stereo example.

However when run it, the result is not correct. I tried to debug and found that result of Match LR and Match RR is not correct therefore rest of kernels in graph are not correct as well. 

Attached result from CensusTransform kernel (imageleft_1.jpg), stereo_matching_kernel_LeftReference  (imageleft_2.jpg) and  stereo_matching_kernel_RightReference (imageleft_3.jpg) kernels.

Did you meet this kind of issue before ? Could you guide me solve this issue ?

Thank you in advance !.

 

BRs,
Hiep

3,832 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

The demo image has contained the OpenVX demo from gtec-demo-framework, can you try it?

Location:/opt/imx-gpu-sdk

0 Kudos
Reply