mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-10 02:29:19 +03:00
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
This commit is contained in:
parent
21e4b36c7c
commit
a8ab82937b
@ -2,15 +2,19 @@
|
|||||||
|
|
||||||
# Update package list and install dependencies
|
# Update package list and install dependencies
|
||||||
sudo apt-get update
|
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"
|
hailo_version="4.21.0"
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
|
|
||||||
if [[ $arch == "x86_64" ]]; then
|
if [[ $arch == "aarch64" ]]; then
|
||||||
sudo apt install -y linux-headers-$(uname -r);
|
source /etc/os-release
|
||||||
else
|
os_codename=$VERSION_CODENAME
|
||||||
sudo apt install -y linux-modules-extra-$(uname -r);
|
echo "Detected OS codename: $os_codename"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$os_codename" = "trixie" ]; then
|
||||||
|
sudo apt install -y dkms
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clone the HailoRT driver repository
|
# Clone the HailoRT driver repository
|
||||||
@ -47,3 +51,4 @@ sudo udevadm control --reload-rules && sudo udevadm trigger
|
|||||||
|
|
||||||
echo "HailoRT driver installation complete."
|
echo "HailoRT driver installation complete."
|
||||||
echo "reboot your system to load the firmware!"
|
echo "reboot your system to load the firmware!"
|
||||||
|
echo "Driver version: $(modinfo -F version hailo_pci)"
|
||||||
|
|||||||
@ -112,19 +112,23 @@ The Hailo-8 and Hailo-8L AI accelerators are available in both M.2 and HAT form
|
|||||||
|
|
||||||
:::warning
|
:::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
|
:::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
|
```bash
|
||||||
lsmod | grep hailo
|
lsmod | grep hailo
|
||||||
@ -133,19 +137,38 @@ The Raspberry Pi kernel includes an older version of the Hailo driver that is in
|
|||||||
If it shows `hailo_pci`, unload it:
|
If it shows `hailo_pci`, unload it:
|
||||||
|
|
||||||
```bash
|
```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
|
```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
|
```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:
|
Reboot your Raspberry Pi:
|
||||||
@ -160,9 +183,9 @@ The Raspberry Pi kernel includes an older version of the Hailo driver that is in
|
|||||||
lsmod | grep hailo
|
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:
|
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
|
- Download and install the required firmware
|
||||||
- Set up udev rules
|
- Set up udev rules
|
||||||
|
|
||||||
3. **Reboot your system**:
|
4. **Reboot your system**:
|
||||||
|
|
||||||
After the script completes successfully, reboot to load the firmware:
|
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
|
sudo reboot
|
||||||
```
|
```
|
||||||
|
|
||||||
4. **Verify the installation**:
|
5. **Verify the installation**:
|
||||||
|
|
||||||
After rebooting, verify that the Hailo device is available:
|
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
|
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
|
#### Setup
|
||||||
|
|
||||||
To set up Frigate, follow the default installation instructions, for example: `ghcr.io/blakeblackshear/frigate:stable`
|
To set up Frigate, follow the default installation instructions, for example: `ghcr.io/blakeblackshear/frigate:stable`
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user