A Step-by-Step Guide to Testing the AMD AIE4 NPU with the AMDXDNA Linux Driver

By • min read

Introduction

AMD's next-generation NPU, codenamed AIE4, is gradually arriving on Linux through continuous hardware enablement patches for the AMDXDNA accelerator driver. For developers and early adopters eager to evaluate this new AI accelerator, understanding the driver setup process is crucial. This guide walks you through obtaining, applying, and testing the latest AIE4 support patches on a Linux system, using real-world steps that reflect the ongoing upstream work. By the end, you'll have a functional test environment to verify NPU detection and basic operations.

A Step-by-Step Guide to Testing the AMD AIE4 NPU with the AMDXDNA Linux Driver

What You Need

Step-by-Step Instructions

Step 1: Identify the Latest AIE4 Patches

Since March 2025, AMD engineers have been submitting patches to enable the AIE4 NPU. Monitor the linux-amd-drm mailing list or the drm-next branch. For this guide, start from a known patchset tag – for example, drm-next-2025-05-01 – to ensure consistency. Use git log to locate commits containing "AIE4" or "AMDXDNA".

Step 2: Clone and Prepare the Kernel Source

  1. Clone the AMD GPU kernel tree: git clone https://git.kernel.org/pub/scm/linux/kernel/git/amdgpu/linux.git
  2. Check out the branch containing AIE4 support: git checkout drm-next-2025-05-01
  3. If you have a separate patch series (e.g., from a mailing list), apply them with: git am *.patch or manually patch -p1 < patch_file.

Step 3: Configure the Kernel for AMDXDNA Driver

Run make menuconfig (or nconfig) and navigate to: Device Drivers → Accelerators. Enable the following options:

Save and exit.

Step 4: Build and Install the Kernel

  1. Compile the kernel and modules: make -j$(nproc) deb-pkg (for Debian/Ubuntu) or make -j$(nproc) && make modules_install && make install.
  2. Install the generated packages (e.g., sudo dpkg -i linux-image-*.deb).
  3. Update the bootloader (sudo update-grub or sudo grub2-mkconfig).
  4. Reboot into the new kernel.

Step 5: Verify NPU Detection

After reboot, check if the AIE4 NPU is recognized:

Step 6: Load the Driver Module (if built as module)

If you chose to build as a module, load it manually:

sudo modprobe amd_xdna

Verify with lsmod | grep amd_xdna. The driver should now attach to the AIE4 hardware.

Step 7: Run a Simple NPU Test

Use the amdxdna-test tool (included in kernel selftests) to validate basic operations:

  1. Build kernel selftests: make -C tools/testing/selftests TARGETS=amdxdna
  2. Run the test: sudo ./tools/testing/selftests/amdxdna/test_basic
  3. Look for "PASS" outputs indicating NPU initialization and inference succeeded.

Tips & Troubleshooting

This guide will be updated as new AIE4 patches land in mainline. For the most current information, refer to the Prerequisites section and follow the AMD Linux mailing list.

Recommended

Discover More

From Tutorials to Hired: A 90-Day Roadmap for Your First Cloud Engineering RoleGo vs Rust in 2026: A System Design Decision, Not a Language WarMeta's Autodata: Autonomous AI Agents That Revolutionize Training Data CreationAlarming Reversal: Girls' Math Progress Eroded Post-Pandemic, International Study RevealsHow Leaders Can Unlock the Full Potential of Their Teams by Addressing Spiritual Needs at Work