This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: The OpenCV library enabled neon runnig in tda4 qnx710 board and reporting an error

Part Number: TDA4VM

Hi team,

Customer has the following questions and need help.

==============================================================================================================================

n Desay TDA4VM mass production board (not TDA4 EVM development board), which the board environment is qnx710/aarch64 (A72), I calls opencv4.3.0 libraries enabled NEON and compiled with qnx710 toolchain. But errors are reported as follows: This opencv build doesn't support current CPU/HW configuration. ID=100(NEON) – NOT AVAILABLE。 What are the possible reasons?

 

The tests I have done are as follows:

  1. I used the demo program to call the opencv library that enables neon running in the Qualcomm SA8155 QNX board, it’s OK and no error. But the same program will report an error in the tda4 QNX board.: This opencv build doesn't support current CPU/HW configuration. NEON – NOT AVAILABLE
  2. I recompiled the opencv source code with qnx710 and added the compilation option:-DENABLE_NEON=OFF, turn off neon actively. And then I use the same program to run in TDA44 qnx710 board. it’s OK and no error.

Analysis: The opencv Library enabled neon can run in Qualcomm sa8155 qnx board, but it cannot run in tda4 qnx board. However, The opencv Library not enabled neon can run in tda4 qnx board. Then we suspect that the running environment in tda4 board may cause the bug. Possible reasons are as follows:

  1. Maybe there is a problem with TDA4 SOC BSP?
  2. Or there is a problem with the customized qnx710 system running on the tda4 board. One of the two reasons does not enable neon, so the opencv library with neon cannot run on tda4 SOC.

I want to know what are the possible reasons?

The demo program is as follows: opencv_neon_test.cpp

#include <opencv2/opencv.hpp>

#include <opencv2/imgproc.hpp>

#include <opencv2/highgui.hpp>

using namespace cv;

int main(int argc, char const *argv[])

{

       cv::Mat src_img = cv::imread("./01.jpg", IMREAD_COLOR);

       // cv::imshow("src", src_img);

       // cv::waitKey(0);

       cv::imwrite("src.jpg", src_img);

       printf("OPENCV API TEST SUCCESS");

       return 0;

Thanks,

Annie

  • Hi Team,

    Is there any update for this case?

    Thanks,

    Annie

  • Hi KB,

    Both customers are from the same company. They contacted BlackBerry engineers, but BlackBerry engineers couldn't solve it either.

    Now, The problem is:

    The same opencv library (with NEON turned on) can run on the Qualcomm SA8155 qnx board, but cannot run on the TI TDA4VM qnx board.

    The same opencv library (with NEON turned off) can be run on the TI TDA4VM qnx board.

    BlackBerry said that the opencv library (with NEON turned on) is no problem, why it cannot run on the TDA4VM qnx board alone, they suspect that it is a TDA4-related problem.

    Customer would like to know:

    To run the QNX system on the TDA4VM SOC, the onboard development kit BSP and other related things are required. Is it possible that the BSP does not support NEON? Or does the QNX system customized by TDA4VM have NEON enabled? After all, the opencv library runs on the QNX system, that is, on the A72. The bottom layer of the QNX system is the BSP. The customer's understanding is that in the TDA4 SOC, the first is the A72 core, the upper layer is the BSP, then the upper layer is the QNX, and the top is the opencv library. is that correct? The A72 core is definitely no problem. It has been verified that it supports the NEON instruction set, and the openCV library is also no problem. So the problem might be on BSP or QNX SDP?

    Thanks,

    Annie

  • Hi Annie,

    In the parallel thread it is stated that "I wrote some code with NEON instructions, it also ran as well ."   

    Based on that statement, assumptions are below:

    • NEON is functional on the A72 with QNX SDP 7.1
    • QNX-Blackberry BSP was used to boot the board
    • NEON test code was run, and was functional

    The only thing missing in this test would then be OpenCV library.

    My understanding is that the library under test is from Blackberry, and TI does not have source code access to this library.   Without source code access it is difficult for TI to proceed with debug. 

    Please advise if this understanding is not correct.

    Is customer aware, of what is the logic check, that is causing the error to be generated?   Could it be a missing compile flag for example, causing a different code path?

    Will try some NEON tests on PSDK QNX 8.1 locally to see behavior.   

    Please note that OpenCV support is not part of the PSDK QNX delivery by TI.

    Regards,

    kb

  • Hi Annie,

    Ran some tests, and created (+) [FAQ] TDA4VM: NEON Support in PSDK QNX - Processors forum - Processors - TI E2E support forums.

    Please review and provide feedback if this resolves the issue being seen with OpenCV.

    Regards,

    kb

  • Hi KB,

    This post pointed the direction and the problem.

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1075898/faq-tda4vm-neon-support-in-psdk-qnx 

    When the TDA4 board starts up, the QNX BSP will read the ARM register ID_AA64PFR0_EL1 to determine whether NEON is supported by the underlying platform. Customer runs instructions in the board: pidin syspage=cpuinfo. This is the log information:

    J7EVM@QNX:/# pidin syspage=cpuinfo

    Header size=0x00000108, Total Size=0x00000950, #Cpu=2, Type=257

    Section:cpuinfo offset:0x00000340 size:0x00000040 elsize:0x00000020

    0) cpu:411fd080 flg:c0000c3a spd:2000 hwid:80000000 cache i/d:0/1 name:99

    history:0000000000000004

    1) cpu:411fd080 flg:c0000c3a spd:2000 hwid:80000001 cache i/d:0/1 name:99

    history:0000000000000003

    J7EVM@QNX:/#

    From the log, the cpu and flag information in the TDA4 board is: cpu:411fd080 flg:c0000c3a. You said in the above post: The correct flag to support NEON should be: cpu:411fd080 flg:c0000c7a. So the customer confirms that the qnx bsp in their board is not set correctly, resulting in no support for NOEN.

    He wants to confirm that in order to make the TDA4 QNX board support NEON, it is only necessary to modify the following content of the BSP File ./src/hardware/startup/lib/aarch64/init_cpuinfo.c, and no other code needs to be modified, is it correct?

      #define AA64PFR0_SIMD(x) ((((x) >> 20) & 0xfUL) != 0xfUL)

    #define AA64PFR0_FP(x) ((((x) >> 16) & 0xfUL) != 0xfUL)

    He will modifies the BSP file according to the above suggestions, and will continue to track this problem until the problem is solved.

    Thanks,

    Annie

  • Hi Annie,

    Thank you for the update.

    Regarding "TDA4 QNX board support NEON, it is only necessary to modify the following content of the BSP File".   The logic shown above from init_cpuinfo.c, in the BSP will update a syspage entry, indicating that NEON is supported.   The OpenCV library is likely checking this flag, and  generating the error initially reported in this thread, but without source code access, TI is unable to verify this. 

    Making the BSP change, or downloading an updated BSP which includes the update as per FAQ , is recommended.

    Regards,

    kb