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: Illegal instruction during EdgeAI-Tidl-Tools models compilation. Rebuilding TIDL-RT

Part Number: TDA4VM
Other Parts Discussed in Thread: SYSBIOS

Hi!

I have TDA4VM. I want to convert my own models to tidl format.

For the first step I want to launch examples with models provided by vendor.

I have downloaded SDKs and files from www.ti.com/.../TDA4VM



The problem is that I got "Illegal instruction" message in logs when try to compile models using command:

python3 onnxrt_ep.py -c

...

***************** Calibration iteration number 3 started ************************

~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~

Processing config file #0 : /home/stepin/edgeai-tidl-tools/model-artifacts/ss-ort-deeplabv3lite_mobilenetv2/tempDir/566TIDL_cast_out_tidl_io_.qunat_stats_config.txt
Illegal instruction

...

TIDL ALLOWLISTING LAYER CHECK: TIDL_E_QUANT_STATS_NOT_AVAILABLE] tidl_quant_stats_tool.out fails to collect dynamic range. Please look into quant stats log. This model will get fault on target.


Environment:

System: Windows 11
Processor: Ryzen 9 5900HX / Intel 12700

Steps to reproduce

1. Install Ubuntu 22.04 via WSL and install necessary packages (docker also have been used and has similar results)

wsl –install Ubuntu-22.04

sudo apt-get install libyaml-cpp-dev
sudo apt install python3-pip
sudo apt install protobuf-compiler
sudo apt-get install graphviz
sudo apt-get install libgtk-3-dev
sudo apt-get install cmake

2. Download edgeai-tidl-tools and setup environments:

git clone github.com/.../edgeai-tidl-tools.git

cd edgeai-tidl-tools

export SOC=am68pa

export PATH="$PATH:/home/stepin/.local/bin"

source ./setup.sh

2.1 Re-export environments after wsl session restart:

export PATH="$PATH:/home/stepin/.local/bin"

export TIDL_TOOLS_PATH=/home/stepin/edgeai-tidl-tools/tidl_tools

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TIDL_TOOLS_PATH

export ARM64_GCC_PATH=/home/stepin/edgeai-tidl-tools/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu

3. Go to folder "examples/osrt_python/ort" and launch:

python3 onnxrt_ep.py -c

All models from model zoo have this message and after launching examples I don't have results which provided as examples of succesfull launching.

--------------------------------------------------------------------------------------------------------------------------------
I found some forum topics where you offer to check which AVX instruction are supported by PC processor.

I do next command:

grep avx /proc/cpuinfo

and there were avx and avx2 for Ryzen and Intel.


BTW I tried to do next:

export TIDL_RT_AVX_REF=0

but it didn't help, I still got "Illegal instruction"

--------------------------------------------------------------------------------------------------------------------------------

Then I found next instruction in your guides:

Known Issue

In some of the old machines, user many observe "Illegal Instruction" error while importing model or performing inference on PC. This is observed because of new x86_64 instruction used in the pre-built binaries. To overcome this, user would need to re-built the TIDL-RT host emulation executable by executing below command

$ cd ${TIDL_INSTALL_PATH}
$ make tidl TARGET_PLATFORM=PC


I have downloaded SDKs:
  • ti-processor-sdk-linux-adas-j721e-evm-09_00_00_08
  • ti-processor-sdk-rtos-j721e-evm-09_00_00_02
and do next:

export PSDKL_PATH=/home/stepin/ti-processor-sdk-linux-adas-j721e-evm-09_00_00_08
export PSDKR_PATH=/home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02
export PSDK_INSTALL_PATH=$PSDKR_PATH
export TIDL_INSTALL_PATH=${PSDKR_PATH}/c7x-mma-tidl

export SOC=j721e

cp ${PSDKL_PATH}/board-support/prebuilt-images/boot-adas-${SOC}-evm.tar.gz ${PSDKR_PATH}/
cp ${PSDKL_PATH}/filesystem/tisdk-adas-image-${SOC}-evm.tar.xz ${PSDKR_PATH}/

cd ${PSDKR_PATH}

./sdk_builder/scripts/setup_psdk_rtos.sh

After it I also downloaded and build dependant libraries from here and put it into SDK RTOS folder: 
software-dl.ti.com/.../md_tidl_dependency_info.html


Then I go to the folder "c7x-mma-tidl" and do command:

make TARGET_PLATFORM=PC

It gives me a new import libraries but they have same size with libraris from TIDL_TOOLS archive, downloaded via setup.sh script in edgeai-tidl-tools repo.

When I try to do:

make tidl TARGET_PLATFORM=PC

I have next logs:
.
======== MAKING CUSTOM LIB =================
make -C ./ti_dl/custom -f makefile
make[1]: Entering directory '/home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/custom'
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/custom/tidl_custom.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/custom/tidl_custom_maxpooling.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/custom/./tidsp/tidl_custom_maxpool_ixX_oxX.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/custom/./tidsp/tidl_custom_maxpool_ixX_oxX_c7x.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/custom/./tidsp/tidl_custom_maxpool_ixX_oxX_cn.obj
make[1]: Leaving directory '/home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/custom'
======== MAKING TIDL ALGO =================
make -C ./ti_dl/algo -f makefile
make[1]: Entering directory '/home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/algo'
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/printv.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_alg.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_alg_utils.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_argmax.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_batchNorm.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_batchReshape.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_colorConversion.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_commonUtils.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_concat.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_const.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_conv2d_base.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_crop.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_custom_int.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_dataConvert.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_deconv2d.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_depthToSpace.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_detectionOutput.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_detectionOutput_score.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_device_functions.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_eltWise.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_flatten.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_function_mapping.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_gatherLayer.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_innerProduct.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_odOutputReformat.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_pad.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_pooling.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_preEmption.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_reduce.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_reshape.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_resize.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_roiPooling.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_scatterElements.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_shuffleChannel.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_slice.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_softmax.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_squeeze.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/tidl_transpose.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/./src/workload_ref_exec.obj
make[1]: Leaving directory '/home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/algo'
make -C ./ti_dl/algo/src/avx -f makefile
make[1]: Entering directory '/home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/algo/src/avx'
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/src/avx/./tidl_avx.obj
make[1]: Leaving directory '/home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/algo/src/avx'
.
======== MAKING TIDL PRIV ALGO =================
make -C ./ti_dl/algo/src/priv -f makefile
make[1]: Entering directory '/home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/algo/src/priv'
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/src/priv/./tidl_stalgo.obj
r - /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/out/PC/dsp/algo/release/ti_dl/algo/src/priv/./tidl_stalgo_workload.obj
make[1]: Leaving directory '/home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/algo/src/priv'
.
======== MAKING TIDL AND CUSTOM LIBRARIES =================
.
======== MAKING TIDL TEST =================
make -C ./ti_dl/test -f makefile final_install
make[1]: Entering directory '/home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/test'
SHELL=/bin/sh
TARGET_MAKEFILES=src/dsp_rtos/concerto.mak src/pc_linux/concerto.mak
Keep only PC platform in TARGET_COMBOS
undefined TIARMCGT_ROOT=
undefined TIARMCGT_LLVM_ROOT=
undefined GCC_SYSBIOS_ARM_ROOT=
undefined CGT6X_ROOT=
file CGT7X_ROOT="/home/stepin/ti/ti-cgt-c7000_3.1.0.LTS"
undefined GCC_WINDOWS_ROOT=
file GCC_LINUX_ROOT=/usr
undefined GCC_QNX_ROOT=
#######################################################################
TARGET_COMBO=PC:LINUX:x86_64:1:release:GCC_LINUX
Required system library libtidl_custom.a
Required system library libtidl_algo.a
Required system library libtidl_obj_algo.a
Required system library libtidl_priv_algo.a
Required system library libmmalib_cn_x86_64.a
Required system library libmmalib_x86_64.a
Required system library libcommon_x86_64.a
Required system library libC7100-host-emulation.a
Required system library libopencv_imgproc.a
Required system library libopencv_imgcodecs.a
Required system library libopencv_core.a
Required system library liblibtiff.a
Required system library liblibwebp.a
Required system library liblibpng.a
Required system library liblibjpeg-turbo.a
Required system library libIlmImf.a
Required system library libzlib.a
Required system library liblibjasper.a
Required system library libtidl_avx_kernels.a
Required system library libdl.so
Linking /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/test/out/PC/x86_64/LINUX/release/PC_dsp_test_dl_algo.out
Copying built libraries: /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/test/out/PC/x86_64/LINUX/release to /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/test/lib/PC/x86_64/LINUX/release
Copying built libraries: /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/test/out/PC/x86_64/LINUX/release/PC_dsp_test_dl_algo.out to /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/test/src/pc_linux/../..
TROLOLO /home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/sdk_builder/concerto
make[1]: Leaving directory '/home/stepin/ti-processor-sdk-rtos-j721e-evm-09_00_00_02/c7x-mma-tidl/ti_dl/test'

-----------------------------------------------------------------------------------------------------------------

So I want you to help me with next problems:

  • What should I do to fix Illegal instruction?
  • Am I use correct SDKs?
  • How should I launch tdil-rt rebuild?
  • Hi,

    What should I do to fix Illegal instruction?

    As pointed in posted question , this issue is related to AVX and AVX2 support on x86 side and we have seen that users when opted to AVX supported machine resolved this issues for them, however am not completely sure why this persist for you despite of AVX support.

    Could please use linux 22.04 machine and try to follow the documentations on edgeai tidl tools for env setup OR if you have any other linux version machine you can use docker setup inside it.

  • As I mentioned before - I used WSL (Windows Subsystem for Linux) and install Ubuntu 22.04 on it.
    Does it differ from separately installed Linux?

    I gonna try docker inside WSL and will write about results.

    ---------------------

    Also I am interested how can I rebuild TIDL-RT for TDA4VM.

    I found guides for 08_xx_xx_xx version (https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/08_00_00_12/exports/docs/tidl_j7_08_00_00_10/ti_dl/docs/user_guide_html/md_tidl_build_instruction.html)

    But SDKs which I downloaded have 09_xx_xx_xx version and it differs in folders names/etc.
    When I try to rebuild import libraries - they are the same (size, binary content) with libraries in downloaded through setup.sh libraries int tidl_tools folder.

  • We have tested the current repo setup in linux machines so to be on the same page, we recommend the same to you.

    With Latest 9.0 SDK we recommend users to use tidl tools repos for the model compilation and inference it servers vast verity of functionality.

    Lets us know if face same issue for tidl tools setup with linux machine.

    --

    Pratik

  • So I tried edgeai-tidl-tools repo on single linux ubuntu 22.04.

    No WSL, no docker, no VM - just Ubuntu.

    It happened again - illegal instruction error.

    I have avx/avx2 on my computer:

    I tried again to diasable avx by cmd: export TIDL_RT_AVX_REF=0 but it still doesn't help.


    What should I try now?

  • Noted,

    Can you confirm you have checked in tag 9.0 SDK while cloning the repo ?

    --

    Pratik

  • That is a command pipeline which I did during configuration.

  • Thanks for confirmation, We will have to check with our dev team on this.

    Let me get back to you on this.

    --

    Pratik

  • Ok, thanks!

    That's how I launch examples.



    ------

    Also I tried single Ubuntu only on Ryzen 9 5900HX (Laptop - Lenovo Legion7).

  • Thanks for the reply,

    We will get back to you.

  • So I have tried this scenario on different processors (Ryzen 5, Intel 12400, Intel 12650) - I have the same results with illegal instruction message (also I have it after TIDL_RT_AVX_REF=0)

    Can you tell me how can I rebuild TIDL-RT?

  • Hi,

    We are investigating this issue, as stated earlier this illegal instructions issue has been resolved by moving to AVX supported machines till date, however in your case we are seeing this behavior differently.

    To eliminate the SDK version related possibility on your machine could you try to run onnxrt model compilation scripts on our previous stable SDK 8.6 ?

  • Does it mean that I should fetch on tag 08_xx_xx_xx and try to launch scripts from there?


    Also I tried to debug it by logs printing and I have illegal instruction message here:

    tidl_rt.c:

    int32_t
    TIDLRT_create(sTIDLRT_Params_t *prms, void **handle)
    {
    ...
     TIDL_CreateParams *createPrms = &(rtHandle->createParams);

      tidl_tb_printf(0, "\n TEST LOG: TIDLRT_create\n");
      TI_CreateMemoryHandle(&memObj_DMEM0, L1Scratch, L1_MEM_SIZE);
      TI_CreateMemoryHandle(&memObj_DMEM1, L2Scratch, L2_MEM_SIZE);
      TI_CreateMemoryHandle(&memObj_SARAM0, L3Scratch, L3_MEM_SIZE);
      TI_CreateMemoryHandle(&memObj_EXTMEM, L4Scratch, L4_MEM_SIZE);
      /*-----------------------------------------------------------------
      Set algorithm parameters
      -----------------------------------------------------------------*/
      TIDL_createParamsInit(createPrms);
     
      tidl_tb_printf(0, "\n TEST LOG: 1 \n");

    ...

    }
  • Does it mean that I should fetch on tag 08_xx_xx_xx and try to launch scripts from there?

    Yes, clone the 8.6 SDK tag and perform the setup script post that you can run python osrt examples to verify the flow.

  • Can you do below updates and check if "illegal instruction" error gets resolved :

    In sdk_builder/concerto/compilers/gcc_linux.mak

    ifeq ($(TARGET_FAMILY),ARM)

    $(_MODULE)_COPT += -mapcs -mno-sched-prolog -mno-thumb-interwork

    ifeq ($(TARGET_OS),LINUX)

    $(_MODULE)_COPT += -mabi=aapcs-linux

    endif

    endif

     

    ifeq ($(TARGET_CPU), $(filter $(TARGET_CPU), X86 x86_64))

    $(_MODULE)_COPT += -march=x86-64 -pthread

    else ifeq ($(HOST_CPU),$(TARGET_CPU))

    $(_MODULE)_COPT += -march=native -pthread

    else ifeq ($(TARGET_CPU),M3)

    Note: The order of ifeq conditions above is reversed compared to existing code (x86-64 followed by host_cpu)

    Also, in c7x-mma-tidl repo (I know you have already tried below, putting here for completeness)

    makerules/rules.mk

      ifeq ($(TARGET_BUILD), debug)

        COMPILER_FLAGS += -std=c++14  -DHOST_EMULATION -w -D_HOST_BUILD -DGCC_BUILD

        GCC_DEBUG_CFLAGS :=-ggdb -ggdb3 -gdwarf-2

      else

        ifeq ($(DEVELOPER_BUILD), 0)

          COMPILER_FLAGS += -std=c++14 -O3 -DHOST_EMULATION -D_HOST_BUILD -DGCC_BUILD -march=x86-64

        else

          COMPILER_FLAGS += -std=c++14 -O3 -DHOST_EMULATION -D_HOST_BUILD -DGCC_BUILD -g -march=x86-64

        endif

      endif

  • Hi!

    Some updates:

    1) I've tried to install Ubuntu-18.04 and checkout on tags/80_06_00_05 and launch setup.sh. It fails on building step (I don't remember which part wasn't built, as I remember it was protobuf). This module requires python >=3.7 but Ubuntu 18.04 has 3.6.9. I tried to switch it to 3.7 but didn't succeed.

    So as the result - I can't launch 08_06_00_05 for now (I tried with WSL, Docker and single-installed Ubuntu-18.04).

    2) I've changed code like you wrote above.

    It helped, the process went further than before. I got correct images in output_images folder for some nets.

    But it still has "illegal instruction" in logs for some nets (see picture).

    Also I have to say that I didn't rebuild  tidl_model_import_relay.so because there were some problems with building that - and I left it as it was in downloaded tidl_tools archive.

    How I rebuild other libs:
    After make-code change I went to root folder for tidl (c7x-mma-tidl) and launch command "make TARGET_PLATFORM=PC". The I copy next libs/binaries to tidl_tools folder in edgeai-tidl-tools repo:

    • PC_dsp_test_dl_algo.out
    • tidl_model_import.out
    • tidl_model_import.so
    • tidl_model_import_onnx.so
    • tidl_model_import_tflite.so

    Also there were some libs I left untouched:

    • libtidl_onnxrt_EP.so
    • libtidl_tfl_delegate.so
    • libvx_tidl_rt.so
    • etc

    So I have some questions now:

    1) Do remaining "illegal instruction" messages depend on the *_relay.so lib?
    2) Should I rebuild and replace other libs/binaries/modules to fix that?

    ----------------------

    Picture with errors:
      

  • Thanks for the update, we will check with our TIDL expert and get back to you.