Skip to content
Open
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
25 changes: 25 additions & 0 deletions docs/common/ai/qualcomm/_fastrpc_setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,31 @@ NPU 环境配置清单

{/* </Tabs> */}

检查 /dev/fastrpc* 设备节点

安装软件包后,可先确认设备节点已正常创建,再运行测试:

```bash
ls /dev/fastrpc*
```

若看到 `/dev/fastrpc-cdsp` 等设备节点,说明驱动已加载,可继续运行验证步骤。

若设备节点不存在(`ls: /dev/fastrpc*: No such file or directory`),通常为内核 FastRPC 驱动未加载所致,可尝试:

```bash
# 查看驱动是否已加载
lsmod | grep fastrpc

# 如未加载,尝试手动加载驱动
sudo modprobe qcom_fastrpc
ls /dev/fastrpc*
```

:::tip 使用 RadxaOS 官方镜像
RadxaOS 镜像(Debian)已预置 FastRPC 内核驱动。若在使用第三方 Ubuntu 镜像或自行编译的内核,驱动可能缺失。请确认设备运行的是 Radxa 官方镜像。
:::

验证 fastrpc 状态

<Tabs queryString="platform">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
NPU Environment Configuration Checklist

- [fastrpc](https://github.com/qualcomm/fastrpc)
- /dev/fastrpc-adsp
- /dev/fastrpc-cdsp
- /dev/fastrpc-cdsp-secure
- /usr/lib/dsp libraries

Install using radxa apt source

:::note Prerequisite
These packages depend on the Radxa APT source included in the official RadxaOS images. Before following the steps below, make sure the device is running the official RadxaOS image for the target board. If you are using a third-party Ubuntu/Debian image or have replaced the package sources, `fastrpc` / `fastrpc-test` may not be available.
:::

<Tabs queryString="platform">
<TabItem value="QCS6490" default={props.tag === "qcs6490"} attributes={{className: props.tag === "qcs9075" && "tab_none"}}>

<NewCodeBlock tip="Device" type="device">

```bash
sudo apt update
sudo apt install fastrpc libcdsprpc1
```

</NewCodeBlock>


</TabItem>

<TabItem value="QCS9075" default={props.tag === "qcs9075"} attributes={{className: props.tag === "qcs6490" && "tab_none"}}>

<NewCodeBlock tip="Device" type="device">

```bash
sudo apt update
sudo apt install fastrpc libcdsprpc1
```

</NewCodeBlock>

</TabItem>

</Tabs>

Check /dev/fastrpc* device nodes

After installing the packages, verify that the device nodes have been created before running the test:

```bash
ls /dev/fastrpc*
```

If you see `/dev/fastrpc-cdsp` and other device nodes, the kernel driver is loaded and you can proceed to the verification step.

If the devices do not exist (`ls: /dev/fastrpc*: No such file or directory`), the FastRPC kernel driver is likely not loaded. Try loading it manually:

```bash
# Check if the driver is loaded
lsmod | grep fastrpc

# If not loaded, try loading the driver manually
sudo modprobe qcom_fastrpc
ls /dev/fastrpc*
```

:::tip Use official RadxaOS image
The RadxaOS (Debian) image includes the FastRPC kernel driver by default. If you are using a third-party Ubuntu image or a self-built kernel, the driver may be missing. Make sure the device is running the official RadxaOS image.
:::

Verify fastrpc status

<Tabs queryString="platform">
<TabItem value="QCS6490" default={props.tag === "qcs6490"} attributes={{className: props.tag === "qcs9075" && "tab_none"}}>

<NewCodeBlock tip="Device" type="device">

```bash
sudo apt install fastrpc-test
fastrpc_test -a v68
```

</NewCodeBlock>

```bash
rock@radxa-dragon-q6a:~$ fastrpc_test -a v68

Demonstrating FARF run-time logging

hap_example function PASSED
Please look at the mini-dm logs or the adb logcat logs for DSP output

Demonstrating HAP_mem.h APIs

hap_example function PASSED
Please look at the mini-dm logs or the adb logcat logs for DSP output

Demonstrating HAP_perf.h APIs

hap_example function PASSED
Please look at the mini-dm logs or the adb logcat logs for DSP output
[PASS] libhap_example.so

Test PASSED
Please look at the mini-dm logs or the adb logcat logs for DSP output
[PASS] libmultithreading.so


Allocate 4000 bytes from ION heap
Creating sequence of numbers from 0 to 999
Compute sum on domain 3

Call calculator_sum on the DSP
Sum = 499500

Call calculator_max on the DSP
Max value = 999
[PASS] libcalculator.so


========================================
Test Summary:
Total tests run: 3
Passed: 3
Failed: 0
Skipped: 0
========================================

RESULT: All applicable tests PASSED
```

</TabItem>

<TabItem value="QCS9075" default={props.tag === "qcs9075"} attributes={{className: props.tag === "qcs6490" && "tab_none"}}>

<NewCodeBlock tip="Device" type="device">

```bash
sudo apt install fastrpc-test
fastrpc_test -a v75
```

</NewCodeBlock>

```bash
rock@radxa-airbox-q900:~$ fastrpc_test -a v75

Allocate 4000 bytes from ION heap
Creating sequence of numbers from 0 to 999
Compute sum on domain 3

Call calculator_sum on the DSP
Sum = 499500

Call calculator_max on the DSP
Max value = 999
[PASS] libcalculator.so

Test PASSED
Please look at the mini-dm logs or the adb logcat logs for DSP output
[PASS] libmultithreading.so


Demonstrating FARF run-time logging

hap_example function PASSED
Please look at the mini-dm logs or the adb logcat logs for DSP output

Demonstrating HAP_mem.h APIs

hap_example function PASSED
Please look at the mini-dm logs or the adb logcat logs for DSP output

Demonstrating HAP_perf.h APIs

hap_example function PASSED
Please look at the mini-dm logs or the adb logcat logs for DSP output
[PASS] libhap_example.so


========================================
Test Summary:
Total tests run: 3
Passed: 3
Failed: 0
Skipped: 0
========================================

RESULT: All applicable tests PASSED
```

</TabItem>

</Tabs>
Loading