Skip to content

docs: add Fedora FLM setup guidance#1320

Open
OmerFarukOruc wants to merge 4 commits intolemonade-sdk:mainfrom
OmerFarukOruc:ofo/docs-fedora-flm-guidance
Open

docs: add Fedora FLM setup guidance#1320
OmerFarukOruc wants to merge 4 commits intolemonade-sdk:mainfrom
OmerFarukOruc:ofo/docs-fedora-flm-guidance

Conversation

@OmerFarukOruc
Copy link
Copy Markdown
Contributor

Summary

  • add Fedora 43 guidance to the FLM / NPU Linux page
  • add Fedora-specific RPM notes to the development guide
  • document Linux FLM runtime env requirements and validation checks

Testing

  • python YAML parse for .github/workflows/cpp_server_build_test_release.yml
  • local CMake configure/build and cpack -G RPM -V
  • verified generated RPM contents with rpm -qip and rpm -qlp

Closes #1315

Copy link
Copy Markdown
Member

@superm1 superm1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to do a lot of this with COPR builds for XRT and getting a Github Actions for FLM to make artifacts I know those take time and are more complicated.

But I strongly want to avoid people taking XRT and XDNA-Driver git. This is considered unstable. You should be using 2.21.75 XRT/XDNA releases and the production firmware in upstream linux-firmware.

@OmerFarukOruc
Copy link
Copy Markdown
Contributor Author

Thanks — I pushed a follow-up commit addressing the requested changes.

  • Fedora guidance no longer recommends development 255.x.x.x firmware as the default path; it now points users to production firmware from Fedora / linux-firmware.
  • The manual XRT path now points to the stable XRT 2.21.75 release instead of amd/xdna-driver git.
  • The memlock step is now framed as manual-shell guidance only for cases where flm validate reports a low limit; the docs keep Lemonade's systemd service as the default handling path.
  • The /opt runtime env exports are now explicitly scoped to the current manual install layout rather than presented as the default Fedora path.
  • The systemd drop-in example is now minimal by default (LEMONADE_FLM_LINUX_BETA=1), with LD_LIBRARY_PATH / FLM_CONFIG_PATH called out only for manual /opt installs.
  • I also updated the example validation output to use a production-style firmware version instead of a dev-firmware example.

Pushed in ed1eb753 (docs: narrow Fedora FLM setup guidance).

Copy link
Copy Markdown
Member

@superm1 superm1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please reread and edit this yourself without an LLM please. It reads like an LLM couldn't throw away context.

It needs to read logically to a person and not confusing related to older comments in the pull request.

@OmerFarukOruc
Copy link
Copy Markdown
Contributor Author

OmerFarukOruc commented Mar 9, 2026

I removed the extra firmware/dev-context references and rewrote the Fedora flow to be more direct:

  • prerequisites
  • stable XRT 2.21.75 install
  • FastFlowLM install
  • validation
  • optional service setup

I also verified the runtime path on my Fedora machine while working through this:

  • production firmware is now loading (1.1.2.64)
  • xrt-smi validate passes
  • flm validate passes
  • the Lemonade service and local API are up

Pushed in 4b790749 (docs: simplify Fedora FLM setup guidance).

curl -i http://localhost:8000/api/v1/models

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 341
Access-Control-Allow-Origin: *
Keep-Alive: timeout=5, max=100
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization

{"data":[{"checkpoint":"unsloth/Qwen3-0.6B-GGUF:Q4_0","checkpoints":{"main":"unsloth/Qwen3-0.6B-GGUF:Q4_0"},"composite_models":[],"created":1234567890,"downloaded":true,"id":"Qwen3-0.6B-GGUF","labels":["reasoning"],"object":"model","owned_by":"lemonade","recipe":"llamacpp","recipe_options":{},"size":0.38,"suggested":true}],"object":"list"}%

@OmerFarukOruc OmerFarukOruc force-pushed the ofo/docs-fedora-flm-guidance branch from 4b79074 to 6d9758f Compare March 9, 2026 09:49
Copy link
Copy Markdown
Member

@superm1 superm1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking much much better, thanks. Just a few small nits.

</p>
<ul>
<li><strong>NPU Firmware:</strong> Version 1.1.0.0 or later</li>
<li><strong>NPU Firmware:</strong> Firmware supplied by your Linux distribution</li>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't true for all distros and this is a common section. Please leave it as is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted this shared Background item to the original generic wording (Version 1.1.0.0 or later) so it doesn’t imply a distro-specific packaging model

<div class="code-block"><code>git clone https://github.com/FastFlowLM/FastFlowLM.git ~/src/FastFlowLM<br>git -C ~/src/FastFlowLM submodule update --init --recursive<br>cd ~/src/FastFlowLM<br>cmake -S src --preset linux-default<br>ninja -C src/build -j $(nproc)<br>sudo cmake --install src/build</code></div>
</li>
<li>Run validation:<br>
<div class="code-block"><code>export LD_LIBRARY_PATH=/opt/fastflowlm/lib:/opt/xilinx/xrt/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}<br>export FLM_CONFIG_PATH=/opt/fastflowlm/share/flm/model_list.json<br>/opt/fastflowlm/bin/flm validate</code></div>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the purpose of running the flm validate command yous shouldn't need to export LD_LIBRARY_PATH or FLM_CONFIG_PATH to the environment for the whole shell (ie export). Just run the single application like that.

IE:

LD_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 validate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this to the single-command form so the env vars only apply to flm validate, rather than exporting them for the whole shell.


<h3>1. Outdated NPU Firmware</h3>
<p>If <code>flm validate</code> reports a firmware issue, ensure you have version <strong>1.1.0.0 or later</strong>.</p>
<p>If <code>flm validate</code> reports a firmware issue, update the firmware package from your Linux distribution and reboot.</p>
Copy link
Copy Markdown
Member

@superm1 superm1 Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not true for all distros and this is in the generic FAQ. For example Ubuntu doesn't have updated firmware and you get it by running the DKMS package.
So I would just call it out as one way to potentially solve it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Softened this FAQ entry so it’s framed as one possible fix rather than a universal distro-independent answer, and pointed readers back to their distro’s recommended update path.

<div class="code-block">
<code>cat /sys/bus/pci/drivers/amdxdna/*/fw_version</code>
</div>
<p>If the firmware is older than 1.1.0.0, you'll need to update it through your Linux distribution (typically by updating the <code>linux-firmware</code> package).</p>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering my above comments I guess with this text maybe it should be more wishy washy than assertive.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the firmware troubleshooting text less assertive and more distro-agnostic to match the generic FAQ context.

@elijahsgh
Copy link
Copy Markdown
Contributor

elijahsgh commented Mar 9, 2026

I have this working in Fedora 43. I skipped building locally.
Here's what I have put together.

driver (via xanderlent copr)

sudo dnf copr enable xanderlent/amd-npu-driver
sudo dnf install xrt xdna-driver

driver check

. /usr/xrt/setup.sh
sudo -E xrt-smi examine

Example output

Device(s) Present
|BDF             |Name          |
|----------------|--------------|
|[0000:be:00.1]  |RyzenAI-npu5  |

Kernel 7.0 required, update kernel

sudo dnf copr enable @kernel-vanilla/mainline
sudo dnf upgrade 'kernel*'
sudo reboot

limits.conf

* soft memlock unlimited
* hard memlock unlimited

Docker (used for fedora toolbox, quadlet, etc)

FROM ubuntu:26.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    software-properties-common \
    wget \
    curl \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

RUN add-apt-repository ppa:amd-team/xrt && \
    apt-get update && \
    apt-get install -y \
    libxrt2 \
    libxrt-npu2 \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /tmp
COPY fastflowlm_0.9.34-105-g25271c1_ubuntu26.04_amd64.deb /tmp
RUN apt-get update && \
    apt-get install -y ./fastflowlm_0.9.34-105-g25271c1_ubuntu26.04_amd64.deb && \
    rm fastflowlm_0.9.34-105-g25271c1_ubuntu26.04_amd64.deb

ENV XILINX_XRT=/usr
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

WORKDIR /app

# Final check for NPU connectivity
CMD ["flm", "validate"]

podman run

podman build . --tag fastflowlm-test:latest
podman run -it --rm \
        -p 52625:52625 \
        -v "${PWD}/flm:/root/.config/flm" \
        --device=/dev/accel/accel0:/dev/accel/accel0 \
        --ulimit memlock=-1:-1 \
        --security-opt label=disable \
        --cap-add=IPC_LOCK \
        fastflowlm:latest flm validate

flm validate

[Linux]  Kernel: 7.0.0-0.rc3.227.vanilla.fc43.x86_64
[Linux]  NPU: /dev/accel/accel0 with 8 columns
[Linux]  NPU FW Version: 1.1.2.65
[Linux]  amdxdna version: 0.6
[Linux]  Memlock Limit: infinity

Load embeddinggemma

[FLM]  Model downloaded successfully!
[FLM]  All files verified successfully.
[FLM]  Loading model: /root/.config/flm/models/Embedding-Gemma-300M-NPU2
[FLM]  Loading model: /root/.config/flm/models/Gemma3-4B-NPU2
[FLM]  Starting server on port 52625...
[FLM]  WebServer started on port 52625 with 10 I/O threads
[FLM]  Press Ctrl+C to stop.

@troyfolger
Copy link
Copy Markdown

troyfolger commented Mar 24, 2026

@elijahsgh --

your step-by-step instructions are very helpful, thank you.

Well, actually, for me they are just theoretically helpful, because I am not successful running the xrt-smi examine command in the "driver check". The xanderlent copr and subsequent driver and xrt install are successful, but the xrt-smi command is not.

First, the setup.sh:

$ . /usr/xrt/setup.sh
Autocomplete enabled for the xrt-smi command
Autocomplete enabled for the xbmgmt command
XILINX_XRT        : /usr/xrt
PATH              : /usr/xrt/bin:/usr/local/bin:/usr/bin:/var/lib/snapd/snap/bin
LD_LIBRARY_PATH   : /usr/xrt/lib
PYTHONPATH        : /usr/xrt/python

followed by the xrt-smi command:

$ sudo -E xrt-smi examine
sudo: xrt-smi: command not found

If I provide the full path for the xrt-smi executable:

$ sudo -E /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: 81628
UID: 0
[Tue Mar 24 05:56:52 2026 GMT]
HOST: zenbook.homedomain.net
EXE: /usr/xrt/bin/unwrapped/xrt-smi
[xrt-smi] ERROR: No such library '/usr/xrt/lib/libxrt_core.so.2'

or just trying without sudo:

$ xrt-smi examine
XRT build version: 2.19.0
Build hash: 
Build date: 2025-04-25 00:00:00
Git branch: 
PID: 82013
UID: 1000
[Tue Mar 24 06:05:48 2026 GMT]
HOST: zenbook.homedomain.net
EXE: /usr/xrt/bin/unwrapped/xrt-smi
[xrt-smi] ERROR: No such library '/usr/xrt/lib/libxrt_core.so.2'

I am running a fresh install of Fedora 43 on an ASUS Zenbook, AMD Ryzen AI 9 365 w/ Radeon 880M. Is there perhaps a missing step or linux system configuration that needs to be performed?

Thank you -

UPDATE:

Further googling revealed this symlink:

sudo ln -sf ../lib64/libxrt_core.so.2.19.0 /usr/xrt/lib/libxrt_core.so.2

That symlink did get xrt-smi working, but it was still necessary to specify the full path:

$ sudo -E /usr/xrt/bin/xrt-smi examine
System Configuration
  OS Name              : Linux
  Release              : 6.19.8-200.fc43.x86_64
  Machine              : x86_64
  CPU Cores            : 20
  Memory               : 23119 MB
  Distribution         : Fedora Linux 43 (Workstation Edition)
  GLIBC                : 2.42
  Model                : ASUS Zenbook S 16 UM5606WA_UM5606WA
  BIOS Vendor          : American Megatrends International, LLC.
  BIOS Version         : UM5606WA.321

XRT
  Version              : 2.19.0
  Branch               : 
  Hash                 : 
  Hash Date            : 2025-04-25 00:00:00
  virtio-pci           : unknown, unknown
  amdxdna              : unknown, unknown
  NPU Firmware Version : 1.0.0.63

Device(s) Present
|BDF             |Name          |
|----------------|--------------|
|[0000:c5:00.1]  |RyzenAI-npu4  |

So, perhaps this additional step needs to be documented? And I'm not sure about the path issue ...

@elijahsgh
Copy link
Copy Markdown
Contributor

Ah interesting @troyfolger
I would check if I made that symlnk and forgot but I've moved that system over to just building xrt and amdxdna from source.

I don't remember making that symlink but clearly it was necessary. Good to hear you got it working! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: Fedora 43 XDNA2 FLM beta setup is working but needs explicit Linux guidance

4 participants