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.

AM62A7: Part of the Edgeai Memory Allocation Query

Part Number: AM62A7

Tool/software:

Hi TI Experts,

Customer is working on AM62A SDK9.2.

They are evaluating if 1GB DDR is sufficient for their usecase, so they are trying to know the default memory allocation of each part and what is the function or usage for each memory location.

Luckily we found that our below guide explains most of the default memory allocation, and customer also understands it fully.

https://dev.ti.com/tirex/explore/node?node=A__Ad0sB2qDldRUZR46v5qPxQ__AM62A-ACADEMY__WeZ9SsL__LATEST

However, there are still some default memory allocation which are not explained in the above guide, customer has summarized in the following picture.

So basically there are 5 memory allocation customer do not understand their usage/function.

linux, cma

edgeai_rtos_ipc_memory_region

edgeai_memory_region

edgeai_shared_region

edgeai_core_heaps

Customer may need your help to know the exact meaning of the above 5 memory allocation, so that they could better understand if they could skip or need to keep them.

Could you please help on that?

Thanks,

Kevin

  • Hi Kevin,

    Customer may need your help to know the exact meaning of the above 5 memory allocation, so that they could better understand if they could skip or need to keep them.

    These regions are critical and cannot be skipped if they wish to use Edge AI features for vision or imaging (ISP, deep learning).

    If these are modified, please do this from the vision_apps/platform/am62a/rtos/gen_linker_mem_map.py script within the Firmware Builder. It will ensure that DTS, linker scripts, and a few headers are kept in sync. This requires the AM62A Firmware Builder (available from SDK page, requires the user request access). Instructions on updating the memory map are in the firmware-builder User's Guide

    linux, cma

    • Linux continuous memory allocation. Linux will use this as a DDR region. It must exist, but can be made smaller

    edgeai_rtos_ipc_memory_region

    • Used for inter-processor communication, mostly for TIOVX (a critical middleware that facilitates application running across accelerators on the device). Should be left as is -- 16 MB is the minimum size

    edgeai_memory_region

    • Used for DMA in edgeai applications. Should also be left as is

    edgeai_shared_region

    • A region of DDR set aside for intermediate frames that will be shared between cores. This can be reduced, but will impact how large of buffer pools can be used (relative to

    edgeai_core_heaps

    • This is an aggregate size of multiple different heaps that are allocated to accelerator cores, nominally the R5F that manages VPAC (HWA with ISP, scaler enginer, lens distortion) and the C7xMMA (AI accelerator)
    • This can be reduced in size.

    These regions should generally be sized in multiples of 16MB

    1GB is possible but not trivial. Some applications may fail to initialize during a memory allocation phase. This step occurs within TIOVX during "verification"

    BR,
    Reese

  • Thanks for the expert explanation .  I get it.

    when the system is running, how can I check the memory usage of these part ? 

    For example ,CMA memory can check by this way .

     cat /proc/meminfo | grep Cma
    CmaTotal:         153600 kB
    CmaFree:          149412 kB
    

    How to check the memory usage related to edgeai? 

    Thanks,

    Arlen

  • Hi Arlen,

    Not all regions can be explicitly checked. Some of these like core heaps can be checked using app_utils/perf_stats. I am thinking of appPerfStatsCpuMemStatsPrint

    These functions can be accessed using the perf_stats API's, which are included in the SDK by default under /usr/include/processor_sdk/app_utils/utils/perf_stats. The library to link against should be libtivision_apps.so.VERSION_STRING (in your case, VERSION_STRING is 9.2.0

    You may find other functions within this perf_stats source code that are useful to use. An example of them in use is under /opt/edgeai-gst-apps/scripts/perf_stats, although I don't think this includes function for heap/EdgeAI memory region usage. 

    BR,
    Reese

  • Thanks !