When Xilinx launched Kria, they also provided a method for quickly deploying apps. This project tutorial takes a deep dive into how to create a custom Kria app.
Introduction
On April 20, 2021, Xilinx announced Kria, their newest product portfolio of system on modules (SOMs). These adaptive production ready SOMs, are designed to enable users to accelerate their innovation at the edge.
At that time, I wrote an introductory tutorial:
https://avnet.me/kria-tutorial
which covered one of the Kria apps that were available at launch:
- kv260-smartcam
- kv260-aibox-reid
Since then, several other Kria apps have been made available for the KV260 Vision AI Starter Kit, from Xilinx and third party providers:
- kv260-defect-detect
- kv260-nlp-smartvision
- ..
This project will describe how to deploy one of the VVAS (Vitis Video Analytics SDK) examples (smart_model_select) to the KV260 Vision AI Starter Kit, as a Kria app.
Overview of the Vitis framework
Before going further, it is important to understand the various tools and frameworks available from Xilinx.
Vitis is a complete development environment, which allows you to quickly create complex custom applications.
Vitis includes:
- hardware platforms, which span cloud to edge targets.
- the Core development kit, which includes:
- divers and runtime
- compilers, and debugging tools
- accelerated libraries, covering a range of targeted applications
- as well as support for domain-specific development environments, such as the following frameworks for AI development:
- Caffe
- TensorFlow
- PyTorch
Vitis includes open-source, performance optimized libraries that offer out of box acceleration.
Of the many acceleration libraries, we have “AI”, which makes use of the Deep Learning Processing Unit (or DPU).
Vitis-AI encapsulates this AI portion of the Vitis offering.
Vitis-AI includes the Xilinx Model Zoo, which provides an ever-increasing number of pre-optimized models, directly targetable to the DPU core.
The latest addition to the Vitis framework is the Vitis Video Analytics SDK, or VVAS for short. The latest addition to the Vitis framework is the Vitis Video Analytics SDK, or VVAS for short.
VVAS is the integration of Vitis & Vitis-AI into the GStreamer framework, allowing easier application development. GStreamer is open-source and provides the infrastructure for:
- creation of dynamic real-time media pipelines
- handling of buffer management, including zero-copy, etc...
- definition of an open-source plug-in structure for extending functionality
Getting Started with the Pre-Built SD Image
Before diving into the details of how to build the custom app, let’s first run the final result.
The following pre-built SD card image is provided for this project:
- kv260-vvas-sms-2021-1 :
http://avnet.me/kv260-vvas-sms-2021-1-image
(2021-12-29 - MD5SUM = 37a58475ce16da9a056cbd359647d453)
The following hackster.io project provides detailed instructions on running the VVAS smart_model_select on the Kria KV260 Vision AI Starter Kit as an app called “kv260-vvas-sms”, which is the end result of this step-by-step tutorial:
Development Flow
The following diagram illustrates the development flow we will use to build this custom Kria app from sources.
Once built, the deployment for our custom Kria app is very short and simple, enhancing the user-experience of our intended audience. Starting from a generic SD image, corresponding to our tool version, all of the rpm packages required for our app can be installed with “dnf”.
Notation
Throughout this project tutorial, commands will be specified using one of the three prefixes ($, >, or #), which indicate the following context:
Prefix |
Context |
$ |
linux machine |
> |
docker container |
# |
embedded platform (kv260) |
Next Steps
The following blogs will cover each of the development steps for this in-depth project tutorial.
- http://avnet.me/kv260-vvas-sms-2021-1-part1
- http://avnet.me/kv260-vvas-sms-2021-1-part2
- http://avnet.me/kv260-vvas-sms-2021-1-part3
- http://avnet.me/kv260-vvas-sms-2021-1-part4
- http://avnet.me/kv260-vvas-sms-2021-1-part5
- http://avnet.me/kv260-vvas-sms-2021-1-part6
- http://avnet.me/kv260-vvas-sms-2021-1-part7
Revision History
Revision |
Date |
Description |
1.0 |
2022/01/12 |
Initial Version, ready for publishing |
1.1 |
2022/02/24 |
Update part 1 to specify "VVAS_REL_v1.0" branch for VVAS repository. |
References
Hackster.io projects:
- Introducing Xilinx Kria for Vision AI Applications
https://avnet.me/kria-tutorial - Creating a custom Kria app
https://avnet.me/kv260-vvas-sms-2021-1
Element 14 Blogs:
- Vitis-AI 1.4 Flow for Kria KV260 Vision AI Starter Kit
https://avnet.me/vitis-ai-1.4-kria - KRIA ... reproducing the benchmark results
http://avnet.me/kria-benchmark-blog - XMUTIL ... A new platform and app management utility from Xilinx
https://avnet.me/xmutil-overview - XMUTIL … understanding platformstats
https://avnet.me/xmutil-platformstats
Xilinx on-line resources:
- Kria Product page
https://www.xilinx.com/products/som/kria.html - KV260 Getting Started page
https://www.xilinx.com/products/som/kria/kv260-vision-starter-kit/kv260-getting-started/getting-started.html - KV260 Apps documentation
https://xilinx.github.io/kria-apps-docs/ - Kria App Store
https://www.xilinx.com/products/app-store/kria.html - Kria KV26 SOM wiki page
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1641152513/Kria+K26+SOM - KV260 Starter Kit Vitis Platforms
https://github.com/Xilinx/kv260-vitis - Vitis Video Analytics SDK (VVAS) Documentation
https://xilinx.github.io/VVAS/main/build/html/index.html - Smart Model Select
https://xilinx.github.io/VVAS/main/build/html/docs/Embedded/smart_model_select.html … - MultiChannel ML
https://xilinx.github.io/VVAS/main/build/html/docs/Embedded/Tutorials/MultiChannelML.html