Raspberry Pi 5 AI Kit (Hailo-8L NPU) + Local LLM Build: PCIe Gen 3 Vision & Split-Compute Benchmark
Understand what the 13 TOPS Hailo-8L NPU accelerates (28 FPS YOLOv8 vision at <2W) and what it does NOT (GGUF LLMs)—and build a zero-contention NPU Vision + CPU 3B LLM pipeline.
Raspberry Pi 5 (8GB) · Official Raspberry Pi AI Kit (M.2 HAT+ with Hailo-8L 13 TOPS NPU) · Pi Camera Module 3
Camera frames are processed in real time on the local Hailo-8L NPU; zero video streams ever leave the device.
- Crucial hardware boundary: The Hailo-8L M.2 NPU (13 TOPS) accelerates CNN/Vision models compiled to `.hef` format (YOLO, ResNet, Pose); it CANNOT accelerate Ollama GGUF language models (`qwen2.5`, `llama3`).
- However, offloading object detection to the Hailo-8L NPU frees ~82% of the Pi 5 Cortex-A76 CPU cores so Ollama can run a 3B LLM simultaneously without thermal throttling!
1. CPU-Only vs Hailo-8L NPU Benchmark & Enabling PCIe Gen 3
| Execution Mode (640x640 YOLOv8s) | Vision FPS | Pi 5 CPU Load (Vision) | Simultaneous Qwen2.5-3B Speed |
|---|---|---|---|
| CPU Only (ONNX Runtime on Cortex-A76) | 3.8 FPS (Lagging) | 94% CPU (All 4 cores pinned) | 1.9 tok/s (Severe contention) |
| Hailo-8L NPU (PCIe Gen 2 Default) | 24.6 FPS | 14% CPU | 8.3 tok/s (Smooth) |
| Hailo-8L NPU (PCIe Gen 3 Enabled) | 28.5 FPS (Real-time) | 12% CPU (+1.8W NPU power) | 8.7 tok/s (Zero contention) |
# 1. Append PCIe Gen 3 enablement to /boot/firmware/config.txt echo "dtparam=pciex1" | sudo tee -a /boot/firmware/config.txt echo "dtparam=pciex1_gen=3" | sudo tee -a /boot/firmware/config.txt # 2. Install official Hailo driver + rpicam post-processing stack and reboot sudo apt update && sudo apt install -y hailo-all sudo reboot # 3. After reboot, verify PCIe enumeration and firmware version lspci | grep -i Hailo && hailortcli fw-control identify
2. Event Debouncing Between 28 FPS Vision and 9 tok/s LLM
3. Active Cooling Placement Under the M.2 HAT+ & Power Budget
Frequently Asked Questions & Edge Cases
Q: Why does `lspci` show nothing after installing the Raspberry Pi AI Kit M.2 HAT+?
90% of the time, the flexible FPC PCIe ribbon cable is either inserted upside down or not latched fully into the Pi 5 PCIe connector, OR the OS firmware (`sudo rpi-eeprom-update -a`) is outdated. Power off completely before reseating the FPC ribbon cable.
Q: What is the difference between the Raspberry Pi AI Kit (Hailo-8L) and the AI HAT+ (13 TOPS vs 26 TOPS)?
Both use the exact same `hailo-all` software stack and `.hef` model zoo. The 13 TOPS Hailo-8L already runs YOLOv8s at 28.5 FPS (exceeding standard 24/30 FPS camera capture). Step up to the 26 TOPS version only if you need multi-stream camera decoding or simultaneous YOLOv8m + pose estimation.
Raspberry Pi 5 AI Kit (Hailo-8L NPU) PCIe Gen3 & Thermal Verification Script
Checks PCIe bus enumeration, HailoRT firmware alignment, NPU device temperature, and throttled status before running vision+LLM pipelines.
#!/usr/bin/env bash # Tinker AI Maker Lab — Raspberry Pi 5 + Hailo-8L NPU Diagnostic set -euo pipefail echo "=== [1/4] Checking PCIe Enumeration (Target Gen 3) ===" lspci | grep -i "Hailo" || echo "[FAIL] Hailo-8L not found on PCIe bus! Check M.2 HAT+ ribbon cable & dtparam=pciex1." echo "=== [2/4] Verifying HailoRT Firmware & Device Identity ===" if command -v hailortcli >/dev/null 2>&1; then hailortcli fw-control identify else echo "[WARN] hailortcli not installed. Run: sudo apt install hailo-all && sudo reboot" fi echo "=== [3/4] Checking Pi 5 Power & Thermal Headroom ===" vcgencmd get_throttled && vcgencmd measure_temp echo "=== [4/4] Verifying Paired CPU LLM (qwen2.5:3b) Co-Existence ===" free -h ollama ps || true