Published On: November, 14, 2023 By: Eshtaartha Basu | Updated: November 7, 2024 by Neeraj Kumar Reddy Dantu
This tutorial will walk you through the steps required to generate Acceleration Ready Petalinux Software Components with Vitis-AI 2.0 and Xilinx Real Time (XRT) support. We will be using the OSDZU3-REF Petalinux BSP as an example starting point.
This tutorial can be used standalone or as Part 2 of a 4-part Acceleration tutorial series that will help you run Vitis-AI DPU-TRD based Face Detection demo, ADAS Detection demo (and other AI demos) on the OSDZU3-REF board. An overview of the flow is shown below:
This tutorial assumes the user is already familiar with the OSDZU3-REF Vivado and Vitis Design Flow by going through:
The user has already gone through Part 1 of this Tutorial series and has generated OSDZU3-REF_Accl_Platform.xsa file.
To make the existing OSDZU3-REF Petalinux BSP Acceleration Ready, the user needs to:
This tutorial will require the following software setup.
Notice: All the steps in this tutorial have been validated using Petalinux 2021.2 running on Ubuntu 20.04.LTS. However, the overall design flow should be similar for other Petalinux and host OS versions as well.
This section will describe the steps required to create a new Petalinux project using OSDZU3-REF Petalinux BSP.
a. mkdir petalinux
b. cd petalinux
c. Download OSDZU3-REF Petalinux BSP from OSDZU3-REF web page: https://octavosystems.com/osdzu3-ref-bsp-2021-2/
source /settings.sh
a.
petalinux-create -t project -n osdzu3-ref_accl_platform -s
i.
petalinux-config --get-hw-description=
In my case, the command is as follows:
petalinux-config --get-hw-description= ~/Downloads/osdzu3_sip-master_latest/osdzu3_sip-master/Vv_21_2/OSDZU3_Ref_Design/Vivado/ OSDZU3-REF_Accl_Platform.xsa
nano project-spec/meta-user/conf/user-rootfsconfig
# base XRT support:
CONFIG_xrt
# Packages for easy system management
CONFIG_dnf
CONFIG_e2fsprogs-resize2fs
CONFIG_parted
CONFIG_resize-part
# Packages for Vitis-AI dependencies support:
CONFIG_packagegroup-petalinux-vitisai
#Packages for natively building Vitis AI applications on target board:
CONFIG_packagegroup-petalinux-self-hosted
CONFIG_cmake
CONFIG_packagegroup-petalinux-vitisai-dev
CONFIG_xrt-dev
CONFIG_opencl-clhpp-dev
CONFIG_opencl-headers-dev
CONFIG_packagegroup-petalinux-opencv
CONFIG_packagegroup-petalinux-opencv-dev
# Packages for running Vitis-AI demo applications with GUI
CONFIG_mesa-megadriver
CONFIG_packagegroup-petalinux-x11
CONFIG_packagegroup-petalinux-v4lutils
CONFIG_packagegroup-petalinux-matchbox
# To install Vitis AI 2.0, VART 2.0 and dependent packages into rootfs
CONFIG_vitis-ai-library
CONFIG_vitis-ai-library-dev
CONFIG_vitis-ai-library-dbg
petalinux-config -c rootfs
Vitis-AI applications may use remote display feature to show machine learning results over SSH. To improve the remote display experience, replace the default Dropbear SSH with OpenSSH. OpenSSH has the potential for up to 4x faster data transmission.
Make Petalinux generate EXT4 Rootfs:
Make Petalinux use EXT4 Rootfs during boot:
Notice:
clk_ignore_unused: it tells Linux kernel not to turn off unused clocks. This is useful to keep clocks that only drive PL kernels ON because PL kernels are not represented in device tree.
Make Petalinux generate .EXT4 Root FS image output
During debugging, especially over JTAG, the hardware server on the Host machine talks to the processor regularly. If CPU idles during debugging, the system will hang due to incomplete AXI transactions. Therefore, it is beneficial to disable CPU IDLE during project development. It can be re-enabled in the final product.
Set sdhc1 to low-speed mode by adding the following lines to <your_petalinux_project_dir>/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi:
&sdhci1 {
no-1-8-v;
disable-wp;
};
Note: Reducing SD card speed allows for better card compatibility. This is not a requirement for Acceleration design.
Note: The generated sysroot package, sdk.sh, will be available in /images/linux directory. This will be useful in future steps.
From Petalinux project root,
BOOT.BIN file should be available under images/linux
The SD card image file, petalinux-sdimage.wic, should become available under /images/linux as shown below.
3. Check if the acceleration ready image boots by doing the following:
Continue the OSDZU3 Acceleration journey and generate an Acceleration Ready Vitis Platform by reading Part 3 of the 4-part Acceleration Tutorial.
Get notified of updates to this Application Note and all of our Technical Documentation.
“*” indicates required fields
| Revision Number | Revision Date | Changes | Author |
|---|---|---|---|
| 1 | 11/13/2023 | Initial Revision | Eshtaartha Basu |
There has been multiple revisions to the OSDZU3-REF and some of the documentation is for specific revisions.
The revision of your OSDZU3-REF is printed under the fan next to the Octavo Systems logo. See the image below.
If there are multiple versions of a document make sure you select the one that matches your revision.