From 821c4f36f6f118a6a6a970ddca7214b6f633a0bc Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 22 Sep 2025 13:59:56 +0200 Subject: [PATCH] Update passthrough.func --- misc/passthrough.func | 113 ------------------------------------------ 1 file changed, 113 deletions(-) diff --git a/misc/passthrough.func b/misc/passthrough.func index e7807a6e..690848fa 100644 --- a/misc/passthrough.func +++ b/misc/passthrough.func @@ -276,116 +276,3 @@ nvidia_handle_passthrough() { ' fi } - -# ------------------------------------------------------------------------------ -# Hardware acceleration setup inside container (Intel/AMD via VAAPI) -# Debian 12 (bookworm), Debian 13 (trixie), Ubuntu 24.04 (noble) -# Usage: hwaccel_setup_in_ct [--nonfree-intel] -# ------------------------------------------------------------------------------ -hwaccel_setup_in_ct() { - local CTTYPE="$1" NONFREE=0 - [[ "$2" == "--nonfree-intel" ]] && NONFREE=1 - - local ID VERSION_CODENAME - if [[ -r /etc/os-release ]]; then . /etc/os-release; fi - ID="${ID:-debian}" - VERSION_CODENAME="${VERSION_CODENAME:-bookworm}" - - msg_info "Setting up VAAPI userland for ${ID^} ($VERSION_CODENAME)" - - case "$ID" in - debian | ubuntu) - if ((NONFREE)) && [[ "$VERSION_CODENAME" =~ (trixie|noble) ]]; then - # Debian 13 / Ubuntu 24.04 — enable non-free Intel media (Debian deb822) - if [[ "$VERSION_CODENAME" == "trixie" ]]; then - cat >/etc/apt/sources.list.d/non-free.sources <<'SRC' -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 -SRC - fi - - $STD apt-get update - $STD apt-get install -y \ - intel-media-va-driver-non-free \ - ocl-icd-libopencl1 \ - mesa-opencl-icd \ - mesa-va-drivers \ - libvpl2 \ - vainfo \ - intel-gpu-tools - else - $STD apt-get update - $STD apt-get install -y \ - va-driver-all \ - ocl-icd-libopencl1 \ - mesa-opencl-icd \ - mesa-va-drivers \ - vainfo \ - intel-gpu-tools - fi - ;; - *) - msg_warn "Unsupported distro ($ID $VERSION_CODENAME) – skipping VAAPI setup." - return 0 - ;; - esac - - if [[ "$CTTYPE" == "0" ]]; then - $STD adduser "$(id -un)" video || true - $STD adduser "$(id -un)" render || true - fi - - msg_ok "VAAPI userland ready" -} - -# ------------------------------------------------------------------------------ -# NVIDIA userland inside container -# Debian 12/13, Ubuntu 24.04 -# Usage: nvidia_setup_in_ct -# ------------------------------------------------------------------------------ -nvidia_setup_in_ct() { - local CTTYPE="$1" - - local ID VERSION_CODENAME - if [[ -r /etc/os-release ]]; then . /etc/os-release; fi - ID="${ID:-debian}" - VERSION_CODENAME="${VERSION_CODENAME:-bookworm}" - - msg_info "Installing NVIDIA userland on ${ID^} ($VERSION_CODENAME)" - - case "$ID" in - debian | ubuntu) - $STD apt-get update - $STD apt-get install -y \ - nvidia-driver \ - nvidia-utils \ - libnvidia-encode1 \ - libcuda1 || { - msg_error "Failed to install NVIDIA packages" - return 1 - } - ;; - *) - msg_warn "Unsupported distro ($ID $VERSION_CODENAME) – skipping NVIDIA setup." - return 0 - ;; - esac - - if [[ "$CTTYPE" == "0" ]]; then - $STD adduser "$(id -un)" video || true - fi - - msg_ok "NVIDIA userland ready" -}