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.

Linux/PROCESSOR-SDK-TDAX: Failed to run OpenCl examples on TDA2x using VISION SDK

Part Number: PROCESSOR-SDK-TDAX


Tool/software: Linux

Hi,

Version of Vision SDK : PROCESSOR_SDK_VISION_03_03_00_00

I have followed all the steps given in TDA2x User Guide. 

MAKECONFIG?=tda2xx_evm_linux_opencx

ti-cgt-c6000_8.1.0/bin path is present in system PATH

make linux

make linux_install

make –s –j depend

make –s –j 

Build is successfull.

Also to flash SD Card , I followed the step given in same userguide.

Board is booting successfully.

I am not  able to execute this example /usr/share/ti/examples/opencl/vecadd, getting cmem error with ti-mctd

and when i am  running : ./ti-mctd

Error : CmemAllocator::CmemAllocator(): Assertion `msmc_alloc_dsp_addr_ == msmc_addr' failed.

I have attached boot log here for more information.

My main intersest is to run simple opencv example with opencl ON and opencl OFF to check opencv performance with dsp offloading.

I also tried with

MAKECONFIG?=tda2xx_evm_linux_all. 

I am getting same error.

Error in Log:

Dec 27 23:07:49 dra7xx-evm systemd-modules-load[157]: Failed to find module 'cmemk'
Dec 27 23:07:49 dra7xx-evm systemd-modules-load[157]: Failed to find module 'cryptodev'
Dec 27 23:07:49 dra7xx-evm systemd-modules-load[157]: Failed to find module 'gdbserverproxy'
Dec 27 23:07:49 dra7xx-evm systemd-modules-load[157]: Failed to find module 'uio_module_drv'

Jun 20 10:05:01 dra7xx-evm ti-mctd[721]: CMEM Error: init: Failed to open /dev/cmem: 'No such file or directory'
Jun 20 10:05:01 dra7xx-evm ti-mctd[721]: ti-mctd: /jenkins/psdkla-krogoth/release/dra7xx/yocto/tisdk/build/arago-tmp-external-linaro-toolchain/work/dra7xx_evm-linux-gnueabi/opencl/1.1.12.0-r0.0/git/host/mct-daemon/cmem_allocator.h:63: CmemAllocator::CmemAllocator(): Assertion `status != -1' failed.

Reagrds,

Sagar

1205.log.txt

  • Hi Sagar,

    it seems that the cmem.ko module is missing from your filesystem.
    Please follow chapter "1.1 Building cmem" in VisionSDK_UserGuide_opencx.pdf (and referred there wiki and VisionSDK_Linux_UserGuide.pdf ) to build and install cmem module.

    Regards,
    Yordan
  • Hi Yordan,

    Is it cmemk.ko or cmem.ko
    I can see cmemk.ko is generated and it is present in /opt/vision_sdk folder

    Regards,
    Sagar
  • Also,

    I can see 3 folders

    /media/ee209200/rootfs/lib/modules/4.4.84-00105-gc66ba60-dirty/extra
    - cmemk.ko not present

    /media/ee209200/rootfs/lib/modules/4.4.84-00105-gc66ba60e1092-dirty/extra
    - cmemk.ko not present

    /media/ee209200/rootfs/lib/modules/4.4.84-g742f84423d/extra
    - cmemk.ko is present here

    and from boot log , we can see board has chosen Linux version 4.4.84-00105-gc66ba60-dirty to load the modules.
  • Hi Sagar,

    you are right - it is cmemk.ko.
    Did you followed the steps in "4.3 Run demos" from VisionSDK_Linux_UserGuide.pdf - there are some scripts such as "load_ocl_kos.sh", "opencl_env.sh", etc. that needs to be run in order to prepare environment for OpenCL usecases.

    Regards,
    Yordan
  • Hi Yordan,

    I tried that also .
    ------------------------------------------------------------------------------------------------------
    load_ocl_kos.sh

    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
    [ 177.418655] CMEMK module: reference Linux version 4.4.84
    [ 177.427058] allocated heap buffer 0x40400000 of size 0x100000
    [ 177.433373] cmemk initialized
    -------------------------------------------------------------------------------------------------------

    root@dra7xx-evm:/opt/vision_sdk# source opencl_env.sh

    -------------------------------------------------------------------------------------------------------
    cat /proc/cmem

    root@dra7xx-evm:/usr/share/ti/examples/opencl/vecadd# cat /proc/cmem
    Block 0: Pool 0: 1 bufs size 0x4000000 (0x3ffffff requested)
    Pool 0 busy bufs:
    id 0: phys addr 0xa9000000 (cached)
    Pool 0 free bufs:
    -------------------------------------------------------------------------------------------------------
    ti-mctd

    root@dra7xx-evm:/opt/vision_sdk# ti-mctd
    [ 271.456658] CMEMK Error: ALLOCCACHED: No free buffers available for pool 0
    CMEM Error: allocPool: ioctl CMEM_IOCALLOCCACHED failed from pool 0: -1
    ti-mctd: /jenkins/psdkla-krogoth/release/dra7xx/yocto/tisdk/build/arago-tmp-external-linaro-toolchain/work/dra7xx_evm-linux-gnueabi/opencl/1.1.12.0-r0.0/git/host/mct-daemon/cmem_allocator.h:80: CmemAllocator::CmemAllocator(): Assertion `ddr_alloc_dsp_addr_ == ddr_addr' failed.
    Aborted (core dumped)
    -------------------------------------------------------------------------------------------------------
    Running opencl vecadd example

    root@dra7xx-evm:/usr/share/ti/examples/opencl/vecadd# ./vecadd
    [ 452.418218] CMEMK Error: ALLOCCACHED: No free buffers available for pool 0
    CMEM Error: allocPool: ioctl CMEM_IOCALLOCCACHED failed from pool 0: -1
    TIOCL FATAL: Failed to allocate 0x4000000 from CMEM block 0, allocated 0x0


    I am guessing the error is due to ti-mctd not loading during boot. Because, ti-mctd should load and initialize while booting as per the other e2e thread for opencl to work properly.

    Regards,
    Sagar
  • Hi Sagar,

    I am not sure about this error, I have pinged VisionSDK experts to help how to run OpenCL.

    Regards,
    Yordan