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.

J784S4XEVM: Run Own Program on Evaluation Board

Part Number: J784S4XEVM

Hello. I am trying to run my own program from my own repository I copied onto the SD card. I then ran minicom and logged into the evm as root user to run the program from the repository on the SD card on the board. When I try and run it using python3 script.py I get many module not found errors, since my script relies on external modules such as torch. Installing these modules using pip3 install does not resolve the errors. 

 

How can I run my own custom model in my own repository? I tried running it though a container image, but the singularity command is not found.

For context this is my own model I have already compiled and obtained artifacts from running on PC. Now i just want to run on the evm board. 

  • Hey,

    For running a model on EVM, you just need artifacts, model and a script similar to onnxrt_ep.py available on edgeai-tidl-tools. This should work without any issue if version compatibility are followed. You can check more on edgeai-tidl-tools repo.

    About your script.py which use some other packages like torch , if the packages are installed correctly then there should not be any issue using them. I tried pip3 install torch and used it on EVM, it works for me. Could you check if packages are installed correctly , like are simple things working like import torch etc ?

  • Hi thank you for your fast response. So I would have to manually pip install every module i am working with? I tried running singularity with a container and it said singularity command not found, and I m having difficulty installing. I also want to use some prebuilt wheels, how can i use those? 

  • is it possible I need a new image on the SD card?

  • Hi, I would suggest you to use pip install -r requirements.txt , you can also use prebuild wheels if they are compatible with EVM. I have never tried docker or singularity for TIDL on EVM, do you have any guide or instructions you are following for this setup? If you can provide more details, i can continue to help.

  • Usually I run under the edgeai_tidl_tools_x86_ubuntu_22 docker image. And i install all of these requirements under my requirements.txt 

    line-profiler
    wandb
    imageio
    lanelet2
    shapely
    omegaconf
    hydra-core
    pycountry
    artifacts/pytorch3d-0.7.7-cp310-cp310-linux_x86_64.whl
    https://download.pytorch.org/whl/cu118/torch-2.2.2%2Bcu118-cp310-cp310-linux_x86_64.whl#sha256=676b99efd763abd76cc4b3f70711ee2a0b85bdeafb656d4365740c807abbba69
    https://download.pytorch.org/whl/cu118/torchvision-0.17.2%2Bcu118-cp310-cp310-linux_x86_64.whl#sha256=69ea7cba762b958a74e8accbb1f92d822b59497b36d3aecae759bdbab75f85d2
    pytorch-lightning==1.9.0
    sqlalchemy==2.0.4
    sqlalchemy-file
    comet_ml
    loguru
    apache-libcloud
    psycopg2-binary
    fasteners
    invertedai
    pyarrow
    traitlets
    transformers


    this is what my run.sh script looks like to create the environment

    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 \
        bash -c "
            set -e
    
            if [ ! -d \"$VENV_DIR\" ]; then 
                echo ---------------------------
                echo SETTING UP PYTHON VENV
                echo ---------------------------
    
                apt update
                apt install -y python3.10-venv
                python3 -m venv $VENV_DIR
            fi
    
            if [ ! -d \"$ARTIFACTS_DIR\" ]; then
                echo artifacts/ folder not found. Exiting... 
                exit
            else
                source $VENV_DIR/bin/activate
                export SOC=$SOC
                source setup.sh
    
                rm -rf build lib bin
                mkdir build
                cd build/
                cmake ../examples/
                make
                cd ../
                
                pip install -r requirements.txt
            fi
    
            exec bash
        "

  • So, what exactly is the issue in this script ? Is 'pip install -r requirements.txt' not working on evm?

  • yes exactly it’s not working on evm

  • Could you share the output you are getting after running, pip install -r requirements.txt ? Also, if you have instructions to setup your docker style evm, i might be able to reproduce the issue at my end and help further.