Compare commits

..

6 Commits

Author SHA1 Message Date
452b82e8a1 formatting 2025-12-17 10:52:02 +01:00
88104f3da6 feat(gpu): add GPU support for video/audio streaming apps
HIGH PRIORITY - Video Transcoding/Streaming:
- mediamtx - RTSP/RTMP/HLS streaming server with ffmpeg
- threadfin - M3U proxy for Plex/Emby/Jellyfin DVR (ffmpeg+VLC)
- nxwitness - Nx Witness VMS/NVR surveillance with ffmpeg
- metube - YouTube downloader with ffmpeg conversion
- uhf - UHF DVR/recording server with ffmpeg
- dispatcharr - IPTV dispatch system (ffmpeg+streamlink)
- convertx - Universal file converter (ffmpeg+libva2)
- teddycloud - Toniebox cloud with ffmpeg

MEDIUM PRIORITY - Audio/Ambient Lighting:
- navidrome - Music streaming server with ffmpeg transcoding
- koel - Music streaming server with ffmpeg transcoding
- audiobookshelf - Audiobook server with ffmpeg processing
- hyperhdr - HDR ambient lighting with video capture
- hyperion - Ambient lighting with video capture

All apps now have:
- var_gpu=yes in ct scripts for /dev/dri passthrough
- setup_hwaccel in install scripts for driver installation
2025-12-17 10:52:02 +01:00
81f5f586a1 formatting 2025-12-17 10:52:01 +01:00
61dd87c9e6 feat(gpu): add GPU support for agentdvr, nextpvr, go2rtc
Added var_gpu=yes to ct scripts:
- agentdvr.sh - NVR with VAAPI support (libva-drm2 already in deps)
- nextpvr.sh - PVR with FFmpeg transcoding
- go2rtc.sh - RTSP restreaming with HW transcoding

Added setup_hwaccel to install scripts:
- agentdvr-install.sh
- nextpvr-install.sh
- go2rtc-install.sh

These video/streaming apps benefit from hardware acceleration
for real-time video transcoding and restreaming.
2025-12-17 10:52:01 +01:00
b73b83d45d feat(gpu): add GPU support for comfyui, photoprism, libretranslate
Added var_gpu=yes to ct scripts:
- comfyui.sh - Stable Diffusion (CRITICAL: had GPU selection but no passthrough!)
- photoprism.sh - TensorFlow face detection + FFmpeg transcoding
- libretranslate.sh - PyTorch ML translation

Added setup_hwaccel to install scripts:
- comfyui-install.sh
- photoprism-install.sh
- libretranslate-install.sh

These apps use PyTorch/TensorFlow for ML and benefit significantly
from GPU acceleration (Intel XPU, AMD ROCm, NVIDIA CUDA).
2025-12-17 10:52:01 +01:00
2578e365f4 feat(gpu): add GPU support for shinobi, motioneye, owncast
Added var_gpu=yes to ct scripts:
- shinobi.sh - NVR with video transcoding
- motioneye.sh - Motion detection with recording
- owncast.sh - Live streaming server

Added setup_hwaccel to install scripts:
- shinobi-install.sh
- motioneye-install.sh
- owncast-install.sh

These apps use FFmpeg for video encoding and benefit from
hardware acceleration (Intel QSV, AMD VCE, NVIDIA NVENC).
2025-12-17 10:52:01 +01:00
48 changed files with 345 additions and 241 deletions

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-8}"
var_os="${var_os:-ubuntu}" var_os="${var_os:-ubuntu}"
var_version="${var_version:-24.04}" var_version="${var_version:-24.04}"
var_unprivileged="${var_unprivileged:-0}" var_unprivileged="${var_unprivileged:-0}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG # Copyright (c) 2021-2025 community-scripts ORG
# Author: jdacode # Author: jdacode
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
@ -13,6 +13,7 @@ var_disk="${var_disk:-25}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-13}" var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-20}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-12}" var_version="${var_version:-12}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-8}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-13}" var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables
@ -88,8 +89,8 @@ function update_script() {
fi fi
if ! grep -q "DJANGO_SECRET_KEY" /opt/dispatcharr/.env; then if ! grep -q "DJANGO_SECRET_KEY" /opt/dispatcharr/.env; then
DJANGO_SECRET=$(openssl rand -base64 48 | tr -dc 'a-zA-Z0-9' | cut -c1-50) DJANGO_SECRET=$(openssl rand -base64 48 | tr -dc 'a-zA-Z0-9' | cut -c1-50)
echo "DJANGO_SECRET_KEY=$DJANGO_SECRET" >> /opt/dispatcharr/.env echo "DJANGO_SECRET_KEY=$DJANGO_SECRET" >>/opt/dispatcharr/.env
fi fi
cd /opt/dispatcharr cd /opt/dispatcharr

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-4}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-12}" var_version="${var_version:-12}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-4}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-12}" var_version="${var_version:-12}"
var_unprivileged="${var_unprivileged:-0}" var_unprivileged="${var_unprivileged:-0}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-2}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-13}" var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-20}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-13}" var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-4}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-13}" var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-8}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-13}" var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables
@ -20,17 +21,17 @@ color
catch_errors catch_errors
function update_script() { function update_script() {
header_info header_info
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -f /etc/systemd/system/motioneye.service ]]; then if [[ ! -f /etc/systemd/system/motioneye.service ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating ${APP} LXC"
$STD pip install motioneye --upgrade
msg_ok "Updated successfully!"
exit exit
fi
msg_info "Updating ${APP} LXC"
$STD pip install motioneye --upgrade
msg_ok "Updated successfully!"
exit
} }
start start

View File

@ -14,6 +14,7 @@ var_disk="${var_disk:-5}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-13}" var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-8}"
var_os="${var_os:-ubuntu}" var_os="${var_os:-ubuntu}"
var_version="${var_version:-24.04}" var_version="${var_version:-24.04}"
var_unprivileged="${var_unprivileged:-0}" var_unprivileged="${var_unprivileged:-0}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-2}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-13}" var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-8}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-13}" var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-8}"
var_os="${var_os:-ubuntu}" var_os="${var_os:-ubuntu}"
var_version="${var_version:-24.04}" var_version="${var_version:-24.04}"
var_unprivileged="${var_unprivileged:-0}" var_unprivileged="${var_unprivileged:-0}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-4}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-13}" var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -13,6 +13,7 @@ var_disk="${var_disk:-8}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-13}" var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
var_gpu="${var_gpu:-yes}"
header_info "$APP" header_info "$APP"
variables variables

View File

@ -12,6 +12,7 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt install -y \ $STD apt install -y \

View File

@ -29,7 +29,19 @@ if [[ ! "$CONFIRM" =~ ^([yY][eE][sS]|[yY])$ ]]; then
exit 10 exit 10
fi fi
setup_hwaccel if [[ "$CTTYPE" == "0" ]]; then
msg_info "Setting Up Hardware Acceleration"
$STD apt-get -y install \
va-driver-all \
ocl-icd-libopencl1 \
intel-opencl-icd
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_info "Installing Channels DVR Server (Patience)" msg_info "Installing Channels DVR Server (Patience)"
cd /opt cd /opt

View File

@ -12,6 +12,7 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
echo echo
echo "${TAB3}Choose the GPU type for ComfyUI:" echo "${TAB3}Choose the GPU type for ComfyUI:"

View File

@ -12,6 +12,7 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
setup_imagemagick setup_imagemagick

View File

@ -12,17 +12,18 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt install -y \ $STD apt install -y \
build-essential \ build-essential \
python3-dev \ python3-dev \
libpq-dev \ libpq-dev \
nginx \ nginx \
redis-server \ redis-server \
ffmpeg \ ffmpeg \
procps \ procps \
streamlink streamlink
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
setup_uv setup_uv
@ -39,11 +40,11 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8'
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';" $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
{ {
echo "Dispatcharr Credentials" echo "Dispatcharr Credentials"
echo "Database Name: $DB_NAME" echo "Database Name: $DB_NAME"
echo "Database User: $DB_USER" echo "Database User: $DB_USER"
echo "Database Password: $DB_PASS" echo "Database Password: $DB_PASS"
echo "" echo ""
} >>~/dispatcharr.creds } >>~/dispatcharr.creds
msg_ok "Created PostgreSQL Database" msg_ok "Created PostgreSQL Database"
@ -58,9 +59,9 @@ msg_ok "Installed Python Dependencies"
msg_info "Configuring Dispatcharr" msg_info "Configuring Dispatcharr"
install -d -m 755 \ install -d -m 755 \
/data/{logos,recordings,plugins,db} \ /data/{logos,recordings,plugins,db} \
/data/uploads/{m3us,epgs} \ /data/uploads/{m3us,epgs} \
/data/{m3us,epgs} /data/{m3us,epgs}
chown -R root:root /data chown -R root:root /data
DJANGO_SECRET=$(openssl rand -base64 48 | tr -dc 'a-zA-Z0-9' | cut -c1-50) DJANGO_SECRET=$(openssl rand -base64 48 | tr -dc 'a-zA-Z0-9' | cut -c1-50)
export DATABASE_URL="postgresql://${DB_USER}:${DB_PASS}@localhost:5432/${DB_NAME}" export DATABASE_URL="postgresql://${DB_USER}:${DB_PASS}@localhost:5432/${DB_NAME}"

View File

@ -13,7 +13,16 @@ setting_up_container
network_check network_check
update_os update_os
setup_hwaccel 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
chgrp video /dev/dri
chmod 755 /dev/dri
chmod 660 /dev/dri/*
$STD adduser $(id -u -n) video
$STD adduser $(id -u -n) render
fi
msg_ok "Set Up Hardware Acceleration"
fetch_and_deploy_gh_release "emby" "MediaBrowser/Emby.Releases" "binary" fetch_and_deploy_gh_release "emby" "MediaBrowser/Emby.Releases" "binary"

View File

@ -13,7 +13,38 @@ setting_up_container
network_check network_check
update_os update_os
setup_hwaccel 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
chgrp video /dev/dri
chmod 755 /dev/dri
chmod 660 /dev/dri/*
$STD adduser $(id -u -n) video
$STD adduser $(id -u -n) render
fi
msg_ok "Set Up Hardware Acceleration"
read -r -p "${TAB3}Do you need the intel-media-va-driver-non-free driver for HW encoding (Debian 12 only)? <y/N> " prompt
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_info "Installing Intel Hardware Acceleration (non-free)"
cat <<EOF >/etc/apt/sources.list.d/non-free.list
deb http://deb.debian.org/debian bookworm non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm non-free non-free-firmware
deb http://deb.debian.org/debian-security bookworm-security non-free non-free-firmware
deb-src http://deb.debian.org/debian-security bookworm-security non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm-updates non-free non-free-firmware
EOF
$STD apt-get update
$STD apt-get -y install {intel-media-va-driver-non-free,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools}
else
msg_info "Installing Intel Hardware Acceleration"
$STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools}
fi
msg_ok "Installed and Set Up Intel Hardware Acceleration"
fetch_and_deploy_gh_release "ersatztv" "ErsatzTV/ErsatzTV" "prebuild" "latest" "/opt/ErsatzTV" "*linux-x64.tar.gz" fetch_and_deploy_gh_release "ersatztv" "ErsatzTV/ErsatzTV" "prebuild" "latest" "/opt/ErsatzTV" "*linux-x64.tar.gz"
fetch_and_deploy_gh_release "ersatztv-ffmpeg" "ErsatzTV/ErsatzTV-ffmpeg" "prebuild" "latest" "/opt/ErsatzTV-ffmpeg" "*-linux64-gpl-7.1.tar.xz" fetch_and_deploy_gh_release "ersatztv-ffmpeg" "ErsatzTV/ErsatzTV-ffmpeg" "prebuild" "latest" "/opt/ErsatzTV-ffmpeg" "*-linux64-gpl-7.1.tar.xz"

View File

@ -21,7 +21,27 @@ $STD apt-get install -y \
imagemagick imagemagick
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
setup_hwaccel read -r -p "${TAB3}Do you need the intel-media-va-driver-non-free driver for HW encoding (Debian 12 only)? <y/N> " prompt
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_info "Installing Intel Hardware Acceleration (non-free)"
cat <<EOF >/etc/apt/sources.list.d/non-free.list
deb http://deb.debian.org/debian bookworm non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm non-free non-free-firmware
deb http://deb.debian.org/debian-security bookworm-security non-free non-free-firmware
deb-src http://deb.debian.org/debian-security bookworm-security non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm-updates non-free non-free-firmware
EOF
$STD apt-get update
$STD apt-get -y install {intel-media-va-driver-non-free,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools}
else
msg_info "Installing Intel Hardware Acceleration"
$STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools}
fi
msg_ok "Installed and Set Up Intel Hardware Acceleration"
msg_info "Installing ASP.NET Core Runtime" msg_info "Installing ASP.NET Core Runtime"
curl -fsSL https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -o packages-microsoft-prod.deb curl -fsSL https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -o packages-microsoft-prod.deb

View File

@ -33,7 +33,14 @@ chmod +x go2rtc
$STD ln -svf /usr/local/go2rtc/bin/go2rtc /usr/local/bin/go2rtc $STD ln -svf /usr/local/go2rtc/bin/go2rtc /usr/local/bin/go2rtc
msg_ok "Installed go2rtc" msg_ok "Installed go2rtc"
setup_hwaccel 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
chgrp video /dev/dri
chmod 755 /dev/dri
chmod 660 /dev/dri/*
fi
msg_ok "Set Up Hardware Acceleration"
msg_info "Installing Frigate v0.14.1 (Perseverance)" msg_info "Installing Frigate v0.14.1 (Perseverance)"
cd ~ cd ~

View File

@ -12,6 +12,7 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
USE_ORIGINAL_FILENAME="true" fetch_and_deploy_gh_release "go2rtc" "AlexxIT/go2rtc" "singlefile" "latest" "/opt/go2rtc" "go2rtc_linux_amd64" USE_ORIGINAL_FILENAME="true" fetch_and_deploy_gh_release "go2rtc" "AlexxIT/go2rtc" "singlefile" "latest" "/opt/go2rtc" "go2rtc_linux_amd64"

View File

@ -12,6 +12,7 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Installing HyperHDR" msg_info "Installing HyperHDR"
setup_deb822_repo \ setup_deb822_repo \

View File

@ -12,6 +12,7 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Setting up Hyperion repository" msg_info "Setting up Hyperion repository"
setup_deb822_repo \ setup_deb822_repo \

View File

@ -75,13 +75,12 @@ $STD apt install -y jellyfin-ffmpeg7
ln -sf /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/bin/ffmpeg ln -sf /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/bin/ffmpeg
ln -sf /usr/lib/jellyfin-ffmpeg/ffprobe /usr/bin/ffprobe ln -sf /usr/lib/jellyfin-ffmpeg/ffprobe /usr/bin/ffprobe
# Set permissions for /dev/dri (only in privileged containers and if /dev/dri exists)
if [[ "$CTTYPE" == "0" && -d /dev/dri ]]; then if [[ "$CTTYPE" == "0" && -d /dev/dri ]]; then
chgrp video /dev/dri 2>/dev/null || true chgrp video /dev/dri
chmod 755 /dev/dri 2>/dev/null || true chmod 755 /dev/dri
chmod 660 /dev/dri/* 2>/dev/null || true chmod 660 /dev/dri/*
$STD adduser "$(id -u -n)" video 2>/dev/null || true $STD adduser "$(id -u -n)" video
$STD adduser "$(id -u -n)" render 2>/dev/null || true $STD adduser "$(id -u -n)" render
fi fi
msg_ok "Dependencies Installed" msg_ok "Dependencies Installed"

View File

@ -13,7 +13,25 @@ setting_up_container
network_check network_check
update_os update_os
setup_hwaccel msg_info "Setting Up Hardware Acceleration"
if ! grep -qEi 'ubuntu' /etc/os-release; then
fetch_and_deploy_gh_release "intel-igc-core-2" "intel/intel-graphics-compiler" "binary" "latest" "" "intel-igc-core-2_*_amd64.deb"
fetch_and_deploy_gh_release "intel-igc-opencl-2" "intel/intel-graphics-compiler" "binary" "latest" "" "intel-igc-opencl-2_*_amd64.deb"
fetch_and_deploy_gh_release "intel-libgdgmm12" "intel/compute-runtime" "binary" "latest" "" "libigdgmm12_*_amd64.deb"
fetch_and_deploy_gh_release "intel-opencl-icd" "intel/compute-runtime" "binary" "latest" "" "intel-opencl-icd_*_amd64.deb"
else
$STD apt -y install intel-opencl-icd
fi
$STD apt -y install {va-driver-all,ocl-icd-libopencl1,vainfo,intel-gpu-tools}
if [[ "$CTTYPE" == "0" ]]; then
chgrp video /dev/dri
chmod 755 /dev/dri
chmod 660 /dev/dri/*
$STD adduser $(id -u -n) video
$STD adduser $(id -u -n) render
fi
msg_ok "Set Up Hardware Acceleration"
msg_info "Installing Jellyfin" msg_info "Installing Jellyfin"
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)" VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"

View File

@ -12,6 +12,7 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Installing dependencies" msg_info "Installing dependencies"
$STD apt install -y \ $STD apt install -y \

View File

@ -12,6 +12,7 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt install -y ffmpeg $STD apt install -y ffmpeg

View File

@ -13,6 +13,8 @@ setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt install -y git $STD apt install -y git
$STD apt install -y cifs-utils $STD apt install -y cifs-utils

View File

@ -12,6 +12,7 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Installing Dependencies (Patience)" msg_info "Installing Dependencies (Patience)"
$STD apt install -y \ $STD apt install -y \

View File

@ -12,6 +12,7 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt install -y \ $STD apt install -y \

View File

@ -41,11 +41,16 @@ EOF
$STD apt update $STD apt update
msg_ok "Set up Intel® Repositories" msg_ok "Set up Intel® Repositories"
setup_hwaccel msg_info "Setting Up Hardware Acceleration"
$STD apt -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools,intel-level-zero-gpu,level-zero,level-zero-dev}
msg_info "Installing Intel® Level Zero" if [[ "$CTTYPE" == "0" ]]; then
$STD apt -y install intel-level-zero-gpu level-zero level-zero-dev 2>/dev/null || true chgrp video /dev/dri
msg_ok "Installed Intel® Level Zero" chmod 755 /dev/dri
chmod 660 /dev/dri/*
$STD adduser $(id -u -n) video
$STD adduser $(id -u -n) render
fi
msg_ok "Set Up Hardware Acceleration"
msg_info "Installing Intel® oneAPI Base Toolkit (Patience)" msg_info "Installing Intel® oneAPI Base Toolkit (Patience)"
$STD apt install -y --no-install-recommends intel-basekit-2024.1 $STD apt install -y --no-install-recommends intel-basekit-2024.1

View File

@ -17,8 +17,6 @@ msg_info "Installing Dependencies"
$STD apt install -y ffmpeg $STD apt install -y ffmpeg
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
setup_hwaccel
PYTHON_VERSION="3.12" setup_uv PYTHON_VERSION="3.12" setup_uv
msg_info "Installing Open WebUI" msg_info "Installing Open WebUI"
@ -27,36 +25,6 @@ msg_ok "Installed Open WebUI"
read -r -p "${TAB3}Would you like to add Ollama? <y/N> " prompt read -r -p "${TAB3}Would you like to add Ollama? <y/N> " prompt
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_info "Setting up Intel® Repositories"
mkdir -p /usr/share/keyrings
curl -fsSL https://repositories.intel.com/gpu/intel-graphics.key | gpg --dearmor -o /usr/share/keyrings/intel-graphics.gpg 2>/dev/null || true
cat <<EOF >/etc/apt/sources.list.d/intel-gpu.sources
Types: deb
URIs: https://repositories.intel.com/gpu/ubuntu
Suites: jammy
Components: client
Architectures: amd64 i386
Signed-By: /usr/share/keyrings/intel-graphics.gpg
EOF
curl -fsSL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor -o /usr/share/keyrings/oneapi-archive-keyring.gpg 2>/dev/null || true
cat <<EOF >/etc/apt/sources.list.d/oneAPI.sources
Types: deb
URIs: https://apt.repos.intel.com/oneapi
Suites: all
Components: main
Signed-By: /usr/share/keyrings/oneapi-archive-keyring.gpg
EOF
$STD apt update
msg_ok "Set up Intel® Repositories"
msg_info "Installing Intel® Level Zero"
$STD apt -y install intel-level-zero-gpu level-zero level-zero-dev 2>/dev/null || true
msg_ok "Installed Intel® Level Zero"
msg_info "Installing Intel® oneAPI Base Toolkit (Patience)"
$STD apt install -y --no-install-recommends intel-basekit-2024.1 2>/dev/null || true
msg_ok "Installed Intel® oneAPI Base Toolkit"
msg_info "Installing Ollama" msg_info "Installing Ollama"
curl -fsSLO -C - https://ollama.com/download/ollama-linux-amd64.tgz curl -fsSLO -C - https://ollama.com/download/ollama-linux-amd64.tgz
tar -C /usr -xzf ollama-linux-amd64.tgz tar -C /usr -xzf ollama-linux-amd64.tgz

View File

@ -13,6 +13,8 @@ setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Installing Dependencies (Patience)" msg_info "Installing Dependencies (Patience)"
$STD apt install -y ffmpeg $STD apt install -y ffmpeg
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"

View File

@ -12,6 +12,7 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Installing Dependencies (Patience)" msg_info "Installing Dependencies (Patience)"
$STD apt install -y \ $STD apt install -y \

View File

@ -13,7 +13,16 @@ setting_up_container
network_check network_check
update_os update_os
setup_hwaccel msg_info "Setting Up Hardware Acceleration"
$STD apt -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools}
if [[ "$CTTYPE" == "0" ]]; then
chgrp video /dev/dri
chmod 755 /dev/dri
chmod 660 /dev/dri/*
$STD adduser $(id -u -n) video
$STD adduser $(id -u -n) render
fi
msg_ok "Set Up Hardware Acceleration"
msg_info "Setting Up Plex Media Server Repository" msg_info "Setting Up Plex Media Server Repository"
curl -fsSL https://downloads.plex.tv/plex-keys/PlexSign.key | tee /usr/share/keyrings/PlexSign.asc >/dev/null curl -fsSL https://downloads.plex.tv/plex-keys/PlexSign.key | tee /usr/share/keyrings/PlexSign.asc >/dev/null

View File

@ -13,6 +13,8 @@ setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get install -y make zip net-tools git $STD apt-get install -y make zip net-tools git
$STD apt-get install -y gcc g++ cmake $STD apt-get install -y gcc g++ cmake

View File

@ -28,7 +28,32 @@ $STD ./Tdarr_Updater
rm -rf /opt/tdarr/Tdarr_Updater.zip rm -rf /opt/tdarr/Tdarr_Updater.zip
msg_ok "Installed Tdarr" msg_ok "Installed Tdarr"
setup_hwaccel msg_info "Setting Up Hardware Acceleration"
$STD apt -y install \
va-driver-all \
ocl-icd-libopencl1 \
vainfo \
intel-gpu-tools \
mesa-va-drivers \
mesa-vdpau-drivers \
intel-media-va-driver
if [[ "$CTTYPE" == "0" ]]; then
chgrp video /dev/dri
chmod 755 /dev/dri
chmod 660 /dev/dri/*
$STD adduser $(id -u -n) video
$STD adduser $(id -u -n) render
VIDEO_GID=$(getent group video | cut -d: -f3)
RENDER_GID=$(getent group render | cut -d: -f3)
if [[ -n "$VIDEO_GID" && -n "$RENDER_GID" ]]; then
sed -i "s/^video:x:[0-9]*:/video:x:$VIDEO_GID:/" /etc/group
sed -i "s/^render:x:[0-9]*:/render:x:$RENDER_GID:/" /etc/group
fi
else
VIDEO_GID=$(getent group video | cut -d: -f3)
RENDER_GID=$(getent group render | cut -d: -f3)
fi
msg_ok "Set Up Hardware Acceleration"
msg_info "Creating Service" msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/tdarr-server.service cat <<EOF >/etc/systemd/system/tdarr-server.service

View File

@ -12,6 +12,7 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt install -y \ $STD apt install -y \

View File

@ -13,7 +13,53 @@ setting_up_container
network_check network_check
update_os update_os
setup_hwaccel msg_info "Setting Up Hardware Acceleration"
if [[ "$CTTYPE" == "0" ]]; then
$STD adduser "$(id -un)" video
$STD adduser "$(id -un)" render
fi
msg_ok "Base Hardware Acceleration Set Up"
read -r -p "${TAB3}Do you need the intel-media-va-driver-non-free driver for HW encoding (Debian 13 only)? <y/N> " prompt
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_info "Installing Intel Hardware Acceleration (non-free)"
cat <<'EOF' >/etc/apt/sources.list.d/non-free.sources
Types: deb deb-src
URIs: http://deb.debian.org/debian
Suites: trixie
Components: non-free non-free-firmware
Types: deb deb-src
URIs: http://deb.debian.org/debian-security
Suites: trixie-security
Components: non-free non-free-firmware
Types: deb deb-src
URIs: http://deb.debian.org/debian
Suites: trixie-updates
Components: non-free non-free-firmware
EOF
$STD apt update
$STD apt -y install \
intel-media-va-driver-non-free \
ocl-icd-libopencl1 \
mesa-opencl-icd \
mesa-va-drivers \
libvpl2 \
vainfo \
intel-gpu-tools
else
msg_info "Installing Intel Hardware Acceleration (open packages)"
$STD apt -y install \
va-driver-all \
ocl-icd-libopencl1 \
mesa-opencl-icd \
mesa-va-drivers \
vainfo \
intel-gpu-tools
fi
msg_ok "Installed and Set Up Intel Hardware Acceleration"
fetch_and_deploy_gh_release "tunarr" "chrisbenincasa/tunarr" "prebuild" "latest" "/opt/tunarr" "*linux-x64.tar.gz" fetch_and_deploy_gh_release "tunarr" "chrisbenincasa/tunarr" "prebuild" "latest" "/opt/tunarr" "*linux-x64.tar.gz"
cd /opt/tunarr cd /opt/tunarr

View File

@ -12,6 +12,7 @@ catch_errors
setting_up_container setting_up_container
network_check network_check
update_os update_os
setup_hwaccel
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt install -y ffmpeg $STD apt install -y ffmpeg

View File

@ -19,7 +19,32 @@ $STD apt install -y \
python3-pip python3-pip
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
setup_hwaccel msg_info "Setting Up Hardware Acceleration"
$STD apt -y install \
va-driver-all \
ocl-icd-libopencl1 \
vainfo \
intel-gpu-tools \
mesa-va-drivers \
mesa-vdpau-drivers \
intel-media-va-driver
if [[ "$CTTYPE" == "0" ]]; then
chgrp video /dev/dri
chmod 755 /dev/dri
chmod 660 /dev/dri/*
$STD adduser $(id -u -n) video
$STD adduser $(id -u -n) render
VIDEO_GID=$(getent group video | cut -d: -f3)
RENDER_GID=$(getent group render | cut -d: -f3)
if [[ -n "$VIDEO_GID" && -n "$RENDER_GID" ]]; then
sed -i "s/^video:x:[0-9]*:/video:x:$VIDEO_GID:/" /etc/group
sed -i "s/^render:x:[0-9]*:/render:x:$RENDER_GID:/" /etc/group
fi
else
VIDEO_GID=$(getent group video | cut -d: -f3)
RENDER_GID=$(getent group render | cut -d: -f3)
fi
msg_ok "Set Up Hardware Acceleration"
msg_info "Installing Unmanic" msg_info "Installing Unmanic"
$STD pip3 install unmanic $STD pip3 install unmanic

View File

@ -2585,200 +2585,93 @@ function setup_hwaccel() {
fi fi
# Detect GPU vendor (Intel, AMD, NVIDIA) # Detect GPU vendor (Intel, AMD, NVIDIA)
local gpu_vendor gpu_info local gpu_vendor
gpu_info=$(lspci 2>/dev/null | grep -Ei 'vga|3d|display' || echo "") gpu_vendor=$(lspci 2>/dev/null | grep -Ei 'vga|3d|display' | grep -Eo 'Intel|AMD|NVIDIA' | head -n1 || echo "")
gpu_vendor=$(echo "$gpu_info" | grep -Eo 'Intel|AMD|NVIDIA' | head -n1 || echo "")
# Detect CPU vendor (relevant for AMD APUs) # Detect CPU vendor (relevant for AMD APUs)
local cpu_vendor local cpu_vendor
cpu_vendor=$(lscpu 2>/dev/null | grep -i 'Vendor ID' | awk '{print $3}' || echo "") cpu_vendor=$(lscpu 2>/dev/null | grep -i 'Vendor ID' | awk '{print $3}' || echo "")
if [[ -z "$gpu_vendor" && -z "$cpu_vendor" ]]; then if [[ -z "$gpu_vendor" && -z "$cpu_vendor" ]]; then
msg_warn "No GPU or CPU vendor detected - skipping hardware acceleration setup" msg_error "No GPU or CPU vendor detected (missing lspci/lscpu output)"
msg_ok "Setup Hardware Acceleration (skipped - no GPU detected)" return 1
return 0
fi fi
# Detect OS with fallbacks # Detect OS with fallbacks
local os_id os_codename os_version local os_id os_codename
os_id=$(grep -oP '(?<=^ID=).+' /etc/os-release 2>/dev/null | tr -d '"' || echo "debian") os_id=$(grep -oP '(?<=^ID=).+' /etc/os-release 2>/dev/null | tr -d '"' || grep '^ID=' /etc/os-release 2>/dev/null | cut -d'=' -f2 | tr -d '"' || echo "debian")
os_codename=$(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release 2>/dev/null | tr -d '"' || echo "unknown") os_codename=$(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release 2>/dev/null | tr -d '"' || grep '^VERSION_CODENAME=' /etc/os-release 2>/dev/null | cut -d'=' -f2 | tr -d '"' || echo "unknown")
os_version=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release 2>/dev/null | tr -d '"' || echo "")
[[ -z "$os_id" ]] && os_id="debian" # Validate os_id
if [[ -z "$os_id" ]]; then
os_id="debian"
fi
# Determine if we are in a privileged LXC container # Determine if we are on a VM or LXC
local in_ct="${CTTYPE:-0}" local in_ct="${CTTYPE:-0}"
case "$gpu_vendor" in case "$gpu_vendor" in
Intel) Intel)
# Detect Intel GPU generation for driver selection
# Gen 9+ (Skylake and newer) benefit from non-free drivers
local intel_gen=""
local needs_nonfree=false
# Check for specific Intel GPU models that need non-free drivers
if echo "$gpu_info" | grep -Ei 'HD Graphics [56][0-9]{2}|UHD Graphics|Iris|Arc|DG[12]' &>/dev/null; then
needs_nonfree=true
intel_gen="gen9+"
fi
if [[ "$os_id" == "ubuntu" ]]; then if [[ "$os_id" == "ubuntu" ]]; then
# Ubuntu: Use packages from Ubuntu repos $STD apt -y install intel-opencl-icd || {
$STD apt -y install \ msg_error "Failed to install intel-opencl-icd"
va-driver-all \
ocl-icd-libopencl1 \
intel-opencl-icd \
vainfo \
intel-gpu-tools || {
msg_error "Failed to install Intel GPU dependencies"
return 1 return 1
} }
# Try to install intel-media-va-driver for newer GPUs else
$STD apt -y install intel-media-va-driver 2>/dev/null || true # For Debian: fetch Intel GPU drivers from GitHub
fetch_and_deploy_gh_release "" "intel/intel-graphics-compiler" "binary" "latest" "" "intel-igc-core-2_*_amd64.deb" || {
elif [[ "$os_id" == "debian" ]]; then msg_warn "Failed to deploy Intel IGC core 2"
# Debian: Check version and install appropriate drivers }
if [[ "$needs_nonfree" == true ]]; then fetch_and_deploy_gh_release "" "intel/intel-graphics-compiler" "binary" "latest" "" "intel-igc-opencl-2_*_amd64.deb" || {
# Add non-free repo for intel-media-va-driver-non-free msg_warn "Failed to deploy Intel IGC OpenCL 2"
if [[ "$os_codename" == "bookworm" ]]; then }
# Debian 12 Bookworm fetch_and_deploy_gh_release "" "intel/compute-runtime" "binary" "latest" "" "libigdgmm12_*_amd64.deb" || {
if [[ ! -f /etc/apt/sources.list.d/non-free.list && ! -f /etc/apt/sources.list.d/non-free.sources ]]; then msg_warn "Failed to deploy Intel GDGMM12"
cat <<EOF >/etc/apt/sources.list.d/non-free.sources }
Types: deb fetch_and_deploy_gh_release "" "intel/compute-runtime" "binary" "latest" "" "intel-opencl-icd_*_amd64.deb" || {
URIs: http://deb.debian.org/debian msg_warn "Failed to deploy Intel OpenCL ICD"
Suites: bookworm bookworm-updates }
Components: non-free non-free-firmware
EOF
$STD apt update
fi
$STD apt -y install \
intel-media-va-driver-non-free \
ocl-icd-libopencl1 \
intel-opencl-icd \
vainfo \
intel-gpu-tools || {
msg_warn "Non-free driver install failed, falling back to open drivers"
needs_nonfree=false
}
elif [[ "$os_codename" == "trixie" || "$os_codename" == "sid" ]]; then
# Debian 13 Trixie / Sid
if [[ ! -f /etc/apt/sources.list.d/non-free.sources ]]; then
cat <<'EOF' >/etc/apt/sources.list.d/non-free.sources
Types: deb
URIs: http://deb.debian.org/debian
Suites: trixie trixie-updates
Components: non-free non-free-firmware
Types: deb
URIs: http://deb.debian.org/debian-security
Suites: trixie-security
Components: non-free non-free-firmware
EOF
$STD apt update
fi
$STD apt -y install \
intel-media-va-driver-non-free \
ocl-icd-libopencl1 \
mesa-opencl-icd \
mesa-va-drivers \
libvpl2 \
vainfo \
intel-gpu-tools 2>/dev/null || {
msg_warn "Non-free driver install failed, falling back to open drivers"
needs_nonfree=false
}
fi
fi
# Fallback to open drivers or older Intel GPUs
if [[ "$needs_nonfree" == false ]]; then
# Fetch latest Intel drivers from GitHub for Debian
fetch_and_deploy_gh_release "" "intel/intel-graphics-compiler" "binary" "latest" "" "intel-igc-core-2_*_amd64.deb" || {
msg_warn "Failed to deploy Intel IGC core 2"
}
fetch_and_deploy_gh_release "" "intel/intel-graphics-compiler" "binary" "latest" "" "intel-igc-opencl-2_*_amd64.deb" || {
msg_warn "Failed to deploy Intel IGC OpenCL 2"
}
fetch_and_deploy_gh_release "" "intel/compute-runtime" "binary" "latest" "" "libigdgmm12_*_amd64.deb" || {
msg_warn "Failed to deploy Intel GDGMM12"
}
fetch_and_deploy_gh_release "" "intel/compute-runtime" "binary" "latest" "" "intel-opencl-icd_*_amd64.deb" || {
msg_warn "Failed to deploy Intel OpenCL ICD"
}
$STD apt -y install \
va-driver-all \
ocl-icd-libopencl1 \
mesa-opencl-icd \
mesa-va-drivers \
vainfo \
intel-gpu-tools || {
msg_error "Failed to install Intel GPU dependencies"
return 1
}
fi
fi fi
;;
$STD apt -y install va-driver-all ocl-icd-libopencl1 vainfo intel-gpu-tools || {
msg_error "Failed to install Intel GPU dependencies"
return 1
}
;;
AMD) AMD)
$STD apt -y install \ $STD apt -y install mesa-va-drivers mesa-vdpau-drivers mesa-opencl-icd vainfo clinfo || {
mesa-va-drivers \
mesa-vdpau-drivers \
mesa-opencl-icd \
ocl-icd-libopencl1 \
vainfo \
clinfo 2>/dev/null || {
msg_error "Failed to install AMD GPU dependencies" msg_error "Failed to install AMD GPU dependencies"
return 1 return 1
} }
# AMD firmware for better GPU support # For AMD CPUs without discrete GPU (APUs)
if [[ "$os_id" == "debian" ]]; then if [[ "$cpu_vendor" == "AuthenticAMD" && -n "$gpu_vendor" ]]; then
$STD apt -y install firmware-amd-graphics 2>/dev/null || true $STD apt -y install libdrm-amdgpu1 firmware-amd-graphics || true
fi fi
$STD apt -y install libdrm-amdgpu1 2>/dev/null || true
;; ;;
NVIDIA) NVIDIA)
# NVIDIA needs manual driver setup or passthrough from host # NVIDIA needs manual driver setup - skip for now
msg_warn "NVIDIA GPU detected - driver must be installed manually or passed through from host" msg_info "NVIDIA GPU detected - manual driver setup required"
# Install basic VA-API support for potential hybrid setups
$STD apt -y install va-driver-all vainfo 2>/dev/null || true
;; ;;
*) *)
# No discrete GPU detected - check for AMD APU # If no discrete GPU, but AMD CPU (e.g., Ryzen APU)
if [[ "$cpu_vendor" == "AuthenticAMD" ]]; then if [[ "$cpu_vendor" == "AuthenticAMD" ]]; then
$STD apt -y install \ $STD apt -y install mesa-opencl-icd ocl-icd-libopencl1 clinfo || {
mesa-va-drivers \ msg_error "Failed to install Mesa OpenCL stack"
mesa-vdpau-drivers \ return 1
mesa-opencl-icd \ }
ocl-icd-libopencl1 \
vainfo 2>/dev/null || true
else else
msg_warn "No supported GPU vendor detected - skipping GPU driver installation" msg_warn "No supported GPU vendor detected - skipping GPU acceleration"
fi fi
;; ;;
esac esac
# Set permissions for /dev/dri (only in privileged containers and if /dev/dri exists) if [[ "$in_ct" == "0" ]]; then
if [[ "$in_ct" == "0" && -d /dev/dri ]]; then
chgrp video /dev/dri 2>/dev/null || true chgrp video /dev/dri 2>/dev/null || true
chmod 755 /dev/dri 2>/dev/null || true chmod 755 /dev/dri 2>/dev/null || true
chmod 660 /dev/dri/* 2>/dev/null || true chmod 660 /dev/dri/* 2>/dev/null || true
$STD adduser "$(id -u -n)" video 2>/dev/null || true $STD adduser "$(id -u -n)" video
$STD adduser "$(id -u -n)" render 2>/dev/null || true $STD adduser "$(id -u -n)" render
# Sync GID for video/render groups between host and container
local host_video_gid host_render_gid
host_video_gid=$(getent group video | cut -d: -f3)
host_render_gid=$(getent group render | cut -d: -f3)
if [[ -n "$host_video_gid" && -n "$host_render_gid" ]]; then
sed -i "s/^video:x:[0-9]*:/video:x:$host_video_gid:/" /etc/group 2>/dev/null || true
sed -i "s/^render:x:[0-9]*:/render:x:$host_render_gid:/" /etc/group 2>/dev/null || true
fi
fi fi
cache_installed_version "hwaccel" "1.0" cache_installed_version "hwaccel" "1.0"