From d22dd105fbb2795e6a7340e288a0af0a3e49c7ce Mon Sep 17 00:00:00 2001 From: tteckster Date: Sat, 27 Apr 2024 06:39:42 -0400 Subject: [PATCH] Update frigate-install.sh - Set up Unprivileged Hardware Acceleration - Use GUI Device Passthrough for TPU Devices --- install/frigate-install.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/install/frigate-install.sh b/install/frigate-install.sh index 383b8370..e5fe5f09 100644 --- a/install/frigate-install.sh +++ b/install/frigate-install.sh @@ -37,16 +37,16 @@ chmod +x go2rtc $STD ln -svf /usr/local/go2rtc/bin/go2rtc /usr/local/bin/go2rtc msg_ok "Installed go2rtc" +msg_info "Setting Up Hardware Acceleration" +$STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools} if [[ "$CTTYPE" == "0" ]]; then - msg_info "Setting Up Hardware Acceleration" - $STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools} chgrp video /dev/dri chmod 755 /dev/dri chmod 660 /dev/dri/* $STD adduser $(id -u -n) video $STD adduser $(id -u -n) render - msg_ok "Set Up Hardware Acceleration" fi +msg_ok "Set Up Hardware Acceleration" RELEASE=$(curl -s https://api.github.com/repos/blakeblackshear/frigate/releases/latest | grep -o '"tag_name": *"[^"]*"' | cut -d '"' -f 4) msg_info "Installing Frigate $RELEASE (Perseverance)" @@ -93,7 +93,11 @@ cameras: fps: 5 EOF ln -sf /config/config.yml /opt/frigate/config/config.yml -sed -i -e 's/^kvm:x:104:$/render:x:104:root,frigate/' -e 's/^render:x:105:root$/kvm:x:105:/' /etc/group +if [[ "$CTTYPE" == "0" ]]; then + sed -i -e 's/^kvm:x:104:$/render:x:104:root,frigate/' -e 's/^render:x:105:root$/kvm:x:105:/' /etc/group +else + sed -i -e 's/^kvm:x:104:$/render:x:104:frigate/' -e 's/^render:x:105:$/kvm:x:105:/' /etc/group +fi echo "tmpfs /tmp/cache tmpfs defaults 0 0" >> /etc/fstab msg_ok "Installed Frigate $RELEASE"