Skip to content

Commit

Permalink
Update frigate-install.sh
Browse files Browse the repository at this point in the history
- Set up Unprivileged Hardware Acceleration
- Use GUI Device Passthrough for TPU Devices
  • Loading branch information
tteck authored Apr 27, 2024
1 parent aacc2b7 commit d22dd10
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions install/frigate-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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://github.com/gitapi/repos/blakeblackshear/frigate/releases/latest | grep -o '"tag_name": *"[^"]*"' | cut -d '"' -f 4)
msg_info "Installing Frigate $RELEASE (Perseverance)"
Expand Down Expand Up @@ -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"

Expand Down

0 comments on commit d22dd10

Please sign in to comment.