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.

TDA3: Vision SDK - Package content understanding

Part Number: TDA3

Hello,

I recently downloaded and installed the Vision SDK v3.0 and was trying to understand the organization of content present inside for developing Machine Vision apps. I am new to this and hence I have the following questions. Request someone to provide me the answers.

1. What is the difference between vlib and vxlib present within <Vision_SDK>/ti_components? Are they the same modules with different interfaces? There seems to be an overlap in the type of packages in both.

2. What is the difference between TIOVX library and vlib/vxlib? Is it just the interface for the same set of kernels/modules?

3. How to decide which library to use in a particular scenario if the same kernel / function is available in all libraries (TIOVX, VLIB, VXLIB)? Any guidelines for this?

Regards,

Pavan D

  • Hi Pavan,

    I have forwarded your question to vlib/vxlib experts.

    Regards,
    Yordan
  • Pavan Divakar72 said:

    1. What is the difference between vlib and vxlib present within <Vision_SDK>/ti_components? Are they the same modules with different interfaces? There seems to be an overlap in the type of packages in both.

    VLIB is TI's legacy library of optimized vision kernels originally optimized for C64+ DSP.  It started circa 2007.  Along the way, we added support for C674 and C66 DSP libraries, and added several new functions for C66 only version.  New features to VLIB stopped in 2015, and it has been in maintenance mode since then.  It is released in binary only.

    VXLIB is a new library released in the last year, and it started as a library of optimized vision kernels for C66 DSP that implements the Khronos OpenVX 1.1 standard kernel functions (though we plan to add TI extension kernels to be integrated in OpenVX).  If you look at the User guide, you can see how each kernel maps to which part of the Khronos OpenVX 1.1 specified kernels.  It follows a similar directory structure, test framework, and documentation style as VLIB for consistency, but it offers some additional enhancements:

    1. Available as full source so user can modify and recompile as needed.

    2. All API's follow consistent naming, parameter naming, and data structure conventions.

    3. All images use a common data structure to define width, height, data type, and stride/pitch.  In VLIB some kernels supported stride/pitch, and others didn't.  The stride/pitch parameter allows for processing a region within a larger buffer.

    4. Most kernels internally have a separate core function which implements a single loop, and can be called for the whole image if the strides are equal to the widths, or once for each line, if the strides are larger the  the width.  This enables the most optimal execution while enabling flexibility for the user.

    5. Maintains optimization while offering more flexibility:

    - 5a. doesn't constrain the user as to having a width as a multiple of some SIMD number (as much of VLIB did).

    - 5b. doesn't constrain the user to requiring buffer pointers to be a multiple of some value (as much of VLIB did).

    6. All kernels offer a checkParams function which can be independently called, or called from within the main function call for parameter checking (build option).

    7. Most kernels are written in such a way that they can be called multiple times in a tiled fashion across the image, assuming a DMA breaks up the image into blocks, and processes the image one block at a time. To this end, many also come with BAM plugins, which enable them to be called by TI's block based DMA framework (BAM).  This library is in the algframework of the vision SDK.

    Note: Both VXLIB and VLIB do not internally perform DMA transactions.  They operate directly on memory pointers given to it on the API.  If DMA's are to be used, it is done at a layer above VXLIB/VLIB by the user or other frameworks such as BAM.

    Pavan Divakar72 said:

    2. What is the difference between TIOVX library and vlib/vxlib? Is it just the interface for the same set of kernels/modules?

    TIOVX is TI's implementation of Khronos OpenVX 1.1 framework.  Using this framework, applications can define a graph of kernel processing function from the host CPU, and OpenVX will manage the dispatch and execution of the graph across the system for each frame.

    VXLIB is the underlying C66 DSP kernel library which implements the Khronos OpenVX kernels.

    Whereas TIOVX is the framework which has components compiled on all processing cores in the system, VXLIB is compiled only on the C66 DSPs.  TIOVX has a layer (in the kernels folder) which define the interface between the framework and the VXLIB calls.  In this layer, the framework can call one or many VXLIB functions for each OpenVX kernel.  Additionally, it can call the kernels directly using cache, or indirectly using BAM, which manages the DMA acceleration of the data access into L2 RAM before calling the VXLIB functions on each block.  By default in TIOVX, the BAM acceleration is enabled for kernels which it is supported.

    Pavan Divakar72 said:

    3. How to decide which library to use in a particular scenario if the same kernel / function is available in all libraries (TIOVX, VLIB, VXLIB)? Any guidelines for this?

    VXLIB and VLIB can be used on the C66 DSP independent of TIOVX.  If you already have your calling code running on the DSP and want to use acceleration from VXLIB or VLIB, you can use these libraries with direct calls.

    If you have your application running on an ARM processor and want to call into one of these libraries (running on C66 DSP), it is probably easier for you to take advantage of the integration TI has already done and use the TIOVX interface so you don't have to worry about inter-processor communication, cache maintenance, dma acceleration, and synchronization.

  • Hello Jesse,

    Thanks for the detailed information. You detailed insights has helped me understand this very well. Thanks.

    Regards

    Pavan D

  • Hello Jesse,

    I have a couple more questions. Request you to provide me the necessary information.

    1. I plan to use C66x DSP & EVE for implementing OpenCL kernels. Along with that, I may want to reuse some of the VXLIB/VLIB/DSPLIB/IVISION kernels/libraries from TI. Hope there a way for new OpenCL kernels to integrate/co-exist with these existing TI kernels/libraries. Some high level instructions or pointers will be highly appreciated.

    2. How does the TIOVX framework fit in with the “Links-and-Chains” framework in Vision SDK (J6/TDA2x)? Is TIOVX comparable to ALG_Plugins interfaces of Vision SDK? Is one of them more recommended by TI than the other?

    Regards,

    Pavan D

  • Pavan Divakar72 said:

    1. I plan to use C66x DSP & EVE for implementing OpenCL kernels. Along with that, I may want to reuse some of the VXLIB/VLIB/DSPLIB/IVISION kernels/libraries from TI. Hope there a way for new OpenCL kernels to integrate/co-exist with these existing TI kernels/libraries. Some high level instructions or pointers will be highly appreciated.

    I will request my colleague to answer this question as he is more familiar with OpenCL integration.

    Pavan Divakar72 said:

    2. How does the TIOVX framework fit in with the “Links-and-Chains” framework in Vision SDK (J6/TDA2x)?

    Currently, in current generation (J6/TDA2x), TIOVX is being brought up alongside “Links-and-Chains” framework in Vision SDK.  For now, we still need capture and display links.  Alg links can still be used as they have been.  However, TIOVX can be an alternative to using alg links.  An entire OpenVX graph which gets distributed across the cores can exist within a single alg link on the host.  There are examples of this in the tutorials section of TIOVX, where a camera capture can call an openvx graph and the results are displayed on the screen.

    Pavan Divakar72 said:

    Is TIOVX comparable to ALG_Plugins interfaces of Vision SDK?

    TIOVX is comparable to a graph framework of the alg links in Vision SDK.  You can conceptually replace all your alg links with a single alg link which calls OpenVX APIs.  The alg_plugin you use for each link is comparable to the kernel wrapper API's you have in the TIOVX/kernels folder.

    Pavan Divakar72 said:

    Is one of them more recommended by TI than the other?

    Links is the legacy, mature and stable path.  If you have existing applications on current generation using links, you can still use these and we will continue to support these for current generation parts.

    OpenVX is a much newer development which we are putting our future development efforts in since it is an open standard and is highly suited for TI's heterogeneous architectures.  TI has been heavily involved with the development of the OpenVX standard from the beginning.  One of the biggest benefits of using TI's TIOVX is the PC emulation mode.  You can develop your algorithms using TIOVX and compile and run them on the PC independent of most of VisionSDK and target platform.  Then when it is functionally complete, you can recompile for the target and run on the target platform.  This approach saves a lot of development and debug time.  If you prefer to start using OpenVX, you can start using it, and we will support bug fixes and continue to add features and improvements.  OpenVX is currently in beta for J6/TDA2x family.  What we mean by this is that it passes the OpenVX conformance tests, as well as additional robustness tests, but it hasn't been internally tested in non-trivial algorithm demos/applications yet.  We intend to do this internally by the time we make our end of year release, and in the mean time we also intend to continue to add features (such as graph pipelining) and support bug fixes on TDA2x platform. Algorithms which could benefit from graph pipelining will function, but not as optimally as will be the case when graph pipelining is supported.  Adding custom kernels can be done by following the pattern from existing OpenVX kernels, and one of the tutorials shows how to do this.  We are also adding scripts and specific app notes for this in the next few months which facilitate this effort.

  • Hi,
    It's not possible to run OpenCL and Vision SDK links on the same DSP. To do this we need to hack the openCL lib and this is not supported by default.

    regards, Shiju