mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-05 14:47:40 +03:00
Compare commits
3 Commits
21e4b36c7c
...
c9055ea941
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9055ea941 | ||
|
|
c9ba851f0d | ||
|
|
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,42 +112,65 @@ 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
|
||||||
```
|
```
|
||||||
|
|
||||||
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:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -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`
|
||||||
|
|||||||
@ -15,6 +15,16 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
def should_update_db(prev_event: Event, current_event: Event) -> bool:
|
def should_update_db(prev_event: Event, current_event: Event) -> bool:
|
||||||
"""If current_event has updated fields and (clip or snapshot)."""
|
"""If current_event has updated fields and (clip or snapshot)."""
|
||||||
|
# If event is ending and was previously saved, always update to set end_time
|
||||||
|
# This ensures events are properly ended even when alerts/detections are disabled
|
||||||
|
# mid-event (which can cause has_clip/has_snapshot to become False)
|
||||||
|
if (
|
||||||
|
prev_event["end_time"] is None
|
||||||
|
and current_event["end_time"] is not None
|
||||||
|
and (prev_event["has_clip"] or prev_event["has_snapshot"])
|
||||||
|
):
|
||||||
|
return True
|
||||||
|
|
||||||
if current_event["has_clip"] or current_event["has_snapshot"]:
|
if current_event["has_clip"] or current_event["has_snapshot"]:
|
||||||
# if this is the first time has_clip or has_snapshot turned true
|
# if this is the first time has_clip or has_snapshot turned true
|
||||||
if not prev_event["has_clip"] and not prev_event["has_snapshot"]:
|
if not prev_event["has_clip"] and not prev_event["has_snapshot"]:
|
||||||
|
|||||||
@ -468,6 +468,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"polygonDrawing": {
|
"polygonDrawing": {
|
||||||
|
"type": {
|
||||||
|
"zone": "zone",
|
||||||
|
"motion_mask": "motion mask",
|
||||||
|
"object_mask": "object mask"
|
||||||
|
},
|
||||||
"removeLastPoint": "Remove last point",
|
"removeLastPoint": "Remove last point",
|
||||||
"reset": {
|
"reset": {
|
||||||
"label": "Clear all points"
|
"label": "Clear all points"
|
||||||
|
|||||||
@ -283,7 +283,10 @@ export default function PolygonItem({
|
|||||||
<Trans
|
<Trans
|
||||||
ns="views/settings"
|
ns="views/settings"
|
||||||
values={{
|
values={{
|
||||||
type: polygon.type.replace("_", " "),
|
type: t(
|
||||||
|
`masksAndZones.form.polygonDrawing.type.${polygon.type}`,
|
||||||
|
{ ns: "views/settings" },
|
||||||
|
),
|
||||||
name: polygon.friendly_name ?? polygon.name,
|
name: polygon.friendly_name ?? polygon.name,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user