Raspberry Pi5 and Ai

Install Raspberry PI5 Ai Kit

I have a Raspberry Pi AI Kit, which includes:
– an M.2 HAT+
– a pre-installed Hailo-8L AI module

sudo apt install hailo-all

This installs the following dependencies:
– Hailo kernel device driver and firmware
– HailoRT middleware software
– Hailo Tappas core post-processing libraries
– The rpicam-apps Hailo post-processing software demo stages

Finally, reboot your Raspberry Pi with sudo reboot for these settings to take effect.

To ensure everything is running correctly, run the following command:

$ hailortcli fw-control identify
---------------------------------------------------------------------
Executing on device: 0000:01:00.0
Identifying board
Control Protocol Version: 2
Firmware Version: 4.20.0 (release,app,extended context switch buffer)
Logger Version: 0
Board Name: Hailo-8
Device Architecture: HAILO8L
Serial Number: HLDDLBB243300869
Part Number: HM21LB1C2LAE
Product Name: HAILO-8L AI ACC M.2 B+M KEY MODULE EXT TMP

To ensure the camera is operating correctly, run the following command:

$ rpicam-hello -t 10s

This starts the camera and shows a preview window for ten seconds. Once you have verified everything is installed correctly, it’s time to run some demos.

Install Ollama on the Raspberry Pi 5

$ curl -fsSL https://ollama.com/install.sh | sh
>>> Installing ollama to /usr/local
>>> Downloading Linux arm64 bundle
######################################################################## 100.0%
>>> Creating ollama user...
>>> Adding ollama user to render group...
>>> Adding ollama user to video group...
>>> Adding current user to ollama group...
>>> Creating ollama systemd service...
>>> Enabling and starting ollama service...
Created symlink /etc/systemd/system/default.target.wants/ollama.service β†’ /etc/systemd/system/ollama.service.
>>> The Ollama API is now available at 127.0.0.1:11434.
>>> Install complete. Run "ollama" from the command line.
WARNING: No NVIDIA/AMD GPU detected. Ollama will run in CPU-only mode.

If Ollama is installed correctly, you’ll see the installed version displayed in the terminal.

$ ollama --version
ollama version is 0.5.11

Install Docker

$ sudo apt install docker docker-compose

Install Open Web UI

$ sudo docker pull ghcr.io/open-webui/open-webui:main
$ sudo docker run -d -p 3000:8080 -v open-webui:/app/backend/data --name open-webui ghcr.io/open-webui/open-webui:main

Using browser to open webUI
https://192.168.1.xxx:3000

Install Portioner

$ sudo docker pull portainer/portainer-ce:latest
$ sudo docker volume create portainer_data
$ docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

Using browser to access Portainer interface using the IP address
https://192.168.1.xxx:9443/

Fixing Errors

After the update

$ sudo apt update && sudo apt upgrade hailort

$ hailortcli fw-control identify
[HailoRT] [warning] Unsupported firmware operation. Host: 4.20.
0, Device: 4.21.0
Executing on device: 0001:01:00.0
Identifying board
Control Protocol Version: 2
Firmware Version: 4.21.0 (release,app,extended context switch b
uffer)
Logger Version: 0
Board Name: Hailo-8
Device Architecture: HAILO8L
Serial Number: HLDDLBB243300869
Part Number: HM21LB1C2LAE
Product Name: HAILO-8L AI ACC M.2 B+M KEY MODULE EXT TMP

The driver unloaded again β€” it’s not persisting across sessions. This is a kernel module issue, likely from a kernel update. You need to run these to fix it properly:

$ # Check installed kernel vs module
$ uname -r
ls /lib/modules/$(uname -r)/extra/ | grep hailo

If the module isn’t there for your current kernel, reinstall:

$ sudo apt update
$ sudo apt reinstall hailort
$ sudo modprobe hailo_pci

Then make it load automatically on boot:

$ echo "hailo_pci" | sudo tee /etc/modules-load.d/hailo.conf

got the following error

$ uname -r
6.12.75+rpt-rpi-2712

$ ls /lib/modules/$(uname -r)/extra/ | grep hail
o
ls: cannot access '/lib/modules/6.12.75+rpt-rpi-2712/extra/': N
o such file or directory

The DKMS build is failing silently because the kernel headers for 6.12.75 aren’t installed. Notice the apt output showed headers for 6.12.34 but you’re running 6.12.75. Fix:

$ sudo apt update && sudo apt reinstall hailort

Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian-security bookworm-security I
nRelease
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
Hit:4 https://download.docker.com/linux/debian bookworm InRelea
se
Hit:5 https://deb.nodesource.com/node_22.x nodistro InRelease
Hit:6 http://archive.raspberrypi.com/debian bookworm InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no
longer required:
  libbasicusageenvironment1 libgroupsock8 liblivemedia77
  linux-headers-6.12.25+rpt-common-rpi
  linux-headers-6.12.34+rpt-common-rpi
  linux-headers-6.12.34+rpt-rpi-2712
  linux-headers-6.12.34+rpt-rpi-v8
  linux-image-6.12.34+rpt-rpi-2712
  linux-image-6.12.34+rpt-rpi-v8 linux-kbuild-6.12.25+rpt
  linux-kbuild-6.12.34+rpt python3-v4l2
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0
 not upgraded.
Need to get 8,371 kB of archives.
After this operation, 0 B of additional disk space will be used
.
Get:1 http://archive.raspberrypi.com/debian bookworm/main arm64
 hailort arm64 4.20.0-1 [8,371 kB]
Fetched 8,371 kB in 4s (2,139 kB/s)
(Reading database ... 216103 files and directories currently in
stalled.)
Preparing to unpack .../hailort_4.20.0-1_arm64.deb ...
Unpacking hailort (4.20.0-1) over (4.20.0-1) ...
Setting up hailort (4.20.0-1) ...
Processing triggers for libc-bin (2.36-9+rpt2+deb12u13) ...
$ ls /lib/modules/$(uname -r)/extra/ | grep hail
o
ls: cannot access '/lib/modules/6.12.75+rpt-rpi-2712/extra/': N
o such file or directory

$ sudo ls /lib/modules/$(uname -r)/extra/ | grep
 hailo
ls: cannot access '/lib/modules/6.12.75+rpt-rpi-2712/extra/': N
o such file or directory

Then rebuild:

$ sudo apt install linux-headers-$(uname -r)
$ sudo dkms autoinstall
ls /lib/modules/$(uname -r)/extra/ | grep hailo

$ sudo modprobe hailo_pci

$ lsmod | grep hailo
hailo_pci             131072  0

$ hailortcli fw-control identify
Executing on device: 0001:01:00.0
Identifying board
Control Protocol Version: 2
Firmware Version: 4.20.0 (release,app,extended context switch b
uffer)
Logger Version: 0
Board Name: Hailo-8
Device Architecture: HAILO8L
Serial Number: HLDDLBB243300869
Part Number: HM21LB1C2LAE
Product Name: HAILO-8L AI ACC M.2 B+M KEY MODULE EXT TMP

Now make it persist across reboots:

$ echo "hailo_pci" | sudo tee /etc/modules-load.d/hailo.conf

That’s it β€” the Hailo-8L will auto-load on every boot from now on. Run it and confirm it worked with cat /etc/modules-load.d/hailo.conf.