CV / QA-CLIP ViT-L/14
QA-CLIP ViT-L/14
RK3588 + RK1820 PCIe
QA-CLIP ViT-L/14 W8A8 inference on RK3588 + RK1820 PCIe.
Choose the device you're using, the set up guide and documentation will update accordingly.
Getting Started
Armbian 26.8.7 Gnome or newer with OTA overlayroot: Configure Docker storage before running containers to avoid overlay mount errors.
sudo docker run --rm --name rv182x-rk3588-qaclip \
--privileged --net=host --ipc=host --stop-timeout 300 \
-v /run/lock:/run/lock \
-v /lib/modules:/lib/modules:ro \
-v /usr/src:/usr/src:ro \
-e PYTHONUNBUFFERED=1 \
-e RKNN_LOG_LEVEL=0 \
ghcr.io/seeed-projects/recomputer-rk-cv/rv182x-rk3588-qaclip:latest \
python3 web_detection.py --variant qaclip-vit-l14 --video video/test.mp4REST API
Use the REST API to run inference. Copy the commands below.
curl -X POST "http://<BOARD_IP>:8000/api/models/qaclip/predict" \
-F "file=@sample.jpg"import requests
with open("sample.jpg", "rb") as image:
response = requests.post(
"http://<BOARD_IP>:8000/api/models/qaclip/predict",
files={"file": image}, timeout=120,
)
response.raise_for_status()
print(response.json())Model Details
Armbian 26.8.7 Gnome or newer with OTA overlayroot: Configure Docker storage before running containers to avoid overlay mount errors.
QA-CLIP ViT-L/14 on RK3588 + RK1820 PCIe
Ranks candidate Chinese/English descriptions against an image; does not generate text or detection boxes.
Platform: RK3588 + RK1820 PCIe; Engine: RKNN3. Docker on ARM64; SDK 1.1.0. Verified kernel: 6.1.172-vendor-seeed-rk3588.
Run
Stop the previous model first. The image prepares the driver/proxy and checks inference; firmware writes are disabled by default.
1. Pull
sudo docker pull ghcr.io/seeed-projects/recomputer-rk-cv/rv182x-rk3588-qaclip:latest2. Start
Choose Size to update the Getting Started command, or use the matching command below.
sudo docker run --rm --name rv182x-rk3588-qaclip \
--privileged --net=host --ipc=host --stop-timeout 300 \
-v /run/lock:/run/lock \
-v /lib/modules:/lib/modules:ro \
-v /usr/src:/usr/src:ro \
-e PYTHONUNBUFFERED=1 \
-e RKNN_LOG_LEVEL=0 \
ghcr.io/seeed-projects/recomputer-rk-cv/rv182x-rk3588-qaclip:latest \
python3 web_detection.py --variant qaclip-vit-l14 --video video/test.mp4Open http://<BOARD_IP>:8000; API parameters: /docs.
Command options
Docker options go before the image name; model/input options go after web_detection.py.
| Option | Purpose |
|---|---|
--privileged | Load the host PCIe driver and open the card. |
--net=host --ipc=host | Share the network/IPC used by the RKNN3 proxy. No -p mapping needed. |
-v /run/lock:/run/lock | Prevent concurrent managed models from using the card. |
-v /lib/modules:/lib/modules:ro and -v /usr/src:/usr/src:ro | Read matching vendor headers for driver builds on other kernels; do not install headers. |
--stop-timeout 300 | Allow shutdown time, including explicit firmware maintenance. |
PYTHONUNBUFFERED=1 / RKNN_LOG_LEVEL=0 | Immediate Python logs / documented RKNN log level. |
-v "$PWD/workspace:/app/workspace" | Optional: retain uploads/results after container removal. No project directory required. |
--variant / --core_mask 0x1 | Model checkpoint / RK1820 core mask used for benchmarking. |
| Model files | Partitions are selected automatically by --variant; keep the image assets together. |
| Input | Change to the start command |
|---|---|
| Bundled video | Keep --video video/test.mp4. |
| Browser upload | Replace --video video/test.mp4 with --camera_id -1; upload/analyze/download remain available. |
| Board camera | Replace it with --camera_id 0; add --device /dev/video0:/dev/video0 before the image if mapping the existing camera explicitly. |
No camera, DRM or full /dev mount is needed for bundled video or browser uploads.
Update text candidates (maximum 128 tokens including special tokens):
curl -X POST "http://<BOARD_IP>:8000/api/prompts" \
-H 'Content-Type: application/json' -d '{"prompts":["一辆汽车","一条公路"]}'Predict
curl -X POST "http://<BOARD_IP>:8000/api/models/qaclip/predict" \
-F "file=@sample.jpg"Troubleshooting
Use the following variables for the commands in this section:
CONTAINER=rv182x-rk3588-qaclip
IMAGE=ghcr.io/seeed-projects/recomputer-rk-cv/rv182x-rk3588-qaclip:latest1. Read logs and check the card
For debugging, remove --rm from the start command so the exited container/logs remain. Otherwise save its foreground terminal output.
sudo docker logs --tail 100 "$CONTAINER"
uname -r
lspci -nn -d 1d87:182a
sudo docker run --rm --privileged --net=host --ipc=host \
ghcr.io/seeed-projects/recomputer-rk-cv/rv182x-rk3588-runtime:1.1.0 doctordoctor only checks status; it does not load drivers, start proxy or flash. Normal model startup prepares missing components. Success: SELF_TEST_PASSED, MODEL_START_READY, then:
curl -f http://127.0.0.1:8000/api/health2. Match the error and fix it
| Error | Command / fix |
|---|---|
DEVICE_BUSY, container name conflict, port 8000 in use | sudo docker stop "$CONTAINER" for this demo, or stop the identified competing demo. Save results, then sudo docker rm "$CONTAINER" if an exited container was retained. Run again. |
PCI_DEVICE_NOT_FOUND | lspci -nn -d 1d87:182a; if absent, check card power, seating and host PCIe configuration. |
KERNEL_HEADERS_MISSING, DRIVER_BUILD_FAILED, DRIVER_LOAD_FAILED | ls -l /lib/modules/"$(uname -r)"/build; install headers/toolchain matching that exact vendor kernel and keep both read-only mounts. Never force-load another kernel's module. |
ROOT_REQUIRED, DEVICE_PERMISSION_DENIED, LOCAL_LOCK_ONLY | Restore sudo, --privileged and the /run/lock mount from the start command. |
No RKNN devices found, RKNN3_ERR_DEVICE_UNAVAILABLE, PROXY_START_FAILED | Run doctor above. Pull the current image and recreate with the full start command, including host network/IPC. Keep the image's default entrypoint. |
CARD_OFFLINE | Check doctor, PCIe/power and SDK 1.1.0 compatibility; use the explicit M.2 maintenance step below only after confirming the hardware. |
SELF_TEST_FAILED, CARD_HEALTH_ERROR, CARD_STATUS_UNKNOWN, CARD_STATUS_QUERY_FAILED | Read the detailed log. Restore matching SDK/firmware and stop competing card users; these errors do not trigger firmware recovery. |
ASSET_CHECKSUM_FAILED, DRIVER_CHECKSUM_FAILED, No RKNN3 library found | sudo docker pull "$IMAGE"; remove custom runtime/library mounts and recreate from the complete image. |
| Missing model/weight or model load failure | Use the command for the selected size; keep .rknn and .weight paired. Multi-partition projects select their files automatically. |
Missing /dev/video0 | ls -l /dev/video*; select the actual board camera, or remove its mapping and use --camera_id -1. |
No input frame available in upload mode | Upload an image/video first, or enable a valid live source. |
no space left on device, overlay mount error | df -h /var/lib/docker; configure writable ext4 Docker/containerd storage using the link below. |
After pulling, recreate the container; docker restart keeps its old image. Optional API warnings and SMI exit code 251 need no repair when the self-test and health checks pass.
3. Offline M.2 firmware recovery — explicit maintenance
Confirm RK1820 M.2, stop all inference and external proxies. Keep /run/lock and the 300-second timeout. Insert before the image name:
-e RK182X_ALLOW_FIRMWARE_RECOVERY=1 \
-e RK182X_BOARD=ext-m2 \One recovery attempt only; remove these options afterward. Do not interrupt power or forcibly kill the write.
| Recovery error | Fix |
|---|---|
BOARD_CONFIRMATION_REQUIRED | Confirm the physical M.2 board before setting RK182X_BOARD=ext-m2. |
RECOVERY_LOCK_REQUIRED | Restore -v /run/lock:/run/lock. |
EXTERNAL_PROXY_ACTIVE | Stop the known external proxy/service and legacy inference users before recovery. Ordinary inference can reuse the proxy. |
FIRMWARE_RECOVERY_FAILED, CARD_OFFLINE_AFTER_RECOVERY | Save the upgrade log; resolve power/PCIe/firmware errors before another manual attempt. |
Measured benchmark
RK3588 + RK1820 M.2, SDK/Lite 1.1.0, core 0x1; 5 warmups + 30 measured frames/pairs.
- Runtime FPS: synchronous RKNN3 calls, including PCIe transfer.
- Pipeline FPS: decoding through rendering/JPEG, excluding HTTP and source pacing.
| Model | Input H×W | Runtime FPS | Pipeline FPS | Runtime p95 ms | Evidence |
|---|---|---|---|---|---|
| qaclip-vit-l14 | 224×224 | 6.45 | 5.26 | 155.36 | JSON |
QAClip FPS uses cached text features; text setup is separate.
These are the previous measurements; this shared-runtime release revalidated only YOLOv5n. Startup/self-test time is excluded.
Project README · Full runtime troubleshooting · Armbian Docker storage
Inputs and Outputs
Scores an entire image against candidate Chinese or English descriptions. Text and image encoders produce normalized feature vectors, compared on the CPU. It does not generate text or locate individual objects. Scores are relative to the supplied candidates, not calibrated event probabilities.