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: Custom Node

Part Number: TDA4VM


Dear Sir,

I need your suggestion for the below requirement.

This is my 4-camera pipeline:

Capture > Scalar > Pre-Proc > TIDL > X Node

This X Node input

Input 1:LUT Table ( Camera specific)

Input 2: TIDL Output

Can this X node be replicated as it has a different LUT but TIDL input is mapped with 0 index?

What can be the best design for this problem?

Thanks and Regards,

Vyom Mishra

  • Hi,

    Yes, it can be replicated. 

    In this case, you should take care internal to the process function to provide the correct LUT to the appropriate camera index.

    Regards,

    Nikhil

  • Dear Sir, 

    Thanks for the response!

    X Node logic is the same for all cameras. Only the different LUTs will be making changes in the output.

    As per the understanding, 

    the object_array  0th index generally has all num_channel input/output.

    Query 1: Is it possible to manually fill the LUT Object array at the 0th index for all 4 cameras LUT?

    Query 2:

    If my input(LUT) is an Object array, filled with respective LUTs at index(0) for all 4 channels(num_channel) and then its 0 index is passed to X node including the TIDL output [0]( as done normally for all replicated nodes), will my X node will be replicated?

    Please let me know your opinion on this.

    Kindly confirm the same.

    Thanks and Regards,

    Vyom Mishra

  • Hi,

    Query 1: Is it possible to manually fill the LUT Object array at the 0th index for all 4 cameras LUT?

    If your LUT is an object array same as the camera output object array, then you could send the 0th instance of the LUT as input to the node and 0th instance of camera output as input to the node and then do replicate node, then it should be taken care of.

    If my input(LUT) is an Object array, filled with respective LUTs at index(0) for all 4 channels(num_channel) and then its 0 index is passed to X node including the TIDL output [0]( as done normally for all replicated nodes), will my X node will be replicated?

    yes, if you have a LUT object array where your 0th instance has LUT for 0th camera, 1st instance has LUT for 1st camera, etc.. then you could pass the LUT 0th instance to the node and replicate the node.

    Regards,

    Nikhil

  • Hi Vyom,

    Your response somehow got deleted from your end. 

    Pasting the same here 

    Dear Sir,

    I have integrated the X Node with the application, but I am not able to get the Process function running of the custom Node (X Node).

    I have kept a print inside the kernel process function, but it is not printing on the console.

    What could be the possible reason for Node not running?

    Note:

    - No errors on the logs

    - Application running in real-time with no issue 

    Thanks and Regards,

    Vyom Mishra

  • May I know which core is X Node running ON?

    Is the application running?

    Do you get logs from the create function of X node?

    Regards,

    Nikhil

  • Dear Sir,

    I was able to resolve the issue, so I deleted the query.

    Thanks for your time.

    However, I have a query related to the timing of the custom kernel.

    My custom kernel is running on A72 and I want to optimize the same.

    Input to the kernel is TIDL output and LUTs for each channel.

    I have stored LUTs using copyImagePatch 

    vxCopyImagePatch(mesh_img_in_arg_right,
    	               	                         &rect, 0,
    	               	                         &image_addr,
    	               	                         (vx_uint32*)lutTable_right,
    	               	                         VX_WRITE_ONLY,
    	               	                         VX_MEMORY_TYPE_HOST);
    	               	    

    I assume the host memory is in DDR and the kernel is running on A72 so memory reading might consume more time.

    Please let me know if my understanding is correct, if yes could you please suggest how to write it to A72 memory or the other best possible way to reduce the total time of the custom Replicated Node?

    Thanks and Regards,

    Vyom Mishra

  • Hi,

    timing of the custom kernel.

    This depends on what you are doing in the process function of the custom kernel.

    This is where you would focus on optimizing.

    I assume the host memory is in DDR and the kernel is running on A72 so memory reading might consume more time.

    using vxCopyImagePatch would do a memcpy to the OpenVX allocated memory (i.e. DDR_SHARED_MEM). So your LUT would be in DDR_SHARED_MEM.

    All the nodes running on A72 would take the data/buffers from this region itself.

    I believe you are doing vxCopyImagePatch only during initialization right and not during every process function execution right? 

    If my understanding is correct, then your focus should be to optimize the contents in the process function.

    Regards,

    Nikhil

  • Dear Sir,

    Thanks for the response!

    Your suggestions help a lot!

    My custom node profiling time is 34ms approx, I would like to run the Custom Node on GPU.

    I would like to know, how(API similar to vxCopyImagePatch),  I will be uploading the LUTs(once) so that the custom node can access the data while running on GPU.

    If any reference is present, please let me know.

    Thanks and Regards,

    Vyom Mishra

  • Hi,

    I would like to know, how(API similar to vxCopyImagePatch),  I will be uploading the LUTs(once) so that the custom node can access the data while running on GPU.

    By running a node on GPU, do you mean to use OpenGL APIs and access the GPU and render the buffers using the same?

    If yes, tivxGlSrvNode() which uses OpenGL APIs internally. You could refer the target implementation of this node in vision_apps/kernels/srv/gpu/vx_gl_srv_target.c

    This node is being utilized in the surround view demos in vision_apps/apps/srv_demos/app_srv_camera

    Regards,

    Nikhil