fix(jellyfin): use setup_hwaccel for robust hardware acceleration

Replaces manual hardware acceleration setup with the centralized
setup_hwaccel function from tools.func.

This fixes the installation failure in privileged containers where
/dev/dri does not exist (e.g., when no GPU is passed through).

The setup_hwaccel function includes:
- Proper error handling for missing /dev/dri
- GPU vendor detection (Intel, AMD, NVIDIA)
- Graceful fallback when no GPU is available

Fixes: Installation fails with 'chgrp: cannot access /dev/dri'
when creating privileged containers without GPU passthrough.
This commit is contained in:
CanbiZ
2025-12-17 08:10:30 +01:00
parent 033879f712
commit 65484b76c0

View File

@ -13,25 +13,7 @@ setting_up_container
network_check
update_os
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"
setup_hwaccel
msg_info "Installing Jellyfin"
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"