From 748a829be30ef55c4fdaed0672d8e6dc4a616b37 Mon Sep 17 00:00:00 2001
From: Omer Faruk Oruc Background
Requirements:
1.1.x.x, while newer Fedora setups may report values such as 255.x.x.x)1.1.x.x, while newer Fedora setups may report values such as 255.x.x.x)1.1.x.x; avoid using development 255.x.x.x firmware as the default setup)sudo dnf install boost-devel boost-static json-glib-devel libcurl-devel libuuid-devel rapidjson-devel opencl-headers ocl-icd-devel pybind11-devel python3-pybind11
# Also install the matching kernel-devel / kernel-headers package for your running kernelsudo dnf upgrade linux-firmware
sudo reboot255.x.x.x firmware as the default setup path.
printf '* soft memlock unlimited\n* hard memlock unlimited\n' | sudo tee /etc/security/limits.d/99-amdxdna.conf
sudo rebootLimitMEMLOCK=infinity.
- git clone --recursive https://github.com/amd/xdna-driver.git ~/src/xdna-driver
cd ~/src/xdna-driver/xrt/build
./build.sh -npu -opt -noctest -j $(nproc)
cd Release
make package -j $(nproc)
cd ~/src/xdna-driver/build
./build.sh -release -j $(nproc)
sudo dnf install -y ~/src/xdna-driver/xrt/build/Release/*.rpm ~/src/xdna-driver/build/Release/*.rpmamd/xdna-driver git branch:curl -L -o ~/Downloads/xrt-2.21.75.tar.gz https://github.com/Xilinx/XRT/releases/download/2.21.75/2.21.75.tar.gz
mkdir -p ~/src/xrt-2.21.75
tar -C ~/src/xrt-2.21.75 --strip-components=1 -xzf ~/Downloads/xrt-2.21.75.tar.gz
cd ~/src/xrt-2.21.75/xrt/XRT
sudo ./src/runtime_src/tools/scripts/xrtdeps.sh
cd build
./build.sh -npu -opt -noctest -j $(nproc)
cd Release
make package -j $(nproc)
sudo dnf install -y ./*.rpmgit clone https://github.com/FastFlowLM/FastFlowLM.git ~/src/FastFlowLM
git -C ~/src/FastFlowLM submodule update --init --recursive
cd ~/src/FastFlowLM
cmake -S src --preset linux-default
ninja -C src/build -j $(nproc)
sudo cmake --install src/buildflm validate manually and it reports a low memlock limit, raise the shell memlock limit and re-login:printf '* soft memlock unlimited\n* hard memlock unlimited\n' | sudo tee /etc/security/limits.d/99-amdxdna.conf
sudo rebootLimitMEMLOCK=infinity.
+ /opt install layout, export the FLM runtime environment and validate the NPU stack:export LD_LIBRARY_PATH=/opt/fastflowlm/lib:/opt/xilinx/xrt/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export FLM_CONFIG_PATH=/opt/fastflowlm/share/flm/model_list.json
/opt/fastflowlm/bin/flm validate255.0.11.69 rather than older 1.1.x.x examples./usr, you can skip these manual exports.lemonade-server as a systemd service, add a drop-in with the beta flag and FLM runtime paths:sudo install -d /etc/systemd/system/lemonade-server.service.d
printf '[Service]\nEnvironment=LEMONADE_FLM_LINUX_BETA=1\nEnvironment=LD_LIBRARY_PATH=/opt/fastflowlm/lib:/opt/xilinx/xrt/lib\nEnvironment=FLM_CONFIG_PATH=/opt/fastflowlm/share/flm/model_list.json\n' | sudo tee /etc/systemd/system/lemonade-server.service.d/10-flm-beta.conf
sudo systemctl daemon-reload
sudo systemctl enable --now lemonade-server.servicelemonade-server as a systemd service, add a drop-in with the beta flag. If you are using the current manual /opt installs, also add the FLM / XRT runtime paths:sudo install -d /etc/systemd/system/lemonade-server.service.d
printf '[Service]\nEnvironment=LEMONADE_FLM_LINUX_BETA=1\n' | sudo tee /etc/systemd/system/lemonade-server.service.d/10-flm-beta.conf
sudo systemctl daemon-reload
sudo systemctl enable --now lemonade-server.service/opt layout, add Environment=LD_LIBRARY_PATH=/opt/fastflowlm/lib:/opt/xilinx/xrt/lib and Environment=FLM_CONFIG_PATH=/opt/fastflowlm/share/flm/model_list.json to the same drop-in.
systemctl status lemonade-server.service --no-pager
curl -i http://127.0.0.1:8000/api/v1/modelsIf flm validate reports a firmware issue, ensure you have the firmware version line recommended by your distribution or XRT package.
If flm validate reports a firmware issue, ensure you are using the production firmware line recommended by your distribution.
You can check your version manually with:
cat /sys/bus/pci/drivers/amdxdna/*/fw_version
Older examples may show version numbers like 1.1.x.x. Recent Fedora / XDNA2 setups may report newer values such as 255.0.11.69. If your distro packages the firmware separately, update that package; if you built from amd/xdna-driver, verify the installed XRT / XDNA packages match your running kernel.
Older working examples commonly show version numbers like 1.1.x.x. If you instead see a development value such as 255.x.x.x, switch back to the production firmware shipped by your distribution unless you are explicitly testing unstable bits. On Fedora, update the linux-firmware package and reboot.
The NPU requires the amdxdna driver, which is included in Linux kernel 7.0 and later, or can be installed via the amdxdna-dkms package as described in the instructions above.
Then log out and log back in (or reboot) for changes to take effect. Existing shells can keep the old limit even after the file is correct.
On some Linux distributions, finding flm on your PATH is not enough. If you see errors about libxrt_coreutil.so.2 or a missing model_list.json, set:
This usually only applies to manual installs that place FLM under /opt/fastflowlm and XRT under /opt/xilinx/xrt. If you see errors about libxrt_coreutil.so.2 or a missing model_list.json, set:
LD_LIBRARY_PATH=/opt/fastflowlm/lib:/opt/xilinx/xrt/lib
FLM_CONFIG_PATH=/opt/fastflowlm/share/flm/model_list.json
From 6d9758f4947f9719c5a8b476fd375d432f76389d Mon Sep 17 00:00:00 2001
From: Omer Faruk Oruc 1.1.x.x; avoid using development 255.x.x.x firmware as the default setup)sudo dnf upgrade linux-firmware
sudo reboot255.x.x.x firmware as the default setup path.
- amd/xdna-driver git branch:curl -L -o ~/Downloads/xrt-2.21.75.tar.gz https://github.com/Xilinx/XRT/releases/download/2.21.75/2.21.75.tar.gz
mkdir -p ~/src/xrt-2.21.75
tar -C ~/src/xrt-2.21.75 --strip-components=1 -xzf ~/Downloads/xrt-2.21.75.tar.gz
cd ~/src/xrt-2.21.75/xrt/XRT
sudo ./src/runtime_src/tools/scripts/xrtdeps.sh
cd build
./build.sh -npu -opt -noctest -j $(nproc)
cd Release
make package -j $(nproc)
sudo dnf install -y ./*.rpmcurl -L -o ~/Downloads/xrt-2.21.75.tar.gz https://github.com/Xilinx/XRT/releases/download/2.21.75/2.21.75.tar.gz
mkdir -p ~/src/xrt-2.21.75
tar -C ~/src/xrt-2.21.75 --strip-components=1 -xzf ~/Downloads/xrt-2.21.75.tar.gz
cd ~/src/xrt-2.21.75/xrt/XRT
sudo ./src/runtime_src/tools/scripts/xrtdeps.sh
cd build
./build.sh -npu -opt -noctest -j $(nproc)
cd Release
sudo dnf install -y ./*.rpmgit clone https://github.com/FastFlowLM/FastFlowLM.git ~/src/FastFlowLM
git -C ~/src/FastFlowLM submodule update --init --recursive
cd ~/src/FastFlowLM
cmake -S src --preset linux-default
ninja -C src/build -j $(nproc)
sudo cmake --install src/buildflm validate manually and it reports a low memlock limit, raise the shell memlock limit and re-login:printf '* soft memlock unlimited\n* hard memlock unlimited\n' | sudo tee /etc/security/limits.d/99-amdxdna.conf
sudo rebootLimitMEMLOCK=infinity.
- /opt install layout, export the FLM runtime environment and validate the NPU stack:export LD_LIBRARY_PATH=/opt/fastflowlm/lib:/opt/xilinx/xrt/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export FLM_CONFIG_PATH=/opt/fastflowlm/share/flm/model_list.json
/opt/fastflowlm/bin/flm validate/usr, you can skip these manual exports.export LD_LIBRARY_PATH=/opt/fastflowlm/lib:/opt/xilinx/xrt/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export FLM_CONFIG_PATH=/opt/fastflowlm/share/flm/model_list.json
/opt/fastflowlm/bin/flm validatelemonade-server as a systemd service, add a drop-in with the beta flag. If you are using the current manual /opt installs, also add the FLM / XRT runtime paths:sudo install -d /etc/systemd/system/lemonade-server.service.d
printf '[Service]\nEnvironment=LEMONADE_FLM_LINUX_BETA=1\n' | sudo tee /etc/systemd/system/lemonade-server.service.d/10-flm-beta.conf
sudo systemctl daemon-reload
sudo systemctl enable --now lemonade-server.service/opt layout, add Environment=LD_LIBRARY_PATH=/opt/fastflowlm/lib:/opt/xilinx/xrt/lib and Environment=FLM_CONFIG_PATH=/opt/fastflowlm/share/flm/model_list.json to the same drop-in.
+ lemonade-server as a systemd service, add the Linux beta flag and FLM paths:sudo install -d /etc/systemd/system/lemonade-server.service.d
printf '[Service]\nEnvironment=LEMONADE_FLM_LINUX_BETA=1\nEnvironment=LD_LIBRARY_PATH=/opt/fastflowlm/lib:/opt/xilinx/xrt/lib64\nEnvironment=FLM_CONFIG_PATH=/opt/fastflowlm/share/flm/model_list.json\n' | sudo tee /etc/systemd/system/lemonade-server.service.d/10-flm-beta.conf
sudo systemctl daemon-reload
sudo systemctl enable --now lemonade-server.servicesystemctl status lemonade-server.service --no-pager
curl -i http://127.0.0.1:8000/api/v1/modelsIf flm validate reports a firmware issue, ensure you are using the production firmware line recommended by your distribution.
If flm validate reports a firmware issue, update the firmware package from your Linux distribution and reboot.
You can check your version manually with:
cat /sys/bus/pci/drivers/amdxdna/*/fw_version
Older working examples commonly show version numbers like 1.1.x.x. If you instead see a development value such as 255.x.x.x, switch back to the production firmware shipped by your distribution unless you are explicitly testing unstable bits. On Fedora, update the linux-firmware package and reboot.
The NPU requires the amdxdna driver, which is included in Linux kernel 7.0 and later, or can be installed via the amdxdna-dkms package as described in the instructions above.
To check if the driver is loaded, run:
From 1bc40acd1abc5c4004c25cbaa6f125f220634f1f Mon Sep 17 00:00:00 2001 From: Omer Faruk Orucgit clone https://github.com/FastFlowLM/FastFlowLM.git ~/src/FastFlowLM
git -C ~/src/FastFlowLM submodule update --init --recursive
cd ~/src/FastFlowLM
cmake -S src --preset linux-default
ninja -C src/build -j $(nproc)
sudo cmake --install src/buildexport LD_LIBRARY_PATH=/opt/fastflowlm/lib:/opt/xilinx/xrt/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export FLM_CONFIG_PATH=/opt/fastflowlm/share/flm/model_list.json
/opt/fastflowlm/bin/flm validateLD_LIBRARY_PATH=/opt/fastflowlm/lib:/opt/xilinx/xrt/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} FLM_CONFIG_PATH=/opt/fastflowlm/share/flm/model_list.json /opt/fastflowlm/bin/flm validatelemonade-server as a systemd service, add the Linux beta flag and FLM paths:sudo install -d /etc/systemd/system/lemonade-server.service.d
printf '[Service]\nEnvironment=LEMONADE_FLM_LINUX_BETA=1\nEnvironment=LD_LIBRARY_PATH=/opt/fastflowlm/lib:/opt/xilinx/xrt/lib64\nEnvironment=FLM_CONFIG_PATH=/opt/fastflowlm/share/flm/model_list.json\n' | sudo tee /etc/systemd/system/lemonade-server.service.d/10-flm-beta.conf
sudo systemctl daemon-reload
sudo systemctl enable --now lemonade-server.servicesystemctl status lemonade-server.service --no-pager
curl -i http://127.0.0.1:8000/api/v1/modelssystemctl status lemonade-server.service --no-pager
curl -i http://localhost:8000/api/v1/modelsIf flm validate reports a firmware issue, update the firmware package from your Linux distribution and reboot.
If flm validate reports a firmware issue, one possible fix is to follow your distribution's recommended update path for the firmware or related packages, then reboot.
You can check your version manually with:
cat /sys/bus/pci/drivers/amdxdna/*/fw_version
If the firmware is older than 1.1.0.0, check your distribution's documentation for the recommended update path, since it varies by distro.
The NPU requires the amdxdna driver, which is included in Linux kernel 7.0 and later, or can be installed via the amdxdna-dkms package as described in the instructions above.
To check if the driver is loaded, run: