December 11, 20241 yr Author 35 minutes ago, bmartino1 said: looks like golift/unpackerr may need some cpu pinning as it tried to use all cores and hung. maybe asign 4 cpu to that docker. Pinned. And upgraded to Unraid v7RC1 now.
December 11, 20241 yr Author 35 minutes ago, yayitazale said: There is already a discussion about this and we didn't get anywhere: https://github.com/blakeblackshear/frigate/issues/8470 I managed to stop this hard locks just using a lower resolution feeds of the cameras, so it should be something related with memory usage, but I was not able to find a root cause. Well dang! I have memory to burn, and feeds are not super high resolution (except for a 180 camera). Moving to CPU/GPU detection might be the answer....that's a pity...the coral.ai unit really lowered the CPU%.
December 11, 20241 yr Community Expert well you could ditch the frigate docker and go a vm / lxc route. https://docs.frigate.video/frigate/installation/ I would opt for the vm route as it is easier to pass a usb only device and use unraids virtio fs to pass a folder for storage. Id go Debian OS install and grab the docker run file to get the command to install it to the vm host. https://github.com/blakeblackshear/frigate/discussions/6545 Edited December 11, 20241 yr by bmartino1
December 11, 20241 yr Community Expert example install script: #!/bin/bash # Set environment variables export DEBIAN_FRONTEND=noninteractive # Update and install dependencies sudo apt-get update && sudo apt-get upgrade -y sudo apt-get install -y wget python3 python3-pip python3-venv git ffmpeg \ libjpeg-dev libavformat-dev libavcodec-dev libswscale-dev \ libgstreamer1.0-0 libgstreamer-plugins-base1.0-0 # Create a virtual environment for Frigate python3 -m venv frigate-env source frigate-env/bin/activate # Clone Frigate repository git clone https://github.com/blakeblackshear/frigate.git cd frigate # Install dependencies pip install -U pip setuptools wheel pip install -r requirements.txt # Create systemd service for Frigate echo "[Unit] Description=Frigate NVR Service After=network.target [Service] Type=simple User=$USER WorkingDirectory=$(pwd) ExecStart=$(pwd)/frigate-env/bin/python3 -m frigate Restart=always [Install] WantedBy=multi-user.target" | sudo tee /etc/systemd/system/frigate.service # Reload systemd and enable the service sudo systemctl daemon-reload sudo systemctl enable frigate.service # Start the Frigate service sudo systemctl start frigate.service # Indicate completion echo "Frigate installation and service setup completed successfully!" pulled from docker file: https://github.com/blakeblackshear/frigate/blob/dev/docker/main/Dockerfile Proxmox lxc build script may be better here: https://github.com/tteck/Proxmox/blob/main/install/frigate-install.sh Edited December 11, 20241 yr by bmartino1
December 11, 20241 yr Author 2 hours ago, ChirpyTurnip said: Pinned. And upgraded to Unraid v7RC1 now. So on v7 it still crashes. I've unplugged the TPU, so will try CPU detection now.... I don't really want to run a low resolution camera feed as that means no clear images (which is the point). I don't really want to go back to Blue Iris either where it is running on a Windows VM, or worse yet, natively on Windows - but we might yet end up there....
December 11, 20241 yr Author Just saw your linux-based VM...that might indeed be a better option! Something to look at after work....
December 11, 20241 yr Community Expert 29 minutes ago, ChirpyTurnip said: Just saw your linux-based VM...that might indeed be a better option! Something to look at after work.... I think the best route in your case would be a debain os running this sh script as root. ISO for Debian install: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.8.0-amd64-netinst.iso https://www.debian.org/download After reviewing and looking into a bare mental frigate application install. This LXC script looks perfect, Please overview it: https://github.com/tteck/Proxmox/blob/main/install/frigate-install.sh *I may work with ICH777 on a frigate lxc later for unraid. Only due to vm and hardware, pass though I think a VM would be easier in this case... in the VM: # Make sure you are root user. # sudo su or su root #once root set root password #passwd #move to root folder cd /root #Grab promox LXC frigate install script... wget https://raw.githubusercontent.com/tteck/Proxmox/refs/heads/main/install/frigate-install.sh #Make script executable chmod +x frigate-install.sh #Run Script .\frigate-install.sh * Lately Debian has been removing sudo and easey access to become root. the install process sets user access and sudo is not installed. --This a good thing for security... *But i'm old and want sudo... apt-get install sudo usermod -aG %username% sudo visudo add entry ?%username% All:All ALL ? ^-Same as root in /etc/sudoer file to access run visudo and use vi/vim editor to make chagnes insert/i to type in esc key :wq to write and save.. Other unriad - side debian install: apt-get install mc unattended-upgrades openssh-server nfs-common cifs-utils -y MC is a terminal File explorer, Unatended-Upgrades is a auto policy security update program, OpenSSH-server add ssh terminal and SFTP access, NFS-common allows terminal commands for nfs shares, cifs-utils adds samba terminal command to connect to shares. There may be a virtio install for unraids passing of the folder for frigate. then its a mater of finding the frigates xml code/confi file or use the vm ip to access its web interface. Hope this helps Edited December 11, 20241 yr by bmartino1
December 12, 20241 yr Author I'm going to make a start on this now. I can report that using the CPU/GPU and openvino as the detector made things much worse (unless I did something wrong). Within a few minutes I could log into Unraid via GUI or SSH but could not get anywhere beyond authentication (no GUI, no console prompt). Also, before it burned to the ground again it crashed and many of the docker containers were tagged as 'unhealthy'. So the Frigate container is now off and everything is (so far) calm, On the new AMD-based machine the Frigate Docker is still running with no issues (four cameras, versus six). But it will go when the other instance goes....no point having non-standard configurations. The only downside of any VM is that you have another host to maintain, patch etc.... I'll get working and loop back if I manage to stick the landing (or not). 🙂
December 12, 20241 yr Author No joy I'm afraid. The Proxmox script is looking for file paths that just don't exist in a default Debian install. Getting this running may be a lot harder than running a script. And even then, there is no guarantee of success.... 😞 I've also been reading through the other thread(s) specifically on Frigate. There is a suspicion that it might be something at the kernel or CPU level....on my side it was rock solid until it wasn't....and really aside from some networking changes (which we now know don't make the problem better or worse), more/less docker containers (which don't seem to have any affect), and changes to disk / addition of an HBA (also ruled out), and more plugins (also ruled out as I crash in safe mode), the *only* other things that have changed are my old CPU died and got replaced (but I was stable after that for a month), and the adoption of the latest Intel microcode through a BIOS update. This problem has been so perplexing - but I am glad we can now firmly park it on Frigate's interaction with the host - and I'm grateful to have been pointed to the other thread as it makes it clear this is a random 'me' thing. It may yet come to pass that it runs fine on a AM5 7000 series CPU, and just not on an Intel Core i7 system. If Frigate-2 stays up I'm going to try moving Frigate-1 to the AMD host as well. It is only a matter of moving over one HDD, so not a major effort. The put the burn on that machine I've just kicked off a parity check - it doesn't need to finish, but if it runs for the day 18+ hours without any issues that might point to better stability, because the other one won't go for more than a few hours without collapsing. After that there's also the other detection modes to try - there are reports in the other thread some combinations of CPU/GPU/OpenVimo/Yolo8 work better than others...
December 12, 20241 yr Community Expert later this week i will dig into making a debain vm and a lxc install for frigate.
December 13, 20241 yr Community Expert I rememberig why i moved away form frigate for other NVRF software... curente progress.. Quote Make a Linux VM with atleast 2 cores and 4 GB of ram HD 20GB... map your fodler path for data it he VM to be on Unraid Call 9pm tag frigate. *Will be need latter! Install Debian OS *when prompted select no gui or desktop environment install ssh after installation Login as root user #run basic update command. apt-get update && apt-get full-upgrade -y #Install 3rdpart application for a default Linux setup sudo apt update sudo apt install -y qemu-guest-agent sudo mc unattended-upgrades openssh-server nfs-common cifs-utils -y #fix sudo user for main user visudo #add %Username% ALL=(ALL:ALL) ALL #*Replace with the username chosen at instlation... #setup your unraid vm 9p mount not the tag name... sudo mkdir -p /mnt/frigate sudo mount -t 9p -o trans=virtio version=9p2000.L frigate /mnt/frigate ls /mnt/frigate #so mount stays at vm reboot: echo "frigate /mnt/frigate 9p trans=virtio version=9p2000.L 0 0" | sudo tee -a /etc/fstab #verify: dmesg | grep 9p #Prepare the Configuration mkdir -p /mnt/frigate/media chmod -R 755 /mnt/frigate/media mkdir -p /mnt/frigate/config touch /mnt/frigate/config/config.yml #We will now use the frigate Mount for stagina dn data. cd /mnt/frigate #Lets install some dependency for the frigate install script...: sudo apt-get update sudo apt-get install -y curl sudo mc git gpg automake build-essential xz-utils libtool ccache pkg-config libgtk-3-dev \ libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libjpeg-dev libpng-dev \ libtiff-dev gfortran openexr libatlas-base-dev libssl-dev libtbbmalloc2 libtbb-dev libopenexr-dev \ libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev gcc gfortran libopenblas-dev liblapack-dev libusb-1.0-0-dev jq moreutils python3.11-venv software-properties-common Now lets Install Python3 and Pip: sudo apt-get install -y python3 python3-dev python3-setuptools python3-distutils python3-pip sudo pip install --upgrade pip #^Expect a pip error this is to confirm python and upgrade python pacakges. #Later we will be setting up python 3.9 #Next lets add node js... (which appears to be used as the webUI... sudo mkdir -p /etc/apt/keyrings curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list sudo apt-get update sudo apt-get install -y nodejs cd /mnt/frigate #Lets install go2rtc which is one fo the applicatoin for the connection to the cameras... sudo mkdir -p /usr/local/go2rtc/bin cd /usr/local/go2rtc/bin wget -qO go2rtc "https://github.com/AlexxIT/go2rtc/releases/latest/download/go2rtc_linux_amd64" chmod +x go2rtc sudo ln -svf /usr/local/go2rtc/bin/go2rtc /usr/local/bin/go2rtc cd /mnt/frigate #Lets Install the Hardware acceleration packages: sudo apt-get -y install va-driver-all ocl-icd-libopencl1 intel-opencl-icd vainfo intel-gpu-tools #Since this is a VM lets fix some things: sudo chgrp video /dev/dri sudo chmod 755 /dev/dri sudo chmod 660 /dev/dri/* #Now its time to install frigate. cd /mnt/frigate #Fix other Python dependency apt-get install python3-full #Now lets setup and Install Python 3.9 #install pyenv to use older verison of python3.9 latter... sudo apt update sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \ libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git curl https://pyenv.run | bash nano ~/.bashrc ####################### export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv virtualenv-init -)" ####################### #reboot vm to apply root bashrc to use pyenv for python... reboot #set python3.9 pyenv install 3.9.17 pyenv global 3.9.17 python3.9 --version #We are now ready to install and use venv for frigate touch install-frigate.sh chmod +x install-frigate.sh nano install-frigate.sh ################################## #!/usr/bin/env bash set -e # Exit on error # Step 1: Define variables RELEASE=$(curl -s https://api.github.com/repos/blakeblackshear/frigate/releases/latest | jq -r '.tag_name') echo "Download and extract Frigate" mkdir -p /mnt/frigate/opt/frigate/models cd ~ wget -q https://github.com/blakeblackshear/frigate/archive/refs/tags/${RELEASE}.tar.gz -O frigate.tar.gz tar -xzf frigate.tar.gz -C /mnt/frigate/opt/frigate --strip-components 1 rm -rf frigate.tar.gz echo "Setting up Python environment" # Ensure Python dependencies are installed sudo apt-get update sudo apt-get install -y python3.11 python3.11-venv python3-pip # Create and activate a Python virtual environment python3.11 -m venv /mnt/frigate/venv source /mnt/frigate/venv/bin/activate echo "Build and install Python dependencies" pip install --upgrade pip pip wheel --wheel-dir=/mnt/frigate/wheels -r /mnt/frigate/opt/frigate/docker/main/requirements-wheels.txt pip install -U /mnt/frigate/wheels/*.whl pip install -r /mnt/frigate/opt/frigate/docker/main/requirements-dev.txt echo "Installing system dependencies" sudo apt-get install -y ffmpeg jq sudo ln -svf /usr/lib/btbn-ffmpeg/bin/ffmpeg /usr/local/bin/ffmpeg sudo ln -svf /usr/lib/btbn-ffmpeg/bin/ffprobe /usr/local/bin/ffprobe echo "Building the Web UI using Node.js" cd /mnt/frigate/opt/frigate/web sudo npm install export NODE_OPTIONS=--max-old-space-size=4096 sudo npm run build # Copy built UI files sudo cp -r /mnt/frigate/opt/frigate/web/dist/* /mnt/frigate/opt/frigate/web/ echo "Fix npm issues and audit" sudo npm install -g npm@latest sudo npm audit fix --force echo "Creating default configuration" mkdir -p /mnt/frigate/config cat <<EOF > /mnt/frigate/config/config.yml mqtt: enabled: false cameras: test: ffmpeg: inputs: - path: /mnt/frigate/media/frigate/person-bicycle-car-detection.mp4 roles: - detect - rtmp detect: width: 1920 height: 1080 fps: 5 EOF echo "Frigate installation complete. You can now use the configuration at /mnt/frigate/config." ################################## #run the script: ./install-frigate.sh #Lets doublcheck nodejs web server: npm audit fix #symlink the conf file so VM frigate will use config file in unraid path: ln -sf /mnt/frigate/config/config.yml /mnt/frigate/opt/frigate/config/config.yml #Install Coral and OpenVINO Models (Optional) cd /mnt/frigate/opt/frigate wget -qO edgetpu_model.tflite https://github.com/google-coral/test_data/raw/release-frogfish/ssdlite_mobiledet_coco_qat_postprocess_edgetpu.tflite wget -qO cpu_model.tflite https://github.com/google-coral/test_data/raw/release-frogfish/ssdlite_mobiledet_coco_qat_postprocess.tflite #Now to make a debain systemd server to start frigate sudo nano /etc/systemd/system/frigate.service ########################### [Unit] Description=Frigate NVR Service After=network.target [Service] Type=simple User=root WorkingDirectory=/mnt/frigate/opt/frigate ExecStart=/mnt/frigate/venv/bin/python3 -m frigate Restart=always [Install] WantedBy=multi-user.target ###################################### #enable service and reboot to check webui sudo systemctl daemon-reload sudo systemctl enable frigate.service sudo systemctl start frigate.service chmod +x /mnt/frigate/opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/run reboot #Some other venv pip fixes sudo systemctl stop frigate.service source /mnt/frigate/venv/bin/activate pip list | grep Flask pip install Flask pip install tensorflow ######################################################################## ######################################################################## ######################################################################## #no WebUi: http://<VM_IP>:5000 ended up as a failure... a restart of the VM folowing this gude will hopefule fix any issuse may hit as folwoing a lxc/docker on what they did has problems taht i can't realyably share... Frigate is a flask app and a pythong coded project that conects and uses nodejs and rtcgo... https://karlquinsland.com/frigate-install/
December 13, 20241 yr Community Expert so essential id recommend using a VM to isolalte frigate in the VM and install docker in the vm to run frigate with 1 USB device attached... or use a different NVR. not many free one left. Shinobi was my go to ... again i'd go debain/ubuntu pull unraids frigate docker. set the path to be frigate in teh vm for a vitio 9p access make a VM with 4 GB of ram and pass 1 of the usb devic3e and use https://www.composerize.com/ to get a docker compose file to use docker compose commands to run frigate pointed to your mount if using data in the quote above /mnt/frigate/ ... this way frigate instance is isolated within a VM and you have better control over the devices This makes me wonder since you had 2 if there was folder sharing in the dockers. frigate 1 vs frigate 2 ?where they using the same appdata folder? as that could cause issues... Running 2 of the same docker needs 2 unique pathing for storage. Edited December 13, 20241 yr by bmartino1 Data-typo
December 15, 20241 yr Author So they were fully isolated and not sharing at all.....each had it's own TPU, own pool, own config folder. And the nice thing about Frigate is that it integrates really well in Home Assistant....Blue Iris is very complex but a bit of a dog when it comes to detection and a big memory hog - which is one of the reasons I move to Frigate, which needed docker, which brought me to Unraid. I have been a bit busy this weekend with very little time to do much. But, I can report that both Frigate instances have been moved to the AMD machine, and for now, both are happy, and very much running as they should be! The AMD machine has nothing else on it yet, but for now it is showing all the right signs. It was a literal transplant of the configuration except for needing to set AMD flags instead of Intel flags - so nothing else is different except that we've moved from Intel to AMD. Certainly it is running the machine harder - the CPU is permanently at 20% (give or take) but then to be fair an AM5 7600 is about half the compute power of an i7 14700K so it's probably not that bad. On the other side the Intel machine is also happier and more stable - without Frigate there is it not crashing either. I've gradually been putting the old config back (vpn_bridge for GlueTun), back to ipvlan, etc just to see if anything unstable comes back, but so far so good. If this turns out to be *the* fix then I'm pretty sure I will never buy another Intel again. Now I just wish I could get the Fan Control stuff working....but I've posted that on their support forum - will control the fans down to 0 rpm, but won't bring them up again, or stop before 0 rpm, even if you set the minimum to 50% / 128. So somethings are going better, but I'm still finding problems where ever I look!
January 30, 20251 yr Author Solution So, it has been a minute. Where am I at? After building a new machine based on a Core Ultra CPU I'm happy to report that everything is back on one machine, two copies of frigate, all of the *-arrs (with Gluetun), and so on and so forth. Absolutely stable, as it should be, on both 6x and 7x. Currently uptime is nearly 21 days, no issues at all! The old machine that was so very crash prone is now my desktop PC (on which I write now) and it too is rock solid. My ultimate suspicion? That the microcode changes in the BIOS for the core i7 bug made the Linux OS unstable....but running Windows no issues. With new HW Unraid is also happy.... So sorted FINALLY I think!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.