From 23b678bb03d053757d2cf8402bf87481e29bfdbd Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Fri, 9 May 2025 20:06:28 -0500 Subject: [PATCH] Add pciutils for better hardware detection. --- docker/DispatcharrBase | 2 +- docker/init/04-check-gpu.sh | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/docker/DispatcharrBase b/docker/DispatcharrBase index 58741715..8b65595f 100644 --- a/docker/DispatcharrBase +++ b/docker/DispatcharrBase @@ -14,7 +14,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ python3.13 python3.13-dev python3.13-venv \ python-is-python3 python3-pip \ libpcre3 libpcre3-dev libpq-dev procps \ - build-essential gcc \ + build-essential gcc pciutils \ nginx streamlink \ && apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/docker/init/04-check-gpu.sh b/docker/init/04-check-gpu.sh index 06583b69..e983018d 100644 --- a/docker/init/04-check-gpu.sh +++ b/docker/init/04-check-gpu.sh @@ -151,6 +151,16 @@ done # Give contextual suggestions based on detected hardware if [ "$DRI_DEVICES_FOUND" = true ]; then + # Detect Intel/AMD GPU model + if command -v lspci >/dev/null 2>&1; then + GPU_INFO=$(lspci -nn | grep -i "VGA\|Display" | head -1) + if [ -n "$GPU_INFO" ]; then + echo "🔍 Detected GPU: $GPU_INFO" + # Extract model for cleaner display in summary + GPU_MODEL=$(echo "$GPU_INFO" | sed -E 's/.*: (.*) \[.*/\1/' | sed 's/Corporation //' | sed 's/Technologies //') + fi + fi + if [ -n "$LIBVA_DRIVER_NAME" ]; then echo "â„šī¸ LIBVA_DRIVER_NAME is set to '$LIBVA_DRIVER_NAME'" else @@ -180,6 +190,15 @@ if [ "$DRI_DEVICES_FOUND" = true ]; then fi if [ "$NVIDIA_FOUND" = true ]; then + # Try to get NVIDIA GPU model info + if command -v nvidia-smi >/dev/null 2>&1; then + NVIDIA_MODEL=$(nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null | head -1) + if [ -n "$NVIDIA_MODEL" ]; then + echo "🔍 Detected NVIDIA GPU: $NVIDIA_MODEL" + GPU_MODEL=$NVIDIA_MODEL + fi + fi + if [ -n "$NVIDIA_VISIBLE_DEVICES" ]; then echo "â„šī¸ NVIDIA_VISIBLE_DEVICES is set to '$NVIDIA_VISIBLE_DEVICES'" else @@ -227,8 +246,10 @@ if [ "$NVIDIA_FOUND" = true ] && (nvidia-smi >/dev/null 2>&1 || [ -n "$NVIDIA_VI echo "âš ī¸ FFmpeg NVIDIA acceleration: NOT DETECTED" fi elif [ "$DRI_DEVICES_FOUND" = true ]; then - # Intel/AMD detection - if [ -n "$LIBVA_DRIVER_NAME" ]; then + # Intel/AMD detection with model if available + if [ -n "$GPU_MODEL" ]; then + echo "🔰 GPU: $GPU_MODEL" + elif [ -n "$LIBVA_DRIVER_NAME" ]; then echo "🔰 ${LIBVA_DRIVER_NAME^^} GPU: ACTIVE" else echo "🔰 INTEL/AMD GPU: ACTIVE"