2022-11-22 02:31:39 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
apt-get -qq update
|
|
|
|
|
|
|
|
apt-get -qq install --no-install-recommends -y \
|
|
|
|
apt-transport-https \
|
|
|
|
gnupg \
|
|
|
|
wget \
|
2024-10-17 18:02:27 +02:00
|
|
|
lbzip2 \
|
2022-11-29 02:24:20 +01:00
|
|
|
procps vainfo \
|
2022-11-22 02:31:39 +01:00
|
|
|
unzip locales tzdata libxml2 xz-utils \
|
2024-11-20 21:24:25 +01:00
|
|
|
python3 \
|
2023-01-19 00:23:40 +01:00
|
|
|
python3-pip \
|
|
|
|
curl \
|
2024-10-04 00:23:37 +02:00
|
|
|
lsof \
|
2023-05-18 03:01:56 +02:00
|
|
|
jq \
|
|
|
|
nethogs
|
2022-11-22 02:31:39 +01:00
|
|
|
|
2022-12-09 13:39:02 +01:00
|
|
|
mkdir -p -m 600 /root/.gnupg
|
2022-11-22 02:31:39 +01:00
|
|
|
|
2024-11-20 19:55:49 +01:00
|
|
|
# install coral runtime
|
|
|
|
wget -q -O /tmp/libedgetpu1-max.deb "https://github.com/feranick/libedgetpu/releases/download/16.0TF2.17.0-1/libedgetpu1-max_16.0tf2.17.0-1.bookworm_${TARGETARCH}.deb"
|
|
|
|
dpkg -i /tmp/libedgetpu1-max.deb
|
|
|
|
rm /tmp/libedgetpu1-max.deb
|
|
|
|
|
|
|
|
# install python3 & tflite runtime
|
|
|
|
if [[ "${TARGETARCH}" == "amd64" ]]; then
|
2024-11-20 21:24:25 +01:00
|
|
|
wget -qO /deps/wheels/tflite_runtime-2.17.0-cp311-cp311-linux_x86_64.whl https://github.com/feranick/TFlite-builds/releases/download/v2.17.0/tflite_runtime-2.17.0-cp311-cp311-linux_x86_64.whl
|
|
|
|
wget -qO /deps/wheels/pycoral-2.0.2-cp311-cp311-linux_x86_64.whl https://github.com/feranick/pycoral/releases/download/2.0.2TF2.17.0/pycoral-2.0.2-cp311-cp311-linux_x86_64.whl
|
2024-11-20 19:55:49 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${TARGETARCH}" == "arm64" ]]; then
|
2024-11-20 21:24:25 +01:00
|
|
|
wget -qO /deps/wheels/tflite_runtime-2.17.0-cp311-cp311-linux_aarch64.whl https://github.com/feranick/TFlite-builds/releases/download/v2.17.0/tflite_runtime-2.17.0-cp311-cp311-linux_aarch64.whl
|
|
|
|
wget -qO /deps/wheels/pycoral-2.0.2-cp311-cp311-linux_aarch64.whl https://github.com/feranick/pycoral/releases/download/2.0.2TF2.17.0/pycoral-2.0.2-cp311-cp311-linux_aarch64.whl
|
2024-11-20 19:55:49 +01:00
|
|
|
fi
|
2022-11-22 02:31:39 +01:00
|
|
|
|
2023-01-08 14:04:58 +01:00
|
|
|
# btbn-ffmpeg -> amd64
|
|
|
|
if [[ "${TARGETARCH}" == "amd64" ]]; then
|
2024-09-13 22:14:51 +02:00
|
|
|
mkdir -p /usr/lib/ffmpeg/5.0
|
2024-09-19 21:29:58 +02:00
|
|
|
mkdir -p /usr/lib/ffmpeg/7.0
|
2024-09-13 22:14:51 +02:00
|
|
|
wget -qO btbn-ffmpeg.tar.xz "https://github.com/NickM-27/FFmpeg-Builds/releases/download/autobuild-2022-07-31-12-37/ffmpeg-n5.1-2-g915ef932a3-linux64-gpl-5.1.tar.xz"
|
|
|
|
tar -xf btbn-ffmpeg.tar.xz -C /usr/lib/ffmpeg/5.0 --strip-components 1
|
|
|
|
rm -rf btbn-ffmpeg.tar.xz /usr/lib/ffmpeg/5.0/doc /usr/lib/ffmpeg/5.0/bin/ffplay
|
2024-10-17 18:02:27 +02:00
|
|
|
wget -qO btbn-ffmpeg.tar.xz "https://github.com/NickM-27/FFmpeg-Builds/releases/download/autobuild-2024-09-19-12-51/ffmpeg-n7.0.2-18-g3e6cec1286-linux64-gpl-7.0.tar.xz"
|
2024-09-19 21:29:58 +02:00
|
|
|
tar -xf btbn-ffmpeg.tar.xz -C /usr/lib/ffmpeg/7.0 --strip-components 1
|
|
|
|
rm -rf btbn-ffmpeg.tar.xz /usr/lib/ffmpeg/7.0/doc /usr/lib/ffmpeg/7.0/bin/ffplay
|
2022-11-22 02:31:39 +01:00
|
|
|
fi
|
|
|
|
|
2023-01-08 14:04:58 +01:00
|
|
|
# ffmpeg -> arm64
|
|
|
|
if [[ "${TARGETARCH}" == "arm64" ]]; then
|
2024-09-13 22:14:51 +02:00
|
|
|
mkdir -p /usr/lib/ffmpeg/5.0
|
2024-09-19 21:29:58 +02:00
|
|
|
mkdir -p /usr/lib/ffmpeg/7.0
|
2024-09-13 22:14:51 +02:00
|
|
|
wget -qO btbn-ffmpeg.tar.xz "https://github.com/NickM-27/FFmpeg-Builds/releases/download/autobuild-2022-07-31-12-37/ffmpeg-n5.1-2-g915ef932a3-linuxarm64-gpl-5.1.tar.xz"
|
|
|
|
tar -xf btbn-ffmpeg.tar.xz -C /usr/lib/ffmpeg/5.0 --strip-components 1
|
|
|
|
rm -rf btbn-ffmpeg.tar.xz /usr/lib/ffmpeg/5.0/doc /usr/lib/ffmpeg/5.0/bin/ffplay
|
2024-10-17 18:02:27 +02:00
|
|
|
wget -qO btbn-ffmpeg.tar.xz "https://github.com/NickM-27/FFmpeg-Builds/releases/download/autobuild-2024-09-19-12-51/ffmpeg-n7.0.2-18-g3e6cec1286-linuxarm64-gpl-7.0.tar.xz"
|
2024-09-19 21:29:58 +02:00
|
|
|
tar -xf btbn-ffmpeg.tar.xz -C /usr/lib/ffmpeg/7.0 --strip-components 1
|
|
|
|
rm -rf btbn-ffmpeg.tar.xz /usr/lib/ffmpeg/7.0/doc /usr/lib/ffmpeg/7.0/bin/ffplay
|
2022-11-22 02:31:39 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# arch specific packages
|
|
|
|
if [[ "${TARGETARCH}" == "amd64" ]]; then
|
2024-11-20 19:42:34 +01:00
|
|
|
# install amd / intel-i965 driver packages
|
2022-11-22 02:31:39 +01:00
|
|
|
apt-get -qq install --no-install-recommends --no-install-suggests -y \
|
2024-09-19 15:41:08 +02:00
|
|
|
i965-va-driver intel-gpu-tools onevpl-tools \
|
2024-09-14 04:18:56 +02:00
|
|
|
libva-drm2 \
|
|
|
|
mesa-va-drivers radeontop
|
2024-09-14 15:03:39 +02:00
|
|
|
|
2023-02-11 16:57:15 +01:00
|
|
|
# something about this dependency requires it to be installed in a separate call rather than in the line above
|
|
|
|
apt-get -qq install --no-install-recommends --no-install-suggests -y \
|
|
|
|
i965-va-driver-shaders
|
2024-09-14 15:03:39 +02:00
|
|
|
|
2024-10-17 02:26:47 +02:00
|
|
|
# intel packages use zst compression so we need to update dpkg
|
|
|
|
apt-get install -y dpkg
|
|
|
|
|
2024-09-19 15:41:08 +02:00
|
|
|
# use intel apt intel packages
|
|
|
|
wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg
|
|
|
|
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy client" | tee /etc/apt/sources.list.d/intel-gpu-jammy.list
|
|
|
|
apt-get -qq update
|
|
|
|
apt-get -qq install --no-install-recommends --no-install-suggests -y \
|
2024-11-09 18:08:25 +01:00
|
|
|
intel-opencl-icd=24.35.30872.31-996~22.04 intel-level-zero-gpu=1.3.29735.27-914~22.04 intel-media-va-driver-non-free=24.3.3-996~22.04 \
|
|
|
|
libmfx1=23.2.2-880~22.04 libmfxgen1=24.2.4-914~22.04 libvpl2=1:2.13.0.0-996~22.04
|
2024-09-19 15:41:08 +02:00
|
|
|
|
|
|
|
rm -f /usr/share/keyrings/intel-graphics.gpg
|
|
|
|
rm -f /etc/apt/sources.list.d/intel-gpu-jammy.list
|
2022-11-22 02:31:39 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${TARGETARCH}" == "arm64" ]]; then
|
|
|
|
apt-get -qq install --no-install-recommends --no-install-suggests -y \
|
2024-09-22 17:56:30 +02:00
|
|
|
libva-drm2 mesa-va-drivers radeontop
|
2022-11-22 02:31:39 +01:00
|
|
|
fi
|
|
|
|
|
2024-09-06 02:27:32 +02:00
|
|
|
# install vulkan
|
|
|
|
apt-get -qq install --no-install-recommends --no-install-suggests -y \
|
|
|
|
libvulkan1 mesa-vulkan-drivers
|
|
|
|
|
2023-07-06 21:20:33 +02:00
|
|
|
apt-get purge gnupg apt-transport-https xz-utils -y
|
2022-11-22 02:31:39 +01:00
|
|
|
apt-get clean autoclean -y
|
|
|
|
apt-get autoremove --purge -y
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2023-04-23 18:35:40 +02:00
|
|
|
|
|
|
|
# Install yq, for frigate-prepare and go2rtc echo source
|
|
|
|
curl -fsSL \
|
|
|
|
"https://github.com/mikefarah/yq/releases/download/v4.33.3/yq_linux_$(dpkg --print-architecture)" \
|
|
|
|
--output /usr/local/bin/yq
|
|
|
|
chmod +x /usr/local/bin/yq
|