From a8ab82937b2205d71acd4e5a4b7dd29af4b1985c Mon Sep 17 00:00:00 2001 From: Pops0n Date: Thu, 5 Feb 2026 14:38:34 +0100 Subject: [PATCH] Update hailo installation instructions and script (#21882) * Update installation.md for Raspberry Pi and Hailo Updated Hailo installation instructions to cover both Bookworm and Trixie OS on Raspberry Pi. Referenced discussions: #21177, #20621, #20062, #19531 * Update user_installation.sh for Raspberry Pi (Bookworm and Trixie) Simplified and improved the user installation script for Hailo to support Raspberry Pi OS Bookworm, Trixie, and x86 platforms. Referenced discussions: #21177, #20621, #20062, #19531 * Update installation.md * Update user_installation.sh * Update installation.md * Update installation.md Added optional fix for PCIe descriptor page size error. Related discussion: #19481 * Update installation.md Changed kernel driver version check from modinfo to /sys/module for correct post-reboot output --- docker/hailo8l/user_installation.sh | 15 +++-- docs/docs/frigate/installation.md | 87 +++++++++++++++++++++++------ 2 files changed, 81 insertions(+), 21 deletions(-) diff --git a/docker/hailo8l/user_installation.sh b/docker/hailo8l/user_installation.sh index 239f81ba0..cfe278232 100644 --- a/docker/hailo8l/user_installation.sh +++ b/docker/hailo8l/user_installation.sh @@ -2,15 +2,19 @@ # Update package list and install dependencies sudo apt-get update -sudo apt-get install -y build-essential cmake git wget +sudo apt-get install -y build-essential cmake git wget linux-headers-$(uname -r) hailo_version="4.21.0" arch=$(uname -m) -if [[ $arch == "x86_64" ]]; then - sudo apt install -y linux-headers-$(uname -r); -else - sudo apt install -y linux-modules-extra-$(uname -r); +if [[ $arch == "aarch64" ]]; then + source /etc/os-release + os_codename=$VERSION_CODENAME + echo "Detected OS codename: $os_codename" +fi + +if [ "$os_codename" = "trixie" ]; then + sudo apt install -y dkms fi # Clone the HailoRT driver repository @@ -47,3 +51,4 @@ sudo udevadm control --reload-rules && sudo udevadm trigger echo "HailoRT driver installation complete." echo "reboot your system to load the firmware!" +echo "Driver version: $(modinfo -F version hailo_pci)" diff --git a/docs/docs/frigate/installation.md b/docs/docs/frigate/installation.md index 70b4b5bc1..0349a884c 100644 --- a/docs/docs/frigate/installation.md +++ b/docs/docs/frigate/installation.md @@ -112,42 +112,65 @@ The Hailo-8 and Hailo-8L AI accelerators are available in both M.2 and HAT form :::warning -The Raspberry Pi kernel includes an older version of the Hailo driver that is incompatible with Frigate. You **must** follow the installation steps below to install the correct driver version, and you **must** disable the built-in kernel driver as described in step 1. +On Raspberry Pi OS **Bookworm**, the kernel includes an older version of the Hailo driver that is incompatible with Frigate. You **must** follow the installation steps below to install the correct driver version, and you **must** disable the built-in kernel driver as described in step 1. + +On Raspberry Pi OS **Trixie**, the Hailo driver is no longer shipped with the kernel. It is installed via DKMS, and the conflict described below does not apply. You can simply run the installation script. ::: -1. **Disable the built-in Hailo driver (Raspberry Pi only)**: +1. **Disable the built-in Hailo driver (Raspberry Pi Bookworm OS only)**: :::note - If you are **not** using a Raspberry Pi, skip this step and proceed directly to step 2. + If you are **not** using a Raspberry Pi with **Bookworm OS**, skip this step and proceed directly to step 2. + + If you are using Raspberry Pi with **Trixie OS**, also skip this step and proceed directly to step 2. ::: - If you are using a Raspberry Pi, you need to blacklist the built-in kernel Hailo driver to prevent conflicts. First, check if the driver is currently loaded: + First, check if the driver is currently loaded: ```bash lsmod | grep hailo ``` - + If it shows `hailo_pci`, unload it: ```bash - sudo rmmod hailo_pci + sudo modprobe -r hailo_pci ``` - - Now blacklist the driver to prevent it from loading on boot: + + Then locate the built-in kernel driver and rename it so it cannot be loaded. + Renaming allows the original driver to be restored later if needed. + First, locate the currently installed kernel module: ```bash - echo "blacklist hailo_pci" | sudo tee /etc/modprobe.d/blacklist-hailo_pci.conf + modinfo -n hailo_pci ``` - Update initramfs to ensure the blacklist takes effect: - + Example output: + + ``` + /lib/modules/6.6.31+rpt-rpi-2712/kernel/drivers/media/pci/hailo/hailo_pci.ko.xz + ``` + Save the module path to a variable: + ```bash - sudo update-initramfs -u + BUILTIN=$(modinfo -n hailo_pci) ``` + And rename the module by appending .bak: + + ```bash + sudo mv "$BUILTIN" "${BUILTIN}.bak" + ``` + + Now refresh the kernel module map so the system recognizes the change: + + ```bash + sudo depmod -a + ``` + Reboot your Raspberry Pi: ```bash @@ -160,9 +183,9 @@ The Raspberry Pi kernel includes an older version of the Hailo driver that is in lsmod | grep hailo ``` - This command should return no results. If it still shows `hailo_pci`, the blacklist did not take effect properly and you may need to check for other Hailo packages installed via apt that are loading the driver. + This command should return no results. -2. **Run the installation script**: +3. **Run the installation script**: Download the installation script: @@ -190,7 +213,7 @@ The Raspberry Pi kernel includes an older version of the Hailo driver that is in - Download and install the required firmware - Set up udev rules -3. **Reboot your system**: +4. **Reboot your system**: After the script completes successfully, reboot to load the firmware: @@ -198,7 +221,7 @@ The Raspberry Pi kernel includes an older version of the Hailo driver that is in sudo reboot ``` -4. **Verify the installation**: +5. **Verify the installation**: After rebooting, verify that the Hailo device is available: @@ -212,6 +235,38 @@ The Raspberry Pi kernel includes an older version of the Hailo driver that is in lsmod | grep hailo_pci ``` + Verify the driver version: + + ```bash + cat /sys/module/hailo_pci/version + ``` + + Verify that the firmware was installed correctly: + + ```bash + ls -l /lib/firmware/hailo/hailo8_fw.bin + ``` + + **Optional: Fix PCIe descriptor page size error** + + If you encounter the following error: + + ``` + [HailoRT] [error] CHECK failed - max_desc_page_size given 16384 is bigger than hw max desc page size 4096 + ``` + + Create a configuration file to force the correct descriptor page size: + + ```bash + echo 'options hailo_pci force_desc_page_size=4096' | sudo tee /etc/modprobe.d/hailo_pci.conf + ``` + + and reboot: + + ```bash + sudo reboot + ``` + #### Setup To set up Frigate, follow the default installation instructions, for example: `ghcr.io/blakeblackshear/frigate:stable`