Lesson 05: Hailo 8/8L AI Module installation
The Hailo 8 and Hailo 8L AI modules are powerful M.2 2230 AI accelerators that integrate seamlessly with the Raspberry Pi 5. The full-featured Hailo 8 delivers up to 26 TOPS, while the compact Hailo 8L provides 13 TOPS. Together, they dramatically boost the Pi 5’s ability to run complex AI models — ideal for real-time image recognition, object detection, and other demanding edge-AI tasks — delivering advanced, energy-efficient performance with minimal power consumption.
Using the Hailo AI Module with Raspberry Pi 5
To ensure optimal performance when using the Hailo AI acceleration module, follow these recommendations:
Recommended Hardware:
- Use a Raspberry Pi 5 with 8GB or 16GB of RAM.
- Ensure active cooling is installed – preferably the official Raspberry Pi active cooler.
- Use a USB-C power supply that is fully compatible with Raspberry Pi 5.
- For improved data read/write speeds, consider adding an SSD flash drive.

Figure 5.1(a): Installing the Hailo AI Module only on the Raspberry Pi 5

Figure 5.1(b): Add SSD Flash memory, UPS, and Hailo AI Modules
5.1 Install Hailo AI Module
Update OS, firmware & bootloader
SSH into (or locally log in to) your Pi and run:
sudo apt update && sudo apt full-upgrade
sudo rpi-eeprom-update
Then launch the configuration tool:
sudo raspi-config
- Advanced Options → Bootloader Version: select E1 Latest, finish, and reboot.
- After reboot, apply any remaining EEPROM updates:
sudo rpi-eeprom-update -a
sudo reboot
Enable PCIe Gen 3 mode
Re-open the config tool:
sudo raspi-config
- Advanced Options → A8 PCIe Speed: choose Yes to enable Gen 3, then reboot.
Hailo AI HAT with PCIe Switch
Hailo Module with PCIe Switch Board
If you connect the Hailo AI HAT to the PCIe switch board, then the Pi 5 may have some MSI interrupt errors. This issue happens because the Hailo-8/8L module is hanging off a PCIe switch (for example, an M.2 HAT), and the Pi 5’s default device-tree does not assign the correct MSI interrupt parent for that topology. As a result, the driver’s calls to enable MSI return error – 28 (ENOSPC), and the board never fully activates.
How to fix it
You need to load a PCIe compatibility overlay so that the kernel uses the proper interrupt parent and can successfully enable MSI on the Hailo board.
- Edit the config.txt
On Raspberry Pi OS Bullseye (and later):sudo nano /boot/firmware/config.txt
- Add the overlay
At the end of the file, append:
This overlay corrects the MSI interrupt parent for devices behind a PCIe switch, allowing the Hailo driver to enable MSI successfully.dtoverlay=pciex1-compat-pi5,no-mip
- (Optional) If you’re using Pineboards’ M.2 HAT AI Kit instead, you can use its dedicated overlay:
dtoverlay=pineboards-hat-ai
- Save and reboot
sudo reboot
- Verify
After reboot, run dmesg again. You should no longer see Failed to enable MSI -28 (or similar), and your Hailo module should initialize normally.
Install the Hailo SDK & GStreamer plugins
sudo apt install hailo-all
sudo apt-get install gstreamer1.0-plugins-ugly
sudo reboot
Verify the installation
Identify the Hailo device:
hailortcli fw-control identify
You should see something like:
Executing on device: 0000:01:00.0
Board Name: Hailo-8
Device Architecture: HAILO8L
Check the Hailo GStreamer tools plugin:
gst-inspect-1.0 hailotools
Look for “Plugin Details: Name hailotools”
Check the main Hailo GStreamer plugin:
gst-inspect-1.0 hailo
You should see elements like hailonet, hailodevicestats, etc.
Once these steps are complete, your Raspberry Pi 5 will automatically detect the on-board Hailo NPU, and you can run any AI-accelerated demos, such as the built-in rpicam-apps camera examples, or dive into the Hailo RPi5 Examples on GitHub to explore Python-based pipelines.
Hailo-8/8L AI Module Demo Guide for Raspberry Pi 5
Install & Prepare
- Update package lists and install rpicam-apps
sudo apt update && sudo apt install rpicam-apps
- Common command-line options for rpicam-hello:
- -t 0: run in continuous capture ("test") mode
- -n: disable the preview window
- -v 2: output only textual results (no video)
- --post-process-file <path>: specify the JSON post-precessing file
- --framerate <fps>: set capture framerate (used by some demos)
Object Detection
Draws bounding boxes around detected objects. You can also run in text-only mode.
- Default demo (YOLOv6)
rpicam-hello -t 0 --post-process-file /usr/share/rpi-camera-assets/hailo_yolov6_inference.json
- Preview disabled, text-only
rpicam-hello -t 0 -n -v 2 --post-process-file /usr/share/rpi-camera-assets/hailo_yolov6_inference.json
- Alternative models
- YOLOv8:
rpicam-hello -t 0 --post-process-file /usr/share/rpi-camera-assets/hailo_yolov8_inference.json
- YoloX:
rpicam-hello -t 0 --post-process-file /usr/share/rpi-camera-assets/hailo_yolox_inference.json
- YOLOv5 (Person & Face):
rpicam-hello -t 0 --post-process-file /usr/share/rpi-camera-assets/hailo_yolov5_personface.json
- YOLOv8:
Image Segmentation
Applies a color mask to each detected object.
rpicam-hello -t 0 --post-process-file /usr/share/rpi-camera-assets/hailo_yolov5_segmentation.json --framerate 20
Pose Estimation
Performs 17-point human pose estimation and draws the skeleton.
rpicam-hello -t 0 --post-process-file /usr/share/rpi-camera-assets/hailo_yolov8_pose.json
Locking Specific Package Versions
To match your driver/tooling versions exactly:
- Unhold packages (if previously held)
sudo apt-mark unhold hailo-tappas-core hailort hailo-dkms python3-hailort
- Install the desired version (e.g. v4.19)
sudo apt install hailo-tappas-core=3.30.0-1 hailort=4.19.0-3 hailo-dkms=4.19.0-1 python3-hailort=4.19.0-2
- Hold them to prevent upgrades
sudo apt-mark hold hailo-tappas-core hailort hailo-dkms python3-hailort
You’re now ready to explore all the Hailo NPU demos on your Raspberry Pi 5!