Runtime SDK for AI/ML acceleration with Ara240 NPU on i.MX SoCs ππ§ π»
The rt-sdk-ara2 provides a complete runtime environment for AI/ML acceleration using the Ara240 NPU on NXP i.MX SoCs. It includes:
- π§ Runtime libraries for Ara240 NPU integration
- π Python bindings (DVAPI) for custom inference applications
- π€ Optimum-Ara framework for LLMs and VLMs
- π₯ GStreamer plugins for Real-Time Detection Object Applications
- π οΈ Helper scripts for monitoring, benchmarking, and model management
- βοΈ Systemd service for automatic hardware initialization
- π Automatic device detection via udev rules for hot-plug support
- π UIO DMA driver for PCIe communication
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Application Layer β
βββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ€
β Python β Gstreamer β
β βββββββββββββββββββββββββββββββββ β βββββββββββββββββββββββββββββββ β
β β Optimum-Ara Framework β β β GstdvPlugins β β
β βββββββββββββββββββββββββββββββββ€ β βββββββββββββββββββββββββββββββ€ β
β β dvapi.py - Python Bindings β β β ara_vision_infer β β
β βββββββββββββββββββββββββββββββββ β βββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββ€
β libaraclient.so - Client Library β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Proxy Daemon β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β uiodma.ko - UIO DMA Driver β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ARA240 NPU Hardware β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
This SDK integrates the following external components:
| Component | Repository | License |
|---|---|---|
| UIO DMA Driver | https://github.com/nxp-imx-support/uiodma-driver | GPL-2.0 |
| Optimum-Ara | https://github.com/nxp/optimum-ara | Apache-2.0 |
| GStreamer Plugins | https://github.com/nxp-imx-support/gstreamer-plugins-ara240 | LGPL-2.1-or-later |
- i.MX 8M Plus FRDM / i.MX 95 FRDM
- Ara240 NPU module
- microSD card (β₯ 64GB recommended for LLM/VLM support)
- USB-C debug cable
- Ethernet connection
- Power supply
- Embedded Linux for i.MX (= LF6.18.37_2.1.0)
The SDK includes several helper scripts to monitor, manage, and benchmark the Ara240 NPU. These scripts make it easy to check device status, update firmware, download models, and run performance tests.
Monitor real-time NPU metrics including utilization, temperature, DRAM usage, and device state:
ara2-metricsInteractive menu options:
Found endpoints: count = 1
Press 1 to print Device info
Press 2 to print % NPU Utilization continuously
Press 3 to print Dram Info
Press 4 to print NPU Temperature
Press 5 to print NPU Temperature continuously
Press 6 to print % NPU Utilization, Temperature continuously
Press 7 to print NPU state
Press 0 to exit
Use case: This tool is invaluable during benchmarking or model execution. You can correlate model performance with thermal behavior and utilization to identify bottlenecks. For example, if performance drops, you can verify whether the NPU is throttling due to temperature or experiencing memory pressure.
Get a comprehensive overview of the Ara240 NPU configuration and status:
ara2-chip-infoDisplays:
- Chip ID and revision
- Bus ID and interface type (PCIe)
- System, NPU, and DDR frequencies
- Device temperature and voltage
- Power state
- Firmware version (raw and display format)
- DDR and flash information
- Life cycle and chip part type
Note: This script runs automatically twice during Ara240 boot-up and provides a quick health check of the device.
Update the Ara240 NPU firmware to the required version:
ara2-program-flashImportant: Always reboot the board after running this script to ensure the new firmware is fully applied and the device state is clean.
Download pre-trained (CNN/LLM) models from Hugging Face Hub for use with the ARA240 platform:
ara2-fetch-models --repo-id nxp/Ultralytics-YOLOv8-detection-Ara240Run performance benchmarks on downloaded models:
ara2-model-perfExample output:
==========================
Available Model Categories
==========================
1) detection
q) Quit
Enter the number corresponding to the category you want to explore: 1
==========================
Available Models in detection
==========================
1. yolov8n
Key metric: Look for HW IPS (Hardware Inferences Per Second) in the results. This represents the maximum throughput the Ara240 NPU can achieve for the selected model under current conditions.
Note: IPS values may vary depending on thermal conditions, system load, interface type (PCIe), and whether the benchmark runs continuously or in bursts.
When an Ara-2 device is present (including at boot), ara2-device.target is started automatically by default and handles:
- Loading the
uiodmakernel driver - Performing hardware bringup
- Launching the proxy daemon
When an Ara240 device is connected (PCIe or USB):
- udev detects the device and triggers the handler script
- The handler automatically starts the
ara2-device.target - The target brings up the runtime services:
ara2-uiodma-bind.service(binds the uiodma driver when PCIe devices are present),ara2-hw-init.service(hardware bringup), andara2-proxy.service(proxy daemon)
When an Ara240 device is disconnected:
- udev detects the removal and triggers the handler
- If no other Ara240 devices remain, the service and target are stopped automatically
- If other devices remain, the service is restarted to reconfigure
After a device is detected, verify the stack came up:
systemctl is-active ara2-device.target ara2-uiodma-bind.service ara2-hw-init.service ara2-proxy.serviceExpected output: active for the target, ara2-hw-init.service and
ara2-proxy.service. inactive is normal for ara2-uiodma-bind.service
(one-shot bind step, exits after binding the driver).
For the full picture, including recent log lines:
systemctl status ara2-device.target --no-pager -lAll udev handler activity is logged to /var/log/ara2-udev-events.log.
Start or stop the whole stack by hand:
sudo systemctl stop ara2-device.target
sudo systemctl start ara2-device.targetThe SDK uses systemd for service lifecycle management with a target-based architecture for clean device handling.
ara2-device.target (device aggregator)
βββ Requires: ara2-uiodma-bind.service (binds the uiodma driver when PCIe devices are present)
βββ Requires: ara2-hw-init.service (hardware bringup)
βββ Requires: ara2-proxy.service (proxy daemon, ordered after hw-init)
Stopping the target stops all member services; restarting it re-runs the whole bring-up sequence (used by the udev handler on device changes).
Check service/target status:
systemctl status ara2-device.target --no-pager -lStart the Ara2 stack:
systemctl start ara2-device.targetStop the Ara2 stack:
systemctl stop ara2-device.targetRestart the service:
systemctl restart ara2-device.targetView detailed logs:
journalctl -u ara2-hw-init.service -f
journalctl -u ara2-proxy.service -f
journalctl -u ara2-uiodma-bind.service -f (PCIE only)View udev event logs:
tail -f /var/log/ara2-udev-events.logThe SDK includes Python bindings for the DVAPI (DeepVision API):
Location: /usr/share/ara2/dvapi.py
Key classes and methods:
DVSession- Session management for Ara240 NPUDVModel- Model loading and managementDVEndpoint- Endpoint (device) managementdv_infer_wait_for_completion()- Blocking inference execution
Optimum-Ara is a framework for running Large Language Models (LLMs) and Vision-Language Models (VLMs) on Ara240.
Location: /usr/share/ara2/optimum-ara/
Repository: https://github.com/nxp/optimum-ara
License: Apache-2.0
Supported models:
- LLMs: Qwen 2.5 Instruct, Qwen 2.5 Coder
- VLMs: Qwen 2.5-VL
Example scripts: /usr/share/ara/optimum-ara/examples/
API documentation: /usr/share/ara2/optimum-ara/docs/
Example usage:
cd /usr/share/ara2/optimum-ara/examples/
python3 -m venv .venv
. .venv/bin/activate
pip install /usr/share/python-wheels/optimum_ara-1.1.0-py3-none-any.whlpython3 causalLM_auto.pyThe SDK includes a custom GStreamer plugin optimized for zero-copy video inference pipelines with the Ara240 NPU.
Location: /usr/lib/gstreamer-1.0/
Repository: https://github.com/nxp-imx-support/gstreamer-plugins-ara240
License: Proprietary
Name: libgstdvInf
Properties:
- Unified inference plugin
- Handles image preprocessing (resizing, normalization, color conversion)
- Executes inference on Ara240 NPU
- Manages model loading and execution
- Processes inference results
- Zero-copy buffer operations for optimal performance
The uiodma.ko kernel driver enables high-speed PCIe communication between the i.MX host processor and the Ara240 NPU module.
Location: /lib/modules/$(uname -r)/extra/uiodma.ko
Repository: https://github.com/nxp-imx-support/uiodma-driver
License: GPL-2.0
The driver is automatically loaded during system boot by the ara2-uiodma-bind.service. You can verify it's loaded with:
lsmod | grep uiodmaTo manually load the driver:
modprobe uiodmaTo manually unload the driver:
rmmod uiodmaNote: The driver is essential for Ara240 NPU operation. Do not unload it while running inference workloads.
The SDK installs components to the following locations:
/usr/bin/nnapp- Inference application/usr/bin/ara2-chip-info- Chip information tool/usr/bin/ara2-model-perf- Model performance benchmark/usr/bin/ara2-metrics- Hardware metrics/usr/bin/ara2-fetch-models- Model download helper/usr/bin/ara2-program-flash- Flash programming tool/usr/bin/enable-swap,/usr/bin/resize-disk-max- Storage helpers for LLM use
/usr/libexec/ara2/scripts/- All utility scripts/usr/libexec/ara2/scripts/ara2-udev-handler- udev event handler/usr/libexec/ara2/hw_utils/- Hardware bringup utilities and firmware/usr/libexec/ara2/proxy/- Proxy daemon
/usr/lib/libaraclient_aarch64.so/.a- Ara client library/usr/lib/libara_vision_inference.so*- Vision inference library/usr/lib/gstreamer-1.0/- GStreamer plugins for video inference pipelines
/usr/share/ara2/dvapi.py- Python bindings for the DVAPI/usr/share/python-wheels/optimum_ara-*.whl- Optimum-Ara wheel
/usr/lib/systemd/system/ara2-device.target- Device aggregator target/usr/lib/systemd/system/ara2-uiodma-bind.service- uiodma driver bind (one-shot, PCIe only)/usr/lib/systemd/system/ara2-hw-init.service- Hardware bringup service/usr/lib/systemd/system/ara2-proxy.service- Proxy daemon service/etc/udev/rules.d/99-ara2.rules- Udev rules for NPU detection/etc/default/ara2- Board-specific settings (ARA2_BOARD,ARA2_DDR_PLL,ARA2_DDR_CFG,ARA2_PROXY_CONFIG)/etc/ara2/proxy_config.yaml- Proxy configuration/etc/ara2/cnn_config.yaml- CNN inference configuration
/lib/modules/$(uname -r)/extra/uiodma.ko- UIO DMA driver locationuiodma.ko- Kernel module for PCIe communication
/var/log/ara2-udev-events.log- Udev event handler logs
| Component | Version |
|---|---|
| Firmware (raw) | 131072 |
| Firmware (display) | 2.0.0 |
| Optimum-Ara | 1.1.0 |
This repository is licensed under the LA_OPT_NXP_Software_License license.
For support and additional information, please refer to the official NXP documentation.