Compare commits

..

1 Commits

Author SHA1 Message Date
64ddb550c8 fix(hwaccel): skip setup without GPU passthrough and fix Ubuntu AMD firmware
Fixes #10216

- Add GPU device check at start of setup_hwaccel() to skip when no GPU is passed through
  - /dev/dri for Intel iGPU and AMD GPU (open-source drivers)
  - /dev/nvidia0 for NVIDIA proprietary drivers
  - /dev/kfd for AMD ROCm compute
- Remove firmware-amd-graphics installation on Ubuntu as it doesn't exist
  (Ubuntu includes AMD firmware in linux-firmware package by default)
- Only install libdrm-amdgpu1 on Ubuntu for userspace driver support
2025-12-22 20:36:15 +01:00
3 changed files with 16 additions and 11 deletions

View File

@ -44,7 +44,7 @@ function update_script() {
export PUBLIC_API_URL=""
export BASE_PATH="/web"
cd /opt/mediamanager/web
$STD npm install --no-fund --no-audit
$STD npm ci --no-fund --no-audit
$STD npm run build
rm -rf "$FRONTEND_FILES_DIR"/build
cp -r build "$FRONTEND_FILES_DIR"

View File

@ -49,7 +49,7 @@ export PUBLIC_VERSION=""
export PUBLIC_API_URL=""
export BASE_PATH="/web"
cd /opt/mediamanager/web
$STD npm install --no-fund --no-audit
$STD npm ci --no-fund --no-audit
$STD npm run build
mkdir -p {"$MM_DIR"/web,"$MEDIA_DIR","$CONFIG_DIR"}
cp -r build "$FRONTEND_FILES_DIR"

View File

@ -2571,6 +2571,15 @@ function setup_gs() {
# - Some things are fetched from intel repositories due to not being in debian repositories.
# ------------------------------------------------------------------------------
function setup_hwaccel() {
# Check if GPU passthrough is enabled (device nodes must exist)
# /dev/dri = Intel iGPU, AMD GPU (open-source drivers)
# /dev/nvidia* = NVIDIA proprietary drivers
# /dev/kfd = AMD ROCm compute
if [[ ! -d /dev/dri && ! -e /dev/nvidia0 && ! -e /dev/kfd ]]; then
msg_warn "No GPU passthrough detected (/dev/dri, /dev/nvidia*, /dev/kfd not found) - skipping hardware acceleration setup"
return 0
fi
msg_info "Setup Hardware Acceleration"
if ! command -v lspci &>/dev/null; then
@ -2771,15 +2780,11 @@ EOF
msg_warn "Failed to install AMD firmware - may need manual installation"
}
elif [[ "$os_id" == "ubuntu" ]]; then
# For Ubuntu, ensure multiverse is enabled (firmware-amd-graphics is in multiverse)
if ! grep -qE '^deb.*multiverse' /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2>/dev/null; then
$STD add-apt-repository -y multiverse
$STD apt update
fi
# Install AMD firmware and libdrm
$STD apt -y install libdrm-amdgpu1 firmware-amd-graphics 2>/dev/null || {
msg_warn "Failed to install AMD firmware - may need manual installation"
# For Ubuntu, firmware-amd-graphics does not exist (it's Debian-specific from non-free-firmware)
# Ubuntu includes AMD firmware in linux-firmware package which is installed by default
# Only install libdrm-amdgpu1 for userspace driver support
$STD apt -y install libdrm-amdgpu1 2>/dev/null || {
msg_warn "Failed to install libdrm-amdgpu1 - may need manual installation"
}
else
# For other distributions, try without adding repositories