# Integration guide

What to include in an OS image, distro, BSP or SDK so that apps can run models on an NPU with the open stack.


This page is for developers of OS images, distros, BSPs or SDKs. It lists what
the OS needs so that apps can run models on an NPU with the Open Inference
Stack. Everything here is upstream, there are no vendor-specific components to
add.

## Supported Hardware

| NPU | Example SoCs | Kernel driver | Mesa driver |
|---|---|---|---|
| VeriSilicon VIPNano-QI | Amlogic A311D | `etnaviv` (Linux 6.7) | `etnaviv` (Mesa 24.1) |
| VeriSilicon VIPNano-SI+ | NXP i.MX 8M Plus | `etnaviv` (Linux 6.8) | `etnaviv` (Mesa 25.0) |
| Rockchip RKNN | Rockchip RK3588 | `rocket` (Linux 6.18) | `rocket` (Mesa 25.3) |
| Arm Ethos-U65 / U85 | NXP i.MX 93 | `ethosu` (Linux 6.19) | `ethosu` (Mesa 26.0) |

**Is your hardware missing?** [Here's how to add support for it](http://model-citizen.ai/getting-started/new-hardware/index.md).


The table above shows hardware currently supported by the Open Inference Stack,
as well as the required Mesa and Linux versions. It's worth going for newer
versions if possible, because newer releases often include bugfixes,
optimizations and extended model support.

## Building Linux with the NPU driver

The open stack's NPU drivers are included in the official mainline Linux kernel;
you generally do not need a patched or unofficial kernel. You can build one or
more NPU drivers into the same kernel image.

* You need a Linux kernel version new enough to include the open NPU driver(s)
  in question.
* The open NPU driver(s) must be built and available.
* Embedded platforms typically require a Device Tree entry for the NPU, in order
  for the driver to bind to the device. For boards already supported upstream,
  the device tree part is typically already done.
* If you're using a vendor kernel, you must ensure any vendor-stack NPU driver
  is removed or deactivated.

## Building Mesa with NPU drivers & Teflon/Torx

For each open NPU kernel driver, there is a corresponding driver in
[Mesa](https://mesa3d.org) that must be enabled.

Mesa then makes the NPU available to standard AI frameworks:

* **Teflon** (`libteflon.so`) is an external delegate for LiteRT (TensorFlow
  Lite).
* **Torx** (`libtorx.so`) is an ExecuTorch backend for PyTorch models.

Your distribution may already package Teflon/Torx and Mesa's NPU drivers, in
which case you just need to install the appropriate packages. If you build Mesa
yourself, enable Teflon and/or Torx plus the Gallium driver for your NPU at
compile time, for example:

```sh
meson setup build -Dgallium-drivers=ethosu -Dteflon=true -Dtorx=true
```

Replace `ethosu` with the driver for your hardware from the supported hardware
table above, or include support for several NPUs by listing several drivers
separated by commas.

## Supported AI frameworks

With the stack now included in your software distribution, app developers can
now make use of the Open Inference Stack via LiteRT or ExecuTorch. It might be
helpful to preinstall tested versions of those frameworks.


---
Source: http://model-citizen.ai/getting-started/integration/
