1

I want to run OpenVINO with Neural Compute Stick 2 on an embedded linux system with Cortex-A53 and 2GB RAM. But, when I build OpenVINO by this tutorial BuildingForLinux on this platform, building process is always failed. (I think problem is small RAM size)

I had built OpenVINO on Raspberry Pi 4B (8G RAM) and x86_86 linux system (13G RAM), and run program successfully.

Can I build OpenVINO and it's Python API wrapper on other system and run it on embedded system?

Target Platform

  • CPU: Cortex-A53
  • Operating System/Platform => Ubuntu 18.04
  • RAM => 2GB
  • GCC => 7.5
  • Python => 3.6.9

Build Platform (1): Desktop

  • CPU: x86_64
  • Operating System / Platform => Ubuntu 18.04
  • GCC => 7.5
  • Python 3.6.9

Build Platform (2): Raspberry Pi 4B

  • Operating System/Platform => Ubuntu MATE 20.04
  • RAM: 8GB
  • GCC: 7.5
  • python 3.6.15
yeshuanova
  • 19
  • 1

1 Answers1

1

For cross-compilation you may refer to this guide. You can try to change import "FROM debian:stretch" to "FROM ubuntu:18.04" in the Dockerfile. However, it is not officially validated for Ubuntu usage so it might or might not work.

These are the required in the Dockerfile:

FROM ubuntu:18.04
USER root
COPY ./sources.list /etc/apt/sources.list

RUN dpkg --add-architecture arm64 && apt-get update
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    crossbuild-essential-arm64 \
    git \
    wget \
    libusb-1.0-0-dev:arm64 \
    libgtk-3-dev:arm64 \
    libavcodec-dev:arm64 \
    libavformat-dev:arm64 \
    libswscale-dev:arm64 \
    libgstreamer1.0-dev:arm64 \
    libgstreamer-plugins-base1.0-dev:arm64 \
    libgstreamer-plugins-base1.0-dev:arm64 \
    libpython3-dev:arm64 \
    libtbb-dev:arm64 \
    python-minimal \
    python3-distutils:arm64 \
    python3-pip \
    python3-setuptools \
    python-argparse \
    libglib2.0-dev-bin:arm64 \
    libglib2.0-dev:arm64  \
    && rm -rf /var/lib/apt/lists/*

RUN wget https://www.cmake.org/files/v3.14/cmake-3.14.3.tar.gz && \
    tar xf cmake-3.14.3.tar.gz && \
    (cd cmake-3.14.3 && ./bootstrap --parallel=$(nproc --all) && make --jobs=$(nproc --all) && make install) && \
    rm -rf cmake-3.14.3 cmake-3.14.3.tar.gz

RUN python3 -m pip install pip --upgrade
RUN python3 -m pip install numpy cython scikit-build opencv-python==4.5.3.56

RUN git config --global user.name "Your Name" && \
    git config --global user.email "you@example.com"

Make sure to include the referenced sources.list file from your previous post as part of arm64 contents.

Build and run docker:

docker image build -t arm64 arm64
docker run -it -v /home/user/openvino/:/openvino arm64 /bin/bash

Install requirements:

python3 -m pip install -r openvino/inference-engine/ie_bridges/python/requirements.txt
python3 -m pip install -r openvino/inference-engine/ie_bridges/python/wheel/requirements-dev.txt
python3 -m pip install -r openvino/inference-engine/ie_bridges/python/src/requirements-dev.txt

Run CMAKE:

cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE="../cmake/arm64.toolchain.cmake" \
-DENABLE_MKL_DNN=OFF \
-DTHREADS_PTHREAD_ARG="-pthread" \
-DENABLE_CLDNN=OFF \
-DENABLE_GNA=OFF \
-DENABLE_SSE42=OFF \
-DTHREADING=SEQ \
-DENABLE_OPENCV=ON \
-DNGRAPH_PYTHON_BUILD_ENABLE=ON \
-DNGRAPH_ONNX_IMPORT_ENABLE=ON \
-DENABLE_PYTHON=ON \
-DPYTHON_EXECUTABLE=/usr/bin/python3.6 \
-DPYTHON_LIBRARY=/usr/lib/aarch64-linux-gnu/libpython3.6m.so \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.6 ..

Run make:

make --jobs=$(nproc --all)

After exiting Docker (by pressing Ctrl+D), you can find the resulting binaries in the ~/openvino/bin/aarch64/ directory and the OpenCV installation in the ~/openvino/inference-engine/temp. Do not forget to complete the additional steps under instructions on target board for NCS2.

Rommel_Intel
  • 1,369
  • 1
  • 4
  • 8
  • These instructions do not appear to work for the 2022.1 release as there is not a openvino/inference-engine/ie_bridges folder, any hope of some pointers? – KillerKiwi Mar 31 '22 at 22:26