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.

TDA2PXEVM: Using OpenCL on TDA2PX platform

Part Number: TDA2PXEVM

Hello,

I want to use OpenCL library in my application, I have added OpenCL File system patch as mentioned in user guide. In configs tda2xx_evm_linux_opencl
is available likewise if I want to use OpenCL on TDA2PX what all changes i need to do in configuration?

I have enabled OPENCL_INCLUDES flag inside tda2px_evem_linux_all and used IPU1_0 , A15 cores only disabled all others. With this configuration I am trying to build existing usecase that uses openclframcopy, but I am not able to make it run successfully I am getting cmemk.ko related errors.

Can you please confirm what I am doing on TDA2PX platform is correct or not?

Thanks in advance !

Regards,

Gaytari

  • Gayatri,

    Could you please point me to the user guide section and the SDK version that you are using for these trials?

    It would be useful to share the cmem.ko errors as well.

    Regards

    Karthik

  • Hi Karthik,

    I am referring to VisionSDK_Linux_UserGuide.pdf document section 2.4.2.2.4, I have applied OpenCL kernel patch as per instructions given in document. There is no document I could see that explains how to run an OpenCL usecase on TDA2PX board. So I just kept A15 and IPU1_0 cores enabled and built tda2px_evm_linux_all configuration, created dummy usecase NullSource (A15) -> Decode -> VPE -> Alg_OpenClFrameCopy (A15) -> Display. With this configuration I am able to create apps.out and firmware.While running binaries on EVM I have run load_ocl_kos.sh and opencl_env.sh.

    When I run load_ocl_kos.sh I am getting issue as below:

    /****************************************************************************************************************************************/

    root@dra7xx-evm:/opt/vision_sdk# ./load_ocl_kos.sh
    Opened log file: lad.txt
    numProcessors = 5 id = 0 baseId = 0
    Spawned daemon: /usr/bin/lad_dra7xx
    [ 159.355881] CMEMK module: reference Linux version 4.4.84
    [ 159.363996] CMEMK Error: Failed to request_mem_region(0xa9000000, 0x4000000)
    insmod: ERROR: could not insert module /opt/vision_sdk/cmemk.ko: Bad address
    insmod: ERROR: could not load module /opt/vision_sdk/debugss_kmodule.ko: No such file or directory
    insmod: ERROR: could not load module /opt/vision_sdk/gdbserverproxy.ko: No such file or directory
    /*********************************************************************************************/

    When I tried manually insert cmemk.ko module with command:

    /**********************************************************************************************************************************************/

    root@dra7xx-evm:/opt/vision_sdk# insmod cmemk.ko phys_start=0xa9000000 phys_end=0xaafa4000 pools=4x8294400
    [ 29.690953] CMEMK module: reference Linux version 4.4.84
    [ 29.697010] cmemk initialized
    root@dra7xx-evm:/opt/vision_sdk#

    /**********************************************************************************************************************************************/

    module is added but getting following error if I run apps.out

    /**********************************************************************************************************************************************/

    TIOCL FATAL: Failed to allocate 0x1fa4000 from CMEM block 0, allocated 0xaa7bb000

    /**********************************************************************************************************************************************/

  • Hello,

    Are there any inputs on this?

    Regards,

    Gayatri

  • hello all,

    Can somebody confirm if TDA2PX can support OpenCL library? if yes then what are necessary changes needs to be performed in build configuration.

    Early response would be highly appreciated, thank you in advance!

    Regards,

    Gayatri

  • Hi all/ ,

    To enable OpenCL support on TDA2PX I did following modifications:
    1) Build tda2px_evm_linux_all configuration with OPENCL_INCLUDE=yes to enable OpenCL and DDR3 memory size as 1024MB
    2) Created simple usecase
    NullSource (A15) -> Decode -> VPE -> Alg_OpenClFrameCopy (A15) -> Display
    3) Allocated 64MB of memory for CMEM module and loaded it correctly
    4) Both DSP1 and DSP2 are disabled and only A15 and IPU1 are enabled
    5) OpenCL kernel is loaded in binary format

    With all of above settings I am able to run the usecase but displayed output is not correct

    Following is the cldeviceInfo I am getting with running the usecase:

    Platform Name: TI AM57x Platform Vendor: Texas Instruments, Inc. Device Create Error: 0 Max Compute Units: 2 Max Work Item Dimensions: 3 Max Work Item Sizes: 1073741824, 1073741824, 1073741824 Max Work Group Size: 1073741824 Context Create: 0
    Quque Create Error: 0

    What might be possible reason for this?
    While running binaries on EVM I have run the opencl_set_env.sh also I did export TI_OCL_COMPUTE_UNIT_LIST="0"
    Still getting distorted output (which is not the exact input frame data but random garbage)

    Also to experiment I tried enabling only DSP2 this builds the binaries but give run time error as
    TIOCL FATAL: Internal Error: Number of message queues (1) does not match number of compute units (2)

    And if enable both DSP1 and DSP2 it gives linking error, undefined reference to EDMA fucntions

    Regards,
    Gayatri

  • Hi all,

    Now I am able to build and run the following usecase

    NullSource (A15) -> Decode -> VPE -> Alg_OpenClFrameCopy (A15) -> SgxFrmcpy (A15) -> Display_M4 (IPU1_0)

    This is giving correct output with settings as mentioned in earlier reply. But when I am closing the usecase I am getting segmentation fault, and that fault address is in memory region allocated to DSP2.

    I haven't enabled either of DSPs also I am getting following error/warning while running usecase:
    [   62.320851] omap_hwmod: mmu0_dsp2: _wait_target_disable failed
    [   62.326744] omap-iommu 41501000.mmu: 41501000.mmu: version 3.0
    [   62.335156] omap-iommu 41502000.mmu: 41502000.mmu: version 3.0
    [   62.352547] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
    [   62.358441] omap-iommu 40d01000.mmu: 40d01000.mmu: version 3.0
    [   62.366449] omap-iommu 40d02000.mmu: 40d02000.mmu: version 3.0

    Will enabling DSPs will resolve my issue?


    I tried enabling DSP1 it gives linking errors where as if I enable DSP2 binaries get generated and gives run time error as:


    TIOCL FATAL: Internal Error: Number of message queues (1) does not match number of compute units (2)


    Regards,
    Gayatri


  • Hi Gayatri,

        We have stopped supporting OpenCL on TDA2x using TDA2x software stack.  OpenCL is only supported on AM57x using Processor SDK for AM57x.

        From your error message, is it possible that one DSP has the OpenCL firmware, while the other DSP has a different (non-OpenCL) firmware?  You can try "TI_OCL_COMPUTE_UNIT_LIST="0" /usr/share/ti/examples/opencl/platforms/platforms" or "TI_OCL_COMPUTE_UNIT_LIST="1" /usr/share/ti/examples/opencl/platforms/platforms"

    -Yuan