TDA4VM: Build Failure in Emulation Mode

Part Number: TDA4VM

Tool/software:

Hii

I have successfully set up the Docker environment for edgeai_tidl_tools and am trying to build the example applications (e.g., object detection) in emulation mode. However, I am facing build failures.
The link steps i followed was from :- https://github.com/TexasInstruments/edgeai-tidl-tools/tree/master?tab=readme-ov-file

Compile and Validate on X86_PC

  • Execute below to compile and run inference of the model in X86_PC
    • Inference is validated with both Python and CPP APIs
mkdir build && cd build
cmake ../examples && make -j2 && cd ..
source ./scripts/run_python_examples.sh
python3 ./scripts/gen_test_report.py

In cmake step i m facing this issue .

And the error i m getting is as below ... 

root@77f085414cce:/home/root# cd build/
root@77f085414cce:/home/root/build# cmake ../examples && make -j2 && cd ..
-- Detected processor: x86_64
-- TARGET_DEVICE setting to: j721e
-- TARGET_CPU not specicfied using x86
-- CMAKE_BUILD_TYPE = Release PROJECT_NAME = edgeai_tidl_examples
CMake Warning at cmake/common.cmake:33 (message):
TENSORFLOW_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/post_process/CMakeLists.txt:2 (include)


CMake Warning at cmake/common.cmake:43 (message):
ONNXRT_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/post_process/CMakeLists.txt:2 (include)


CMake Warning at cmake/common.cmake:53 (message):
DLR_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/post_process/CMakeLists.txt:2 (include)


CMake Warning at cmake/common.cmake:67 (message):
OPENCV_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/post_process/CMakeLists.txt:2 (include)


-- Compiling for x86 with j721e config
-- CMAKE_BUILD_TYPE = Release PROJECT_NAME = edgeai_tidl_examples
CMake Warning at cmake/common.cmake:33 (message):
TENSORFLOW_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/pre_process/CMakeLists.txt:2 (include)


CMake Warning at cmake/common.cmake:43 (message):
ONNXRT_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/pre_process/CMakeLists.txt:2 (include)


CMake Warning at cmake/common.cmake:53 (message):
DLR_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/pre_process/CMakeLists.txt:2 (include)


CMake Warning at cmake/common.cmake:67 (message):
OPENCV_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/pre_process/CMakeLists.txt:2 (include)


-- Compiling for x86 with j721e config
-- CMAKE_BUILD_TYPE = Release PROJECT_NAME = edgeai_tidl_examples
CMake Warning at cmake/common.cmake:33 (message):
TENSORFLOW_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/utils/CMakeLists.txt:2 (include)


CMake Warning at cmake/common.cmake:43 (message):
ONNXRT_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/utils/CMakeLists.txt:2 (include)


CMake Warning at cmake/common.cmake:53 (message):
DLR_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/utils/CMakeLists.txt:2 (include)


CMake Warning at cmake/common.cmake:67 (message):
OPENCV_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/utils/CMakeLists.txt:2 (include)


-- Compiling for x86 with j721e config
-- CMAKE_BUILD_TYPE = Release PROJECT_NAME = tfl_main
CMake Warning at cmake/common.cmake:33 (message):
TENSORFLOW_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/tfl/CMakeLists.txt:6 (include)


CMake Warning at cmake/common.cmake:43 (message):
ONNXRT_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/tfl/CMakeLists.txt:6 (include)


CMake Warning at cmake/common.cmake:53 (message):
DLR_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/tfl/CMakeLists.txt:6 (include)


CMake Warning at cmake/common.cmake:67 (message):
OPENCV_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/tfl/CMakeLists.txt:6 (include)


-- Compiling for x86 with j721e config
-- CMAKE_BUILD_TYPE = Release PROJECT_NAME = tfl_priority_scheduling
CMake Warning at cmake/common.cmake:33 (message):
TENSORFLOW_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/advanced_examples/tfl/CMakeLists.txt:6 (include)


CMake Warning at cmake/common.cmake:43 (message):
ONNXRT_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/advanced_examples/tfl/CMakeLists.txt:6 (include)


CMake Warning at cmake/common.cmake:53 (message):
DLR_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/advanced_examples/tfl/CMakeLists.txt:6 (include)


CMake Warning at cmake/common.cmake:67 (message):
OPENCV_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/advanced_examples/tfl/CMakeLists.txt:6 (include)


-- Compiling for x86 with j721e config
-- CMAKE_BUILD_TYPE = Release PROJECT_NAME = ort_priority_scheduling
CMake Warning at cmake/common.cmake:33 (message):
TENSORFLOW_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/advanced_examples/ort/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:43 (message):
ONNXRT_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/advanced_examples/ort/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:53 (message):
DLR_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/advanced_examples/ort/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:67 (message):
OPENCV_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/advanced_examples/ort/CMakeLists.txt:7 (include)


-- Compiling for x86 with j721e config
-- CMAKE_BUILD_TYPE = Release PROJECT_NAME = edgeai_tidl_examples
CMake Warning at cmake/common.cmake:33 (message):
TENSORFLOW_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/advanced_examples/utils/CMakeLists.txt:2 (include)


CMake Warning at cmake/common.cmake:43 (message):
ONNXRT_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/advanced_examples/utils/CMakeLists.txt:2 (include)


CMake Warning at cmake/common.cmake:53 (message):
DLR_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/advanced_examples/utils/CMakeLists.txt:2 (include)


CMake Warning at cmake/common.cmake:67 (message):
OPENCV_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/advanced_examples/utils/CMakeLists.txt:2 (include)


-- Compiling for x86 with j721e config
-- CMAKE_BUILD_TYPE = Release PROJECT_NAME = tidlrt_clasification
CMake Warning at cmake/common.cmake:33 (message):
TENSORFLOW_INSTALL_DIR is not set
Call Stack (most recent call first):
tidlrt_cpp/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:43 (message):
ONNXRT_INSTALL_DIR is not set
Call Stack (most recent call first):
tidlrt_cpp/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:53 (message):
DLR_INSTALL_DIR is not set
Call Stack (most recent call first):
tidlrt_cpp/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:67 (message):
OPENCV_INSTALL_DIR is not set
Call Stack (most recent call first):
tidlrt_cpp/CMakeLists.txt:7 (include)


-- Compiling for x86 with j721e config
-- CMAKE_BUILD_TYPE = Release PROJECT_NAME = dlr_main
CMake Warning at cmake/common.cmake:33 (message):
TENSORFLOW_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/dlr/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:43 (message):
ONNXRT_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/dlr/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:53 (message):
DLR_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/dlr/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:67 (message):
OPENCV_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/dlr/CMakeLists.txt:7 (include)


-- Compiling for x86 with j721e config
-- CMAKE_BUILD_TYPE = Release PROJECT_NAME = tidlrt_priority_scheduling
CMake Warning at cmake/common.cmake:33 (message):
TENSORFLOW_INSTALL_DIR is not set
Call Stack (most recent call first):
tidlrt_cpp/advanced_examples/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:43 (message):
ONNXRT_INSTALL_DIR is not set
Call Stack (most recent call first):
tidlrt_cpp/advanced_examples/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:53 (message):
DLR_INSTALL_DIR is not set
Call Stack (most recent call first):
tidlrt_cpp/advanced_examples/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:67 (message):
OPENCV_INSTALL_DIR is not set
Call Stack (most recent call first):
tidlrt_cpp/advanced_examples/CMakeLists.txt:7 (include)


-- Compiling for x86 with j721e config
-- CMAKE_BUILD_TYPE = Release PROJECT_NAME = ort_main
CMake Warning at cmake/common.cmake:33 (message):
TENSORFLOW_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/ort/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:43 (message):
ONNXRT_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/ort/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:53 (message):
DLR_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/ort/CMakeLists.txt:7 (include)


CMake Warning at cmake/common.cmake:67 (message):
OPENCV_INSTALL_DIR is not set
Call Stack (most recent call first):
osrt_cpp/ort/CMakeLists.txt:7 (include)


-- Compiling for x86 with j721e config
-- Configuring done
-- Generating done
-- Build files have been written to: /home/root/build
[ 6%] Building CXX object osrt_cpp/post_process/CMakeFiles/post_process.dir/post_process.cpp.o
[ 6%] Building CXX object osrt_cpp/pre_process/CMakeFiles/pre_process.dir/pre_process.cpp.o
/home/root/examples/osrt_cpp/pre_process/pre_process.cpp:67:10: fatal error: opencv2/core/core.hpp: No such file or directory
67 | #include <opencv2/core/core.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [osrt_cpp/pre_process/CMakeFiles/pre_process.dir/build.make:76: osrt_cpp/pre_process/CMakeFiles/pre_process.dir/pre_process.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:304: osrt_cpp/pre_process/CMakeFiles/pre_process.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /home/root/examples/osrt_cpp/post_process/post_process.cpp:64:
/home/root/examples/osrt_cpp/post_process/post_process.h:74:9: fatal error: opencv2/core.hpp: No such file or directory
74 | #include<opencv2/core.hpp>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [osrt_cpp/post_process/CMakeFiles/post_process.dir/build.make:76: osrt_cpp/post_process/CMakeFiles/post_process.dir/post_process.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:278: osrt_cpp/post_process/CMakeFiles/post_process.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

ThankYou . 

  • Hello; Thank you for the question.

    First of all, I would suggest to make sure to build and setup the docker correctly. Usually, if the docker was setup properly, you should not have this kind of environment issue. I listed the steps below, please verify with your setup steps.

    1. Clone Github repo and checkout the corresponding TIDL/SDK version

    user@pc:~$ git clone github.com/.../edgeai-tidl-tools.git
    user@pc:~/edgeai-tidl-tools$ cd edgeai-tidl-tools
    user@pc:~/edgeai-tidl-tools$ git checkout <TAG Compatible with your SDK version> // for example "git checkout 10_01_04_00"

    2. One time setup for Docker:

    user@pc:~/edgeai-tidl-tools$ source ./scripts/docker/setup_docker.sh

    3. Build the docker image:
    user@pc:~/edgeai-tidl-tools$ source ./scripts/docker/build_docker.sh

    4. Run the docker image:

    user@pc:~/edgeai-tidl-tools$ source ./scripts/docker/run_docker.sh

    OR, run the command below in your shell
    sudo docker run -w /home/root -it --rm --shm-size=4096m -v /shared:/shared --mount source=$(pwd),target=/home/root,type=bind edgeai_tidl_tools_x86_ubuntu_22

    Second;

    5. After running the docker container, run the setup script:

    root@container:/home/root$ export SOC=<Your SOC name>
    root@container:/home/root$ export TIDL_TOOLS_TYPE=<Your Tools Type (CPU|GPU)>
    root@container:/home/root$ source ./setup.sh

    I saw your SOC has been setup, if not, make sure to do so

    export SOC=j721e

    Also, I highlighted the "source ./setup.sh", this step is very import, it can not be skipped.

    I suggest to start a new docker. If not, then make sure to delete your old "build lib bin" to have a clean build.

    rm -rf build lib bin

    Hope these will help.

    Best regards

    Wen Li