In this project, the instructions provided in the Xilinx MLIR-AIE GitHub repository were followed to set up a functional development environment on Ubuntu and execute sample MLIR-AIE programs on an AMD Ryzen™ AI NPU. The objective was to complete the full setup workflow, which included installing the required toolchains, configuring system dependencies, and building a simple AI Engine (AIE) design using the MLIR-AIE framework. After the environment was prepared, the included example applications were compiled and deployed to the NPU to verify correct integration between the software tools and the hardware platform.
This process demonstrates a practical approach to preparing a system for AMD Ryzen AI development, providing insights into tool installation, environment configuration, and the execution flow of MLIR-AIE applications. The successful execution of the sample programs confirms that the development pipeline—from MLIR-based design to hardware execution—functions as expected, establishing a foundation for future experimentation and custom AIE application development.
An AMD NPU (Neural Processing Unit) is a specialized AI accelerator integrated into AMD Ryzen AI series. Here we will look on the
- System configuration
- Changes in the Bios settings
- Tool chain installation
- How to setup the environment?
- How to run the sample test case and verify the execution on AMD NPU?
- Sample Testcase Reference
The process began with a clean installation of Ubuntu 24.04, ensuring that the laptop was updated to the latest BIOS version with NPU support enabled.
System Configuration
OS Name : Linux
Release : 6.14.0-36-generic
Machine : x86_64
CPU Cores : 16
Memory : 15087 MB
Distribution : Ubuntu 24.04.3 LTSChange in the BIOS settingsSecure Boot was then confirmed to be disabled in the BIOS to allow the use of unsigned drivers.# BIOS → Security → Secure Boot → Disable
MB: B650M GAMING WIFI (MS-7E30)
CPU: AMD Ryzen 7 8700G w/ Radeon 780M Graphics
MEMORY SIZE: 16384MB
BIOS VER: E7E30AMS.1C0Since Ubuntu 24.04 ships with an older kernel, updated to the Hardware Enablement (HWE) stack to get Linux kernel 6.11+:
sudo apt update
sudo apt install --install-recommends linux-generic-hwe-24.04
sudo rebootTool Chain InstallationThe XDNA driver and XRT for the Ryzen AI NPU were installed using the provided installation script.
bash ./utils/build_drivers.sh
sudo rebootAfter reboot, checked if the NPU was detected:
source /opt/xilinx/xrt/setup.sh
xrt-smi examineThe MLIR-AIE repository was cloned, and a dedicated Python virtual environment was created for the project setup.
git clone https://github.com/Xilinx/mlir-aie.git
cd mlir-aie
python3 -m venv ironenv
source ironenv/bin/activate
python3 -m pip install --upgrade pipThe latest versions of MLIR-AIE and LLVM-AIE were installed as part of the development environment preparation.
# Get the latest release version
latest_tag_with_v=$(curl -s "https://api.github.com/repos/Xilinx/mlir-aie/releases/latest" | jq -r '.tag_name')
latest_tag="${latest_tag_with_v#v}"
# Install IRON library and mlir-aie from the latest stable release
python3 -m pip install mlir_aie==${latest_tag} -f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/${latest_tag_with_v}
# Install Peano from llvm-aie wheel
python3 -m pip install llvm-aie -f https://github.com/Xilinx/llvm-aie/releases/expanded_assets/nightly
# Install MLIR Python Extras
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie python3 -m pip install -r python/requirements_extras.txtHow to setup environment ?The required execution environment variables were configured to ensure correct integration of the tools and libraries.
source ironenv/bin/activate
source /opt/xilinx/xrt/setup.sh
source utils/env_setup.shHow to run the sample example and verify the execution on AMD NPU ?Navigating to one of the provided programming examples in mlir-aie/programming_examples/ and built the AIE design:Build the design using the make command on the test case path:
makeThe XRT environment was sourced, and an infinite monitoring script was executed in a separate terminal to observe AI Engine activity.
source /opt/xilinx/xrt/setup.sh
./monitor.shThe.sh script triggers the infinite NPU status check.After completing a successful build, the host application was compiled and executed to run the design on the Ryzen AI NPU.
make run NPU1=1This triggered the MLIR-AIE runtime, which offloaded computations to the NPU. We could see the accelerated results immediately.
Below is the output of example execution and verification :
- Passthrough DMAs - This design demonstrates data movement to implement a memcpy operation using object FIFOs just using DMAs without involving the AIE core.
- Passthrough Kernel - This design demonstrates a simple AIE implementation for vectorized memcpy on a vector of integer involving AIE core kernel programming.
- Vector Scalar Add- Single tile performs a very simple
+operation where the kernel loads data from local memory, increments the value by1and stores it back.










Comments