Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# OS files
.DS_Store

# Dependencies
/node_modules/

# IDE / editor local state
/.vs/

# Local agent configuration
/.claude/
/.opencode/
/AGENTS.md
/opencode.json

# Auto-generated JSON files
/static/json/baidu_tongji_data.json
/static/json/commit_update_data.json
.DS_Store
/.vs
node_modules
.claude
126 changes: 126 additions & 0 deletions docs/aicore/dx-m1/windows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
sidebar_position: 4
doc_kind: page
locale: zh
board: dx-m1
task_type: getting-started
last_verified: 2026-06-30
---

# Windows 平台支持

智核 DX-M1 / DX-M1M 支持 Windows 10 / 11 x64 平台。本页介绍驱动安装、运行时配置及应用示例,帮助你快速在 Windows 上使用 NPU 推理。

## 使用前提

- **硬件**:智核 DX-M1 或 DX-M1M 模组,已通过 PCIe / M.2 接口接入主机
- **操作系统**:Windows 10 或 Windows 11(x64)
- **运行库**:[Microsoft Visual C++ 2015-2022 Redistributable (x64)](https://aka.ms/vs/17/release/vc_redist.x64.exe)
- **权限**:管理员权限(驱动安装和服务注册需要)

## 驱动安装

智核 DX-M1 / DX-M1M 在 Windows 上通过 PCIe 接口通信,需安装配套驱动。

1. 解压 `dx_rt_windows` 软件包,进入 `m1/v3.2.0/dxm1drv/` 目录
2. 解压 `dxm1drv.zip`,得到 `dxm1drv.inf`、`dxm1drv.sys`、`dxm1drv.cat`
3. 右键点击 `dxm1drv.inf`,选择 **安装**
4. 安装完成后,打开设备管理器,在 **处理加速器 (Processing accelerators)** 下应能看到 **DEEPX DEVICE - M1 PCI CONTROLLER**

## 运行时安装

驱动安装完成后,安装运行时守护进程。

1. 以管理员身份打开 **命令提示符 (cmd)** 或 **PowerShell**
2. 进入运行时目录(以 v3.2.0 为例):

```bash
cd m1\v3.2.0\dx_rt\bin
```

3. 注册并启动 DXRT 守护进程:

```bash
dxrtd.exe --install
dxrtd.exe --start
```

`dxrtd.exe` 注册为 Windows 服务后,系统启动时会自动运行。你也可以使用 `services.msc` 管理该服务。

:::tip 版本选择
`v3.2.0` 和 `v3.3.1` 使用相同的驱动,可按需选用。`v3.2.0` 提供完整的驱动 + 运行时 + 应用示例;`v3.3.1` 仅包含运行时。
:::

## 设备验证

使用 `dxrt-cli.exe` 验证 NPU 设备是否正常识别:

```bash
dxrt-cli.exe -s
```

正常输出应显示设备信息,类似:

```text
Device Information:
Device ID: 0
Device Name: DX-M1
Firmware Version: ...
Status: Ready
```

你也可以使用 `dxtop.exe` 实时监控 NPU 状态:

```bash
dxtop.exe
```

## 应用示例

### 演示应用(v3.0.2,推荐)

`m1/v3.2.0/dx_app/v3.0.2/` 提供预编译的演示程序,涵盖目标检测、人脸识别、姿态估计、语义分割等任务。

1. 首次使用需运行 `m1/v3.2.0/dx_app/setup.bat` 下载模型和示例视频
2. 运行交互式菜单:

```bash
cd m1\v3.2.0\dx_app\v3.0.2
run_demo.bat
```

3. 按菜单提示选择对应模型即可运行推理演示

常用模型包括 `yolov5_sync`、`yolov8_sync`、`scrfd_sync`、`efficientnet_sync` 等,均提供同步 (`_sync`) 和异步 (`_async`) 两种模式。

### Python 接口

安装 Python wheel 包后可直接在 Python 中调用 NPU:

```bash
# 根据 Python 版本选择对应的 wheel(支持 Python 3.10 ~ 3.14)
pip install m1\v3.2.0\dx_rt\python\dx_engine-1.1.4-cp312-cp312-win_amd64.whl
```

Python CLI 推理示例:

```bash
python m1\v3.2.0\dx_rt\python\cli\run_model.py -m <model.dxnn> -l 100
```

Python API 调用示例:

```python
from dx_engine import InferenceEngine

engine = InferenceEngine()
engine.load_model("model.dxnn")
engine.run()
```

## 故障排除

- **设备管理器中看不到 DEEPX 设备**:检查 PCIe / M.2 物理连接,确认模组已正确插入。尝试重新扫描硬件(`devmgmt.msc` → 操作 → 扫描检测硬件改动)。
- **dxrt-cli.exe -s 报错**:确认 `dxrtd.exe` 已启动(`services.msc` 中查看 `DXRT Daemon` 服务状态)。
- **运行 demo 无输出**:确认已执行 `setup.bat` 下载模型和视频文件,网络需能访问 `sdk.deepx.ai`。
- **VC++ 报错**:确认已安装 Microsoft Visual C++ 2015-2022 Redistributable (x64)。
9 changes: 6 additions & 3 deletions docs/fogwise/airbox-q900/ai-dev/qim-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,17 @@ gst-ai-classification --config-file=/etc/configs/config_classification.json
| [事件编码器](./event-encoder.md) | 检测事件编码输出 | YOLOX | DSP |
| [元数据解析](./metadata-parser.md) | 检测结果元数据导出 | YOLOX | DSP |
| [多流推理](./multistream-inference.md) | 多路同步检测 | YOLOX | DSP |
| [多流批量推理](./multistream-batch-inference.md) | 批量多路检测 | YOLOv8 (batch=4) | DSP |
| [多输入多输出](./multi-input-output.md) | 多路输入输出检测 | YOLOv5 | DSP |
| [人脸检测](./face-detection.md) | 人脸关键点检测 | Lightweight Face Detection | DSP |

> 完整列表参见 [IM SDK 参考手册](https://docs.qualcomm.com/doc/80-70020-50SC/topic/download-model-and-label-files.html) 第 3 章。

## 参考

- [Python GStreamer 应用](./python-apps.md) — Python 绑定示例
- [源码编译](./build-from-source.md) — 在设备上编译自定义 GStreamer 应用
- [Python GStreamer 应用](./python-apps.md) — Python 方式,适合自定义前后处理
- [源码编译](./build-from-source.md) — C/C++ 方式,适合深度定制插件
- [模型导出](./model-export.md) — 自行导出 YOLOv5/YOLOv8 模型

## 排障

Expand All @@ -144,7 +147,7 @@ gst-ai-classification --config-file=/etc/configs/config_classification.json
<NewCodeBlock tip="radxa@airbox$" type="device">

```bash
ls $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY
ls $XDG_RUNTIME_DIR/wayland-0
```

</NewCodeBlock>
Expand Down
109 changes: 66 additions & 43 deletions docs/fogwise/airbox-q900/ai-dev/qim-sdk/build-from-source.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,103 @@
---
sidebar_position: 16
sidebar_position: 18
doc_kind: page
locale: zh
board: airbox-q900
task_type: ai-dev
last_verified: 2026-06-24
last_verified: 2026-06-30
---

# 源码编译

QIM SDK 的所有 GStreamer 插件和示例应用已通过 [apt 安装](./README.md#安装) 提供预编译包,一般情况下无需自行编译
前面的 [Demo](./README.md#可用示例应用)(`gst-ai-*`)和 [Python 应用](./python-apps.md) 使用的是 apt 预编译的 GStreamer 插件。如果你需要**修改插件源码**(如定制后处理逻辑、添加自定义模型支持)或**写自己的 C/C++ 推理程序**,可以在设备上直接编译

你也可以在设备上直接编译源码,用于以下场景:
## Hello-QIM:最小 C/C++ 示例

- 修改插件源码,定制后处理逻辑或添加自定义模型支持
- 调试插件内部行为
- 需要与预编译包不同的编译选项
Hello-QIM 是一个最小可运行的 GStreamer 应用,展示如何用 C++ 创建 pipeline 并获取摄像头帧。适合作为自定义应用的起点。

编译产物包括 34 个 GStreamer 插件动态库(`.so`),覆盖 AI 推理引擎(`mltflite`、`mlqnn`、`mlsnpe`)、预处理(`mlvconverter`)、后处理(`mlpostprocess` 等)、视频处理(`vcomposer` 等)。详见下方步骤。
### 下载源码

## 前提条件
<NewCodeBlock tip="radxa@airbox$" type="device">

- 已完成 [QIM SDK 安装](./README.md#安装)
```bash
git clone https://github.com/quic/sample-apps-for-qualcomm-linux
cd sample-apps-for-qualcomm-linux/Hello-QIM
```

## 安装编译依赖
</NewCodeBlock>

### 准备源文件

<NewCodeBlock tip="radxa@airbox$" type="device">

```bash
sudo apt-add-repository -s ppa:ubuntu-qcom-iot/qcom-ppa
sudo apt update
sudo apt install -y \
qcom-adreno-dev \
libgstreamer1.0-qcom-sample-apps-utils-dev
cp main.cc gst-appsink.cc
```

</NewCodeBlock>

## 编译 QIM 插件(从源码)
### 创建 Makefile

```makefile
CC = g++
CFLAGS = -Wall -g $(shell pkg-config --cflags gstreamer-1.0)
LDFLAGS = $(shell pkg-config --libs gstreamer-1.0)

all: gst-appsink

gst-appsink: gst-appsink.o
$(CC) -o $@ $^ $(LDFLAGS)

gst-appsink.o: gst-appsink.cc
$(CC) $(CFLAGS) -c $<

clean:
rm -f gst-appsink gst-appsink.o
```

### 步骤 1:下载 QIM 源码
### 编译并运行

<NewCodeBlock tip="radxa@airbox$" type="device">

```bash
cd ~
apt source gst-plugins-qti-oss
cd gst-plugins-qti-oss-*
make
./gst-appsink -w 1280 -h 720
```

</NewCodeBlock>

### 步骤 2:CMake 编译
预期输出:

```text
Hello-QIM: Success creating pipeline and received camera frame.
```

> 如果设备没有连接摄像头,pipeline 创建仍然会成功,只是收不到帧。

## 编译 QIM 插件(进阶)

如果需要修改 GStreamer 插件本身(而不仅仅是调用插件),可以从源码编译全部插件。

### 安装编译依赖

<NewCodeBlock tip="radxa@airbox$" type="device">

```bash
sudo apt install -y \
qcom-adreno-dev \
libgstreamer1.0-qcom-sample-apps-utils-dev
```

</NewCodeBlock>

### 下载并编译

<NewCodeBlock tip="radxa@airbox$" type="device">

```bash
cd ~
apt source gst-plugins-qti-oss
cd gst-plugins-qti-oss-*
mkdir build && cd build

cmake \
Expand All @@ -71,27 +113,12 @@ cmake \
..

make -j$(nproc)
```

</NewCodeBlock>

### 步骤 3:安装

<NewCodeBlock tip="radxa@airbox$" type="device">

```bash
sudo make install
```

</NewCodeBlock>

### 步骤 4:验证

```bash
ls /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstqti*.so | wc -l
```

编译安装约 34 个插件动态库,输出如 `libgstqtimltflite.so`、`libgstqtimlvclassification.so` 等。
编译安装约 34 个插件动态库(`libgstqtimltflite.so`、`libgstqtimlvclassification.so` 等)。

## 排障

Expand All @@ -107,7 +134,7 @@ pkg-config --modversion gstreamer-1.0

</NewCodeBlock>

如果提示找不到,安装
如果提示找不到:

<NewCodeBlock tip="radxa@airbox$" type="device">

Expand All @@ -116,7 +143,3 @@ sudo apt install libgstreamer1.0-dev
```

</NewCodeBlock>

## 参考

- [Python GStreamer 应用](./python-apps.md) — Python 开发方式
2 changes: 1 addition & 1 deletion docs/fogwise/airbox-q900/ai-dev/qim-sdk/event-encoder.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 13
sidebar_position: 15
doc_kind: page
locale: zh
board: airbox-q900
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 14
sidebar_position: 16
doc_kind: page
locale: zh
board: airbox-q900
Expand Down
Loading