Raspberry Pi 5 can use a Rockchip RK1820 as an external AI accelerator over PCIe. This project verifies the complete path from hardware assembly and driver installation to a vision model and local language generation on a Pi 5 with an RK1820 M.2 2242 module.
The Pi runs Linux, RKNN3 Runtime, and the test applications. The RK1820 executes the model. We verified MobileNetV2 inference and Qwen2.5-0.5B text generation with Runtime 1.1.0 at an NPU frequency of 166 MHz.
Rockchip's RK1820_RK1828 Raspberry Pi M.2 Quick Start, V1.0.0, describes both RK1820 and RK1828 modules. The physical device tested in this project is an RK1820 2242. The results below do not establish performance or compatibility for every RK1828 module, adapter, or OS image.
Hardware and verified environment
| Component | Tested configuration |
|---|---|
| Host | Raspberry Pi 5 Model B Rev 1.1 |
| Accelerator | RK1820 M.2 2242; device reports 2560 MB memory |
| Connection | PCIe FPC cable and RK_EXT_PIHAT_RK182X adapter |
| PCIe link | 5.0 GT/s, x1 |
| OS | Debian 13.7 (trixie), ARM64 |
| Kernel | 6.18.50+rpt-rpi-2712 |
| Installation package | rknn3-rk182x-m2-2242_1.1.0_arm64.deb |
| PCIe driver | 3.3.1 |
| Device firmware / RKNN3 API | 1.1.0 / 1.1.0 |
| rknn-smi | 1.3.0 |
| NPU frequency | 166 MHz |
Use cooling for both the Pi and the accelerator. The Rockchip guide recommends the official Raspberry Pi 27W USB-C supply or an equivalent suitable supply. Check the adapter's input requirements and connector labels; a charger's total wattage alone does not establish suitability.
1. Assemble and power the hardware
Watch the installation video on YouTube
- Disconnect power before handling the module or PCIe cable.
- Insert the RK1820 into the adapter's M.2 slot and secure it with the appropriate screw.
- Connect the PCIe FPC cable between the Pi 5 and the adapter. Check the contact orientation and close both connector latches.
- Check the cooling and all connections before applying power.
- For the RK_EXT_PIHAT_RK182X adapter described in the guide, connect the supply to the adapter's USB-C power input. The adapter powers the complete system. Powering only the Pi's own USB-C input may leave the accelerator unpowered.
If the adapter has multiple USB-C connectors, identify the power input from its labeling or board documentation before connecting the supply.
2. Install the driver and Runtime
Obtain the module-specific Debian package from your board or SDK provider. This project uses the 2242 package; use the corresponding provider-approved package for a 2280 module.
The following commands run in a Linux shell on the Pi. Replace the SSH username and address with your own when connecting from your PC; no default password is required by these instructions.
mkdir -p ~/rk1820_rk1828
cd ~/rk1820_rk1828Copy rknn3-rk182x-m2-2242_1.1.0_arm64.deb into this directory, then install it:
sudo apt update
sudo apt install -y ./rknn3-rk182x-m2-2242_1.1.0_arm64.debThe installer builds the PCIe driver and installs the firmware, Runtime, device management tool, and test programs. Check that driver compilation and package configuration finish successfully before rebooting:
sudo rebootThe Pi needs access to its configured APT repositories to obtain dependencies such as DKMS. If dependency downloads fail, the local .deb being found does not mean installation completed. Resolve repository connectivity and rerun the installation. Driver compilation also requires headers matching the running kernel; check uname -r and /lib/modules/$(uname -r)/build when diagnosing build failures.
3. Verify the device and select a supported frequency
After rebooting and reconnecting:
lspci -nn
ls -l /dev/pcie-rkep-* 2>/dev/null
sudo rknn-smi info
sudo rknn-smi -v
sudo rknn-smi info -t npu_freqOur PCIe enumeration included:
0001:01:00.0 Processing accelerators [1200]: Rockchip Electronics Co., Ltd RK182x Edge AI Computing Coprocessor [1d87:182a] (rev 01)The device must have a /dev/pcie-rkep-* node, and rknn-smi info should report RK1820, Online, OK. Record the driver, firmware, and API versions before testing models.
Our 2242 module reported supported frequencies of 166, 200, 250, and 300 MHz. We used 166 MHz for initial testing:
sudo rknn-smi set -t npu_freq -d 0 -s 166
sudo rknn-smi info -t npu_freqSelect a value from your device's actual Available NPU Freq output. Do not copy the 400 MHz example for a 2280 module onto this 2242 configuration.
If the device does not appear, inspect the link and driver separately:
lsmod | grep rkep
sudo dmesg | grep -iE 'pcie|rkep|rknn' | tail -100During initial setup, the driver was loaded but the external PCIe link reported link down, no RK endpoint appeared in lspci, and rknn-smi failed to initialize. Later checks showed link up, 5.0 GT/s PCIe x1 and the RK endpoint. A loaded driver alone does not prove the hardware link is working. Check adapter power and the FPC connection before repeatedly reinstalling the software. The available observations do not isolate which physical change restored that link.
4. Run MobileNetV2
Prepare a matching model and weight pair in:
~/rk1820_rk1828/MobileNetV2/
├── mobilenetv2-12.rknn
└── mobilenetv2-12.weightThis test reused the MobileNetV2 pair from an existing RKNN3 model package under rknn3_models/v1.0.0/cnn/MobilenetV2. That specific pair completed inference with Runtime 1.1.0; this is not a general claim that all older models are compatible. Obtain compatible preconverted models from the SDK provider, or use the RKNN3 model download (access code: rknn) and verify the supplied names and instructions.
Run on the Pi:
cd ~/rk1820_rk1828/MobileNetV2
sudo rknn3_model_test \
mobilenetv2-12.rknn \
mobilenetv2-12.weight \
0x1 '' '' 0 1The installed 1.1.0 test tool takes core_mask immediately after the weight path. The empty arguments skip input and golden output files; 0 selects the shape and 1 runs one loop. Check rknn3_model_test --help if your tool version differs from this project or the older quick-start document.
Successful output includes model initialization, All 1 loops completed successfully, and the average model run time. In one recorded run at 166 MHz, the model run time was 11.343 ms, with a total per-loop time of 12.249 ms including input and output synchronization.
This command uses random input and skips comparison against golden outputs. It verifies the inference path, not classification accuracy. These single-run timings are observations, not a sustained throughput benchmark.
5. Generate text with Qwen2.5-0.5B
In the RKNN3 model download, enter access code rknn and navigate to:
RKNN3_SDK/rknn3_models/v1.1.0/llm/Qwen2.5-0.5BCopy all four files from that same release into the Pi's working directory. Preserve the official filenames, which omit the -Instruct suffix used in the older guide:
~/rk1820_rk1828/Qwen2.5-0.5B/
├── Qwen2.5-0.5B.rknn
├── Qwen2.5-0.5B.weight
├── Qwen2.5-0.5B.tokenizer.gguf
└── Qwen2.5-0.5B.embed.binThe four files total approximately 632 MB (603 MiB). Check download sizes and transfer integrity; do not combine an older model with an embedding file from a different model.
Run:
cd ~/rk1820_rk1828/Qwen2.5-0.5B
sudo rknn3_session_test \
Qwen2.5-0.5B.rknn \
Qwen2.5-0.5B.weight \
Qwen2.5-0.5B.tokenizer.gguf \
Qwen2.5-0.5B.embed.bin \
2048 256 0xffThis model provides a 2048-token context configuration, so we use 2048 rather than the older guide's 1024. The next argument limits generation to 256 new tokens, followed by the core mask.
The vendor test program runs built-in questions automatically; the command does not accept a question as a positional argument. Its original tests include Chinese and English questions about relativity. For the English community recording, we changed only the local test program's built-in Chinese question to Explain the basic concepts of relativity. and retained a backup. That presentation change is not required to run the downloaded model; an unmodified installation can still display the Chinese test first.
Check for readable generated text, performance statistics, and END TEST. Reaching the configured new-token limit is expected when the answer is longer than 256 tokens.
| Observation | Recorded result |
|---|---|
| NPU frequency | 166 MHz |
| Context / maximum new tokens | 2048 / 256 |
| English test 1 generation | 255 decode tokens in 3820.02 ms; 66.75 tokens/s |
| English test 2 generation | 255 decode tokens in 3821.18 ms; 66.73 tokens/s |
| Process exit code | 0 |
| Device after the test | Online / OK |
Generation rates are the test tool's Generate statistics. They exclude prefill and model initialization and vary with prompts, generation settings, frequency, and model release. The tool reports 256 output tokens and counts 255 tokens in its timed Generate stage; the values above preserve that distinction.
What this project demonstrates
The verified Pi 5 + RK1820 configuration supports both a CNN inference test and local language generation through RKNN3 Runtime. The same setup can serve as a starting point for an application that uses the Pi for input, orchestration, and its user interface while the RK1820 handles model inference. Longer stability tests and application-specific accuracy checks remain separate from this initial validation.