Running LLMs on Dragon Q6A NPU - Setup Guide & Questions

Goal

Run small LLMs (2-3B parameters like Qwen2.5-3B, Phi-3 Mini, Gemma 2B) using the Qualcomm Hexagon NPU for inference acceleration.

What I’ve Done So Far

1. System Installation

  • :white_check_mark: Flashed Armbian to MicroSD card

  • :white_check_mark: Successfully booted with GNOME desktop

  • :white_check_mark: Verified firmware version (251013 - latest)

  • :white_check_mark: System running stable

2. QAIRT SDK Installation

Following the Radxa NPU development guide:

Qualcomm Software Center:

sudo dpkg -i QualcommSoftwareCenter1.17.2.Linux-arm64.deb
sudo apt --fix-broken install -y

QAIRT SDK 2.40.0.251030:

  • Downloaded from GitHub releases (v2.40.0.251030.zip)

  • Extracted to ~/qairt/2.40.0.251030/

  • Verified SDK structure:

    • lib/aarch64-ubuntu-gcc9.4/ contains libQnnHtp.so and NPU backends

    • lib/hexagon-v68/unsigned/ contains libQnnHtpV68Skel.so

    • bin/aarch64-ubuntu-gcc9.4/ contains CLI tools

Environment Configuration: Added to ~/.bashrc:

bash

# QAIRT SDK
export QAIRT_SDK_ROOT=~/qairt/2.40.0.251030
export LD_LIBRARY_PATH=$QAIRT_SDK_ROOT/lib/aarch64-ubuntu-gcc9.4:$LD_LIBRARY_PATH
export PATH=$QAIRT_SDK_ROOT/bin/aarch64-ubuntu-gcc9.4:$PATH

System Library Setup:

bash

sudo mkdir -p /usr/lib/rfsa/adsp/
sudo cp ~/qairt/2.40.0.251030/lib/hexagon-v68/unsigned/libQnnHtpV68Skel.so /usr/lib/rfsa/adsp/

3. QAI AppBuilder Installation

  • :white_check_mark: Downloaded qai_appbuilder-2.28.0-cp312-cp312-linux_aarch64.whl

  • :white_check_mark: Ready to install with: pip3 install qai_appbuilder-2.28.0-cp312-cp312-linux_aarch64.whl

Questions & Need Help

  1. Has anyone successfully run LLMs on Q6A’s NPU? What models work best?

  2. QAI AppBuilder workflow: After installing the Python wheel, what’s the complete process to:

    • Convert a Hugging Face model (e.g., Qwen2.5-3B) to QNN format?

    • Quantize to INT8 for NPU?

    • Run inference using the NPU backend?

  3. Performance expectations: What’s realistic inference speed (tokens/second) for 2-3B models on the Hexagon NPU?

  4. Model recommendations: Which specific models are confirmed working:

    • Qwen2.5-1.8B/3B?

    • Phi-3 Mini?

    • Gemma 2B?

    • MiniCPM 2B?

Reference Resources

1 Like

我在 Radxa Dragon Q6A(QCS6490 平台)上尝试部署 Qualcomm 的 QNN Runtime、QAI Hub 模型以及 Genie LLM 应用时,遇到了如下问题和困难,现整理如下,供你们排查与协助:


一、设备与系统环境

  • 设备:Radxa Dragon Q6A

  • SoC:Qualcomm QCS6490 / QC6094

  • 系统:Radxa OS 25.11(基于 Ubuntu/KDE)

  • 内核:6.17.1-3-qcom

  • Python 环境:conda + mamba

  • QNN SDK 版本:2.41.0.251128(Linux AArch64)

我已经正确安装了完整的 QNN SDK,路径为:


~/qnn/qairt/2.41.0.251128

其中包含:


bin/
lib/
include/
examples/
tools/

QNN 工具可以正常运行,例如:


qnn-net-run
qnn-context-binary-generator
qnn-throughput-net-run


二、QNN SDK 多版本工具目录导致使用困难

QNN SDK 的 bin/ 目录下包含多个平台版本:


aarch64-android
aarch64-oe-linux-gcc11.2
aarch64-oe-linux-gcc8.2
aarch64-oe-linux-gcc9.3
aarch64-ubuntu-gcc9.4
x86_64-linux-clang

最终测试发现:

:check_mark: 只有 aarch64-oe-linux-gcc11.2 中的工具可以在 Q6A 上运行
其他平台版本(如 android / ubuntu)均无法在系统环境下运行。


三、QAI Hub 模型访问权限严重受限,无法访问任何 LLM 模型

我已成功使用 qai-hub configure 完成身份验证,但执行:


from qai_hub.client import Client
c = Client()
c.get_models()

只能得到以下两个模型:


Real_ESRGAN_x4plus(两个版本)

无法访问任何 LLM 模型,包括:

  • TinyLlama

  • Phi-3 Mini

  • Phi-3.1

  • LLaMA 3.x 系列

  • Gemma 2B

  • Qualcomm 官方提供的 Distilled LLMs

  • Whisper、TTS 等模型

这导致我无法完成 Qualcomm 官方教程《LLM on Genie》中要求的步骤,因为该教程必须导出一个 LLM 模型(如 tinyllama、phi-3-mini 等)。

尝试运行:


python -m qai_hub_models.models.tinyllama.export

会报错:


ModuleNotFoundError: No module named 'qai_hub_models.models.tinyllama'

说明 QAI Hub 返回的模型列表里根本不包含 TinyLlama,因此无法导出,也无法构建 Genie LLM 的 genie_bundle。


四、Genie LLM 应用无法继续下去

《LLM on Genie》教程要求:

  1. 选择一个 LLM(如 TinyLlama、Phi、Llama、Gemma)

  2. 从 QAI Hub 编译/导出 QNN 模型

  3. 生成 genie_bundle

  4. 在设备上运行 Genie(genie-app)

但由于我的 QAI Hub 账号没有任何 LLM 的访问权限,我无法进行:


--target-runtime qnn_context_binary

从而整个 Genie LLM 教程无法继续


五、平台侧可能的问题与困惑

我怀疑:

1. QCS6490 / Radxa Q6A 是否本身无法访问 Qualcomm AI Hub 的 LLM 模型?

是否 Qualcomm 控制了 LLM 模型的可见性,导致开发板用户无法看到?

2. Radxa 是否需要向 Qualcomm 申请启用 LLM 模型访问权限?

包括:

  • TinyLlama

  • Phi 系列

  • LLaMA 3.1 / 3.2

  • Gemma

  • Qualcomm Distilled LLM

否则开发者无法使用 Genie、QNN LLM 推理、NPU 测试等关键功能。


六、请求 Radxa 官方协助的问题

我希望 Radxa 能协助确认:

:check_mark: 1. QCS6490 的用户是否可以访问 Qualcomm AI Hub 的 LLM 模型?

是否需要 Radxa 官方去申请“白名单”或“模型访问授权”?

:check_mark: 2. Radxa 是否计划提供针对 QCS6490 的 NPU/HTP 驱动?

否则 QNN 无法使用 HTP,加速 LLM 的功能完全无法体验。

:check_mark: 3. Radxa 能否联系 Qualcomm,确认 Q6A 的 QAI Hub 权限配置?

官方教程明确要求可以访问 LLM 模型,但普通用户账号没有权限。

:check_mark: 4. 是否能提供针对 QCS6490 的官方 Genie LLM 示例?

目前官方教程完全无法执行。


七、我已经验证的内容(可帮助定位问题)

  • QNN SDK 已成功安装

  • QNN 工具可在 aarch64-oe-linux-gcc11.2 正常运行

  • ESRGAN 模型可以导出并推理(pipeline 正常)

  • 只有 LLM 模型访问受限

  • 环境变量、PATH、Python 模块均已正确配置

Hi, @Hao_Huang

the QNN SDK is provided by Qualcomm for multiple platforms, and on Radxa devices it must be built with aarch64-oe-linux-gcc 11.2.

There is also a misunderstanding regarding QAI Hub access permissions: the QAI Hub library is tied to your personal account, and it only records the models you yourself have converted through QAI Hub.
So if you have only converted Real_ESRGAN_x4plus, then you will only see those two related models — it is not a public model repository.

Regarding the error ModuleNotFoundError: No module named 'qai_hub_models.models.tinyllama':
please refer to the model list in the documentation QAI Hub Models | Radxa Docs . The TinyLlama model has not yet been added in this version.

best,
Morgan

1 Like

I went down exactly the same rabbit hole. :grinning_face_with_smiling_eyes: Spent weeks trying QAIRT, QNN, AI Hub, ExecuTorch, compiled binaries, and even rented a RunPod instance just to verify I wasn’t losing my mind. Nothing worked. I also found it very difficult to follow the Qualcomm documentation as several examples and workflows either didn’t match reality or simply didn’t work as expected.

Finally got Llama 3.2 1B running on the Hexagon NPU using TrailCurrent’s script, and I can also confirm it works on Armbian 26.2.4 (Ubuntu 24.04 LTS), not just the official Radxa OS.

Qualcomm’s AI ecosystem definitely isn’t for the faint-hearted. It feels like solving an escape room before you can run your first prompt. :sweat_smile:

My only remaining disappointment is the apparent 1024-token context window and ~250-token output limit. Is that a limitation of the compiled QAIRT model, Genie, or the backend itself?

The script I used downloads the precompiled binaries from ModelScope:

At least it finally got the NPU working. Hopefully larger context windows become possible in the future.