Xanderlent/amd-npu-driver

Description

AMD XDNA NPU Driver RPMs

Installation Instructions

Experimental! Don't use this unless you've discussed it with me!

If this breaks your system, fries your hardware, etc. take note: YOU WERE WARNED that this software was experimental.*

Active Releases

The following unofficial repositories are provided as-is by owner of this project. Contact the owner directly for bugs or issues (IE: not bugzilla).

* Total number of downloaded packages.


This is a companion discussion topic for the original entry at https://copr.fedorainfracloud.org/coprs/xanderlent/amd-npu-driver

Hi, thanks for providing RPMs for Fedora! I just installed on F43 and there are a couple of issues:

  1. the executables are not on the regular path (all files are under /usr/xrt/bin)
  2. libs are under /usr/xrt/lib{,64} which breaks execution:
❯ /usr/xrt/bin/xrt-smi examine 
XRT build version: 2.19.0
Build hash: 
Build date: 2025-04-25 00:00:00
Git branch: 
PID: 24126
UID: 1000
[Fri Mar  6 17:41:58 2026 GMT]
HOST: fedora-costa
EXE: /usr/xrt/bin/unwrapped/xrt-smi
[xrt-smi] ERROR: No such library '/opt/xilinx/xrt/lib/libxrt_core.so.2'

Should I open an issue on github? Is this project still active?

1 Like

I could fix it by:

sudo ln -s /usr/xrt/lib64 /usr/xrt/lib
sudo mkdir /opt/xilinx/
sudo ln -s /usr/xrt /opt/xilinx/

This needs a rebuild for F44. The fc43 RPMs are looking for a version of the boost-filesystem header files that is not distributed with F44. Note in the example below that I am explicitly forcing $releasever to be 44 and I’m still getting the fc43 RPMs:

$ sudo dnf install xrt xdna-driver --releasever=44
Updating and loading repositories:
Repositories loaded.
Failed to resolve the transaction:
Problem 1: conflicting requests
  - nothing provides libboost_filesystem.so.1.83.0()(64bit) needed by xrt-202510.2.19.0~20250415gitd5835aa-4.fc43.x86_64 from copr:copr.fedorainfracloud.org:xanderlent:amd-npu-driver
  - nothing provides libboost_program_options.so.1.83.0()(64bit) needed by xrt-202510.2.19.0~20250415gitd5835aa-4.fc43.x86_64 from copr:copr.fedorainfracloud.org:xanderlent:amd-npu-driver
 Problem 2: package xdna-driver-2.19.0~20250423git75bc2dc-2.fc43.x86_64 from copr:copr.fedorainfracloud.org:xanderlent:amd-npu-driver requires libxrt_core.so.2()(64bit), but none of the providers can be installed
  - package xdna-driver-2.19.0~20250423git75bc2dc-2.fc43.x86_64 from copr:copr.fedorainfracloud.org:xanderlent:amd-npu-driver requires libxrt_coreutil.so.2()(64bit), but none of the providers can be installed
  - conflicting requests
  - nothing provides libboost_filesystem.so.1.83.0()(64bit) needed by xrt-202510.2.19.0~20250415gitd5835aa-4.fc43.x86_64 from copr:copr.fedorainfracloud.org:xanderlent:amd-npu-driver
  - nothing provides libboost_program_options.so.1.83.0()(64bit) needed by xrt-202510.2.19.0~20250415gitd5835aa-4.fc43.x86_64 from copr:copr.fedorainfracloud.org:xanderlent:amd-npu-driver
You can try to add to command line:
  --skip-broken to skip uninstallable packages

Ok, I finally made it:

❯ xrt-smi --version
  Version              : 2.25.0
  Branch               : HEAD
  Hash                 : 3805b844aa6d2710763d22bd609ef54daf393415
  Hash Date            : Wed, 27 May 2026 08:29:44 -0700
  amdxdna Version      : 2.25.0_20260601, fdc88f9d166e3f43dc306564c09639c42f1bb9fb
  virtio-pci Version   : 7.0.10-201.fc44.x86_64
  NPU Firmware Version : 1.1.2.64

❯ lemonade status 
Server is running on port 13305

Property            Value
--------------------------------------------------
Version             10.6.0
WebSocket Port      9000
Max Models/Type     2

Model                         Type      Device    Recipe        Checkpoint
----------------------------------------------------------------------------------------------------
deepseek-r1-0528-8b-FLM       llm       npu       flm           deepseek-r1-0528:8b

It took quite some time to do it right, and FastFlowLM still needs to be installed manually (no RPMs), but the whole stack is running flawlessly now.

As far as I can remember, these are the main steps:

# install the dependencies needed to build XRT and FastFlowLM
sudo dnf install gcc \
gcc-c++ \
cmake \
boost-devel \
ncurses-devel \
doxygen \
python3-sphinx \
kernel-doc \
openssl-devel \
rapidjson-devel \
python3-devel \
pybind11-devel \
uuid-devel \
libuuid-devel \
systemtap-sdt-devel \
binutils \
binutils-gold \
binutils-devel \
libstdc++-static \
glibc-static \
rpm-build

# if you have OpenCL-ICD-Loader installed, you need to swap it for ocl-icd
sudo dnf swap OpenCL-ICD-Loader ocl-icd
sudo dnf install ocl-icd-devel

# clone XRT and its plugin repository
git clone --recursive https://github.com/amd/xdna-driver.git
cd xdna-driver

# they both depend on cmake3, which is really not needed
# change the line
# CMAKE=cmake3
# to
# CMAKE=cmake
# in build/build.sh and xrt/build/build.sh

# build XRT
cd xrt/build
./build.sh -npu -opt

# if all goes well, RPMs will be in the Release/ subdir
# install xrt...-base , xrt...-base-devel and xrt...-npu
# you will probably need to adjust your PATH to point to /opt/xilinx/xrt/bin and
# LD_LIBRARY_PATH to point to /opt/xilinx/xrt/lib

# now build and install the userspace plugin
cd ../../build
./build.sh -release -j(nproc)
# as above, the RPM will be in the Release subdir

Check if all went well:

xrt-smi --version
sudo xrt-smi examine

Now you need to clone FastFlowLM git repo, build it and install it in /opt:

git clone --recursive https://github.com/FastFlowLM/FastFlowLM
cmake --preset linux-default
cmake --build src/build -j(nproc)
sudo cmake --install src/build

Install Lemonade from its official page and start the service

sudo systemctl start lemond

lemonade backends   # should show 'flm:npu' as installed
lemonade list       # shows all available models; look for the ones ending in -FLM
lemonade pull <model>
lemonade run <model>

I most likely forgot some details; if you get stuck, post here and I’ll do my best to help. Good luck!

Thanks to @ciddan and @nadims for the dependencies info.

1 Like

Thanks for the guide André! Worked flawlessly. I indeed needed to install dozens of dependencies, but once that was done everything built and works great.

1 Like

Cool @ciddan , I’m glad to hear that! :smile: I edited my previous post to add a warning about the dependencies.

Happy LLM’ing! :wink:

1 Like

For the (you might need to download dozens of dependencies) part

I am adding the dependencies needed on an new install of Fedora 44. I am adding this because it might not be obvious to some.

sudo dnf install gcc gcc-c++ cmake boost-devel ncurses-devel doxygen python3-sphinx kernel-doc openssl-devel rapidjson-devel python3-devel pybind11-devel uuid-devel libuuid-devel systemtap-sdt-devel binutils binutils-gold binutils-devel libstdc++-static glibc-static rpm-build
1 Like

Thanks @nadims I updated my previous post with these instructions, so that others can find all needed info on a single post. And I gave you and @ciddan the deserved credit at the end :wink:

Also required the current kernel headers for the user part

uname -r
sudo dnf install kernel-devel-$(uname -r)

There is also a util in the tools dir, that adds other dependencies. Not sure if needed, but added that as well

./tools/amdxdna_deps.sh

FInal list of dependancies, to install the module

sudo dnf install dkms

You should have this before trying to install the kernel module.

If you are using secure boot (which I used to dual boot with windows11) you need to have a MOK key

 sudo mokutil --import /var/lib/dkms/mok.pub

It will ask for a password, you need to reboot
Reboot your system:
1. sudo reboot
2. During boot, press any key to enter MOK Manager (blue screen)
3. Select “Enroll MOK” → “Continue” → “Yes”
4. Enter the password you set
5. Select “Reboot”

After this you should have no issues installing the kernel module. Validate with

xrt-smi --version
xrt-smi examine

Now for the dependancies for FastFlowM

sudo dnf install libcurl-devel libavformat-free-devel fftw-devel libswscale-free-devel

I hope I got it all. With that I was able to install the xdna-driver and FastFlowLM.

Thank you so much Andre Costa for helping me out with this project. Your instructions were very much appreciated.

Hmmm. After all this, lemonade doesn’t want to use it :frowning:

lemonade backends
Recipe              Backend     Status          Message/Version                               Action
----------------------------------------------------------------------------------------------------------------------------------------------------
flm                 npu         update_required Backend update is required before use.         lemonade backends install flm:npu
kokoro              cpu         installed       b17    

Says to do an update

lemonade backends install flm:npu
Installing backend: flm:npu
Error: FLM auto-install is only supported on Windows. On Linux, install FLM manually: https://github.com/FastFlowLM/FastFlowLM/releases/tag/v0.9.42

Maybe the issue is I got version 0.9.43? How does yours show Andre?

Hmmm. After all this, lemonade doesn’t want to use it :frowning:

lemonade backends
Recipe              Backend     Status          Message/Version                               Action
----------------------------------------------------------------------------------------------------------------------------------------------------
flm                 npu         update_required Backend update is required before use.         lemonade backends install flm:npu
kokoro              cpu         installed       b17    

Says to do an update

lemonade backends install flm:npu
Installing backend: flm:npu
Error: FLM auto-install is only supported on Windows. On Linux, install FLM manually: https://github.com/FastFlowLM/FastFlowLM/releases/tag/v0.9.42

Maybe the issue is I got version 0.9.43? How does yours show Andre?

Found the answer, had to edit:
/etc/systemd/system/lemond.service

to add

Environment=LEMONADE_FLM_LINUX_BETA=1
Environment=LD_LIBRARY_PATH=/opt/fastflowlm/lib:/opt/fastflowlm/lib64/flm/lib:/opt/xilinx/xrt/lib:/usr/local/lib
Environment=FLM_CONFIG_PATH=/opt/fastflowlm/share/flm/model_list.json
LimitMEMLOCK=infinity

under the [Service] section.
leaving this here in case anyone gets into the same problem

1 Like