How to Enable AMD's Next-Gen AIE4 NPU on Linux with the AMDXDNA Driver

By ✦ min read

Introduction

AMD's upcoming AIE4 NPU (Neural Processing Unit) marks a significant leap in on-device AI acceleration, and the Linux community is already preparing for its arrival. The AMDXDNA driver, which currently supports first-generation NPUs, is being extended to handle this new hardware. This guide walks you through the process of enabling AIE4 NPU support on your Linux system, from verifying kernel compatibility to verifying the driver installation. Whether you're a developer testing early patches or an enthusiast wanting to be ready, these steps will help you set up the driver environment.

How to Enable AMD's Next-Gen AIE4 NPU on Linux with the AMDXDNA Driver

What You Need

Step-by-Step Guide

Step 1: Check Hardware and Kernel Version

Before diving in, verify that your system actually contains an AIE4 NPU. For now, only pre-release hardware exists. Run lspci | grep -i 'np\|accel' to look for AMD NPU devices. Also confirm your kernel version with uname -r. If it's below 6.12, you'll need to upgrade (see Step 2).

Step 2: Update the Linux Kernel

The AMDXDNA driver patches for AIE4 rely on kernel interfaces introduced in version 6.12. Use your distribution's method to update, or compile a mainline kernel. For example, on Ubuntu:

  1. Add the mainline PPA (if using Ubuntu): sudo add-apt-repository ppa:cappelikan/ppa
  2. Install the latest kernel: sudo apt update && sudo apt install linux-generic
  3. Reboot and select the new kernel from GRUB.

For manual compilation, download the kernel source from kernel.org, configure with make olddefconfig, build, and install. Ensure CONFIG_AMD_XDNA is enabled.

Step 3: Obtain the AMDXDNA Driver Source

AMD maintains the driver on GitHub. Clone the repository with AIE4 patches:

git clone --branch aie4-next https://github.com/amd/amdxdna.git
cd amdxdna

The aie4-next branch contains the latest enablement patches as of early 2025. If you're reading this later, check for stable branches.

Step 4: Build and Install the Driver

Compile the driver as a kernel module:

  1. Prepare the environment: make kernel_prepare (or manually copy kernel headers).
  2. Build the module: make
  3. Install: sudo make install
  4. Update module dependencies: sudo depmod -a

If you encounter errors, ensure you have the build tools listed in What You Need.

Step 5: Load the Module and Test

Load the driver module with:

sudo modprobe amdxdna

Check the kernel log (dmesg | tail -20) for AIE4 NPU recognition. You should see lines containing AIE4 or NPU. Then list the device:

ls /dev/amdxdna*

If a device appears, the driver is working. To make it load automatically at boot, add amdxdna to /etc/modules.

Step 6: Verify with a Sample AI Workload

Use the provided test utilities in the driver source:

cd amdxdna/utests
make
./run_all_tests.sh

Or run a simple inference from a supported framework. For PyTorch, ensure the torch.xdna backend is installed. A minimal test:

import torch
model = torch.nn.Linear(10,5)
x = torch.randn(1,10)
with torch.xdna.device(0):
    y = model(x)
print(y)

If no errors, your AIE4 NPU is fully enabled.

Tips and Troubleshooting

By following these steps, you'll be prepared to leverage the AIE4 NPU's performance for on-device AI inference as soon as the hardware becomes commercially available. The Linux enablement is progressing steadily, and your early adoption helps refine the driver for everyone.

Tags:

Recommended

Discover More

8 Things You Need to Know About the Android Browser That Replaced Chrome, Firefox, and Samsung InternetConsolidating Remote Access: How Cloudflare Mesh Replaced Tailscale in My HomelabIran-Linked Group Claims Destructive Cyberattack on Medical Device Maker StrykerKubernetes v1.36 Introduces Tiered Memory Protection and Smarter QoS ControlsReact Native 0.82: Key Questions Answered