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: How can I implement 2 TIDL-Nodes in one process

Part Number: TDA4VM

Hi guys,

I am trying to implement 2 TIDL Node in one process. The demo code folder I use is /ti-processor-sdk-rtos-j721e-evm-xx-xx-xx-xx/vision_apps/apps/dl_demos/app_tidl.

I modified the code, and tried to make it run in a large project to realize object detection tasks.(compile the code into a dynamic library file, and use an exe to invoke the dynamic library running on TDA4VM)

Several days ago, I received another requirement from my college: to detect some other types of objects. So I copied the folder, compile the new folder into another dynamic library, and use the same exe to invoke these two dynamic libraries, and then something weird happened.

Everything in the first dynamic library which contains the fisrt TIDL-Node runs well, graph successfully created and verified, objects successfully detected out; but the graph of the second TIDL-Node cannot be successfully verified. I am just wondering if I can implement 2 TIDL-Nodes in one process? or the reference name set by vxSetReferenceName() should not be the same?

the tivxTIDLNode set as shown in the following pic:

tivxTIDLNode set as shown in this pic

other properties set by vxSetReferenceName() as shown in the following pic:

other properties settings

the program stopped when verifying the graph of the second TIDL-Node at line 972 in the following pic:

program stopped at line 972

I would really appreciate it if someone could solve my problem

  • Hi,

    Could you please share the error log you are facing?

    Please enable the remote core logs first (i.e. ./vision_apps_init.sh) before running the application, to get the logs from the remote cores.

    Please share the same to get a better understanding of the issue.

    Regards,

    Nikhil

  • Hello Nikhil,

    I have located the bug. You can see in the pic bellow:

    appInit

    I added this function appInit() in the function app_tidl_main() before app_init().

    When these 3 functions (appCommonInit(), tivxInit(), tivxHostInit()) run for the first time, everything goes well, and when the second dynamic library started to run, the return value of appCommonInit() will not be 0. So I think it is illegal to operate appCommonInit() twice in one process, right?

    Or, can someone tell me, what have these 3 functions (appCommonInit(), tivxInit(), tivxHostInit()) done in the A72 and C7x core?

  • Hi,

    This should be called only once.

    In the latest SDK, I see that there is a flag set for this to ensure this is called only once. 

    These functions are only called for A72.

    Regards,

    Nikhil

  • Hi, Nikhil

    Can you explain a little more, what has been done when these 3 functions (appCommonInit(), tivxInit(), tivxHostInit()) are called in A72?

    Besides, I am using SDK7.2, which was released by TI about 4 years ago.

    Best Regards,

    Zhiheng

  • Hi Nikhil,

    I have another question.

    Is it possible to run 2 different detection models in one process on the TDA4VM borad? For example, use one process to implement 2 different Object Detection models?

    Best Regards

    Zhiheng

  • Hi Zhiheng,

    Yes, we have the AVP demos in vision_apps which runs multiple tidl nodes in one process. 

    Can you explain a little more, what has been done when these 3 functions (appCommonInit(), tivxInit(), tivxHostInit()) are called in A72?

    appCommonInit() initializes all the memory req, IPC and other utilities on the A72.

    tivxInit() would register the A72 as target for the nodes that needs the same and also few initializations of tiovx framework on A72.

    tivxHostInit() would register the A72 as host, since in the SDK A72 is the host for OpenVX. So all host related initializations happen here.

    These should be called only once per process.

    Regards,

    Nikhil

  • Hi Nikhil,

    thank you very much for your explanation about the 3 functions (appCommonInit(), tivxInit(), tivxHostInit()).

    By the way, I just read the code of the AVP demo in vision_apps, and I found a big difference between AVP demo and my project: the AVP demo runs one only Graph (two TIDL-Node in this Graph), but my project runs two Graphs (each Graph contains one TIDL-Node).

    May I ask, have you guys (the talented engineers at TI) verified that a process with two Graphs (each contains a TIDL-Node) works well?

    Thank you!

    Best Regards

    Zhiheng

  • Hi

    May I ask, have you guys (the talented engineers at TI) verified that a process with two Graphs (each contains a TIDL-Node) works well?

    This specific usecase is not verified, but I do not think it should be different if it is separate graph or in same graph, as from the target's perspective, it would be just 2 tasks executing on the core (doesn't matter from which graph the node is)

    May I know if you are facing any issues in your implementation?

    Regards,

    Nikhil

  • Hi, Nikhil,

    yes I am still facing another issue seen in the following picture:

    Last week I made a mistake that I called the appCommonInit() function twice, so the program stopped when appCommonInit() is called for the second time without any error log printed. After I fixed the problem of appCommonInit(), this time the program runs into vxProcessGraph(), but another error still exits(wait graph failed).

    I don't know exactly how A72 and C7x work, I am just guessing C7x can only run one Graph at the same time. So this error occurred for the reason my implementation runs into the second Graph before the the first Graph is finished?

    I will appreciate if you can analyze this error a little bit.

    Best Regards

    Zhiheng

  • Hi,

    I just tried doing 2 graphs tidl node at my end. Please find the same below.

    The process graphs works as expected. Please refer your code against the same.

    /cfs-file/__key/communityserver-discussions-components-files/791/0726.main.c

    I would suggest using 2 separate tasks for better graph execution.

    Regards,

    Nikhil