Enabling NPU software with Yocto
The NXP i.MX95 Technical Guide documentation from RidgeRun is presently being developed. |
Introduction
This page shows how to enable software support for hardware accelerated Machine Learning Applications. It will show how integrate the eIQ Toolkit that makes launching ML applications, easier.
Software Prerequisites
- A configured build environment as described in Yocto Support
- Read the Build a Reference Image with Yocto Project article
Setup Instructions
Clone the eIQ Layer
The eIQ stack is distributed through the meta-imx repository, specifically within the meta-imx-ml layer. This layer provides all the required recipes for Machine Learning runtimes, compilers, and supporting tools.
To include this layer in your Yocto setup, clone the repository and copy the Machine Learning layer into your BSP:
cd /tmp git clone --depth 1 -b scarthgap-6.6.52-2.2.2 https://github.com/nxp-imx/meta-imx.git sudo cp -a meta-imx/meta-imx-ml/ <toradex_bsp_yocto_dir>/layers/
Warning: Make sure the branch you clone matches the version of the Toradex BSP you are working with. This may change over time. For instance, if you are using Yocto Project 7.5 reference images, the correct branch is scarthgap-6.6.52-2.2.2. Always verify compatibility using the Embedded Linux Release Matrix.
Register the Layer in Yocto
Once the layer has been copied, it must be added to your build configuration. Update your bblayers.conf file by appending the new layer:
BBLAYERS += " \
${TOPDIR}/../layers/meta-imx-ml \
"
Configure and Build the Image
Next, configure your image to include the required packages for running edge AI workloads. This is typically done on top of the Toradex Reference Multimedia Image.
Add the following to your local.conf:
IMAGE_INSTALL:append = " adwaita-icon-theme opencv python3-pillow tensorflow-lite tensorflow-lite-neutron-delegate vim"
Finally, build the Reference Multimedia Image with this modification. Run the bitbake command:
bitbake tdx-reference-multimedia-image
And then install it following this page: Flashing the Board