Software Preparation
This section introduces the following 3 required software preparations:
Required Image/Code Version
- Debian12 (202409)
- debian-deb (To adapt to the updated files such as Debian kernel packages required by Hailo)
- Tappas (3.30.0, daffd36ecab5110d47107255fd7ec4c779758f2e)
- HailoRT (v4.19.0, ac19e12b86170e1b0967e7d8aa607a0100cb0077)
- HailoRT-driver (v4.19.0, eb2a8649752abd424c6d2e5109e9ec92d6d2d5f6)
- HailoRT and Tappas patches (Used for adapting VisionFive 2's HailoRT and Tappas patches)
- NpuDetectorLib demo
Image Flash/Dependency Library Installation
- Please refer to the link to flash Debian into SD
card.Tip: StarFive recommends you to perform following operations under user account to avoid permission exceptions caused by root account.
- Update kernel and head files:
- Run the following command to download and extract the hailort-deb-1.tar.gz file:
$ tar -xzvf hailort-deb-1.tar.gz
- Run the following command to update u-boot-menu:
$ cd hailort-deb $ sudo dpkg -i u-boot-menu_4.2.2-SF113_all.deb
- Run the following command to update the kernel, header files, libc library, and VPU driver:
$ cd 6.6 $ sudo dpkg -i ./*
- Run the following command to reboot system:
$ sudo reboot
- Run the following command to download and extract the hailort-deb-1.tar.gz file:
- Run the following command to install dependencies:
$ sudo apt install make cmake automake build-essential autoconf bc bison meson flex wget curl git git-lfs libgirepository1.0-dev gcc g++ rsync x11-utils -y
- Install Python environment. Install python3-platformdirs. The new version of Snapshot does not support python3 platformdirs below version 3.0 and requires manual retrieval and installation:
$ wget https://snapshot.debian.org/archive/debian/20221210T034654Z/pool/main/p/platformdirs/python3-platformdirs_2.6.0-1_all.deb && sudo dpkg -i python3-platformdirs_2.6.0-1_all.deb $ sudo apt install python3.11 python3.11-dev python3-setuptools python3-virtualenv python3-pip python-gi-dev -y
- Run the following command to install GStreamer related library:
$ sudo apt install libgstreamer-plugins-bad1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev -y
- Run the following command to install OpenCV and GStreamer add-ons:
$ sudo apt install libopencv*-dev libssl-dev pciutils libcairo2-dev libzmq3-dev gstreamer1.0-tools -y
- Execute the following command to install Rust:Note: This is required when compiling packages such as pydantic.
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
As shown in the following figure, when the Rust installation option pops up, please select option 1:Figure 1. Select 1 After completing the installation, run the following command to add the Rust environment variable:$ source "$HOME/.cargo/env"
- Run the following command to specify python3 as python3.11:
$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
Obtain Source Code and Apply Patches
- Run the following command to obtain the Tappas source code and apply
it:
$ git clone https://github.com/hailo-ai/tappas.git $ cd tappas $ git checkout daffd36ecab5110d47107255fd7ec4c779758f2e $ cp path_to_hailo_patches/tappas_h8l/* ./ $ git apply 0001-Added-tappas-adaptation-to-VisionFive2.patch $ git apply 0002-Add-demo-for-h8l-on-vf2.patch
- Run the following command to obtain the HailoRT source code and apply it:Note: Please pull and store it in the Tappas path for future compilation.
$ mkdir -p tappas/hailort $ cd tappas/hailort $ git clone https://github.com/hailo-ai/hailort.git sources $ cd source $ git checkout ac19e12b86170e1b0967e7d8aa607a0100cb0077 $ cp path_to_hailo_patches/0001-Added-HailoRT-adaptation-to-VisionFive2.patch ./ $ git apply 0001-Added-HailoRT-adaptation-to-VisionFive2.patch
- Run the following command to obtain the HailoRT-drivers source code and apply
it:
$ cd ~ $ git clone https://github.com/hailo-ai/hailort-drivers.git $ cd hailort-drivers $ git checkout eb2a8649752abd424c6d2e5109e9ec92d6d2d5f6