Copyright (c) 2021-2024 Antmicro
Antmicro's collection of Yocto layers for machine learning and computer vision applications.
The meta-antmicro Yocto layer consists of the following sublayers:
- meta-antmicro-common
- meta-jetson-alvium
- meta-jetson
- meta-microros
- meta-ml-tegra
- meta-ml
- meta-rdfm-tegra
- meta-rdfm
- meta-antmicro-demo-base
All build dependencies for this project are included in a dedicated Dockerfile. To build a development container image, install Docker and run:
sudo docker build -t yoctobuilder .
This will create a Docker image that can be later used to create the BSP image.
The system-releases directory provides the Yocto build configuration files, as well as the Google repo tool to quickly start testing and development of Yocto-based systems.
For example, to build the system that will run the darknet-imgui-visualization demo with camera feed for one of the Jetson platforms:
- Create the Docker container, which will build the system image in the
<build-dir>directory that needs to be specified by the user:Note: This command runs a Docker container that will be removed upon closing (docker run --rm -v <build-dir>:/data -u $(id -u):$(id -u) -it yoctobuilder--rm), mounts the build directory in the/datapartition in the container (-v <build-dir>:/data) and builds the system as theoe-builderuser ($(id -u):$(id -u)), since Yocto does not allowrootbuilds. - Configure git settings and fetch the sources using the
repotool present in the Docker container (optionally, you can fetch the sources from your system to avoid git configuration):git config --global user.email "[email protected]" git config --global user.name "Your Name" cd /data repo init -u https://github.com/antmicro/meta-antmicro.git -m system-releases/darknet-edgeai-demo/manifest.xml repo sync -j`nproc` - Initialize the build environment:
source sources/poky/oe-init-build-env - Build the system for one of the Jetson targets, e.g.
jetson-agx-xavier-devkit:(other available targets are listed in the meta-tegra/conf/machine directory).PARALLEL_MAKE="-j $(nproc)" BB_NUMBER_THREADS="$(nproc)" MACHINE="jetson-agx-xavier-devkit" bitbake darknet-edgeai-demo - After a successful build, go to the
build/tmp/deploy/images/jetson-agx-xavier-devkitdirectory and untar the built tegraflash package:cd build/tmp/deploy/images/jetson-agx-xavier-devkit mkdir flash-directory cd flash-directory tar xzvf ../darknet-edgeai-demo-jetson-agx-xavier-devkit.tegraflash.tar.gz - Put the device in recovery mode.
- Make sure that the device is available for flashing - run
lsusb | grep -i nvidiaand check if any line appears. There should be something like:Bus 001 Device 006: ID 0955:7f21 NVIDIA Corp. APX - Flash the device:
sudo ./doflash.sh - After the device is successfully flashed, and a camera and screen are connected, you should see the object detection preview.