From 10ec03d1e85d9b546d4b5472e1fe6fa610cfc9f9 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 15 Jan 2026 11:33:26 +1300 Subject: [PATCH] Update 3 files --- immich/config/service.env | 11 +++++++++-- immich/docker-compose.yml.template | 3 ++- immich/install.sh | 11 +++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/immich/config/service.env b/immich/config/service.env index b49ba92..6783dda 100644 --- a/immich/config/service.env +++ b/immich/config/service.env @@ -27,6 +27,13 @@ DB_DATABASE_NAME=immich # Example: "/mnt/photos:/photos:ro,/mnt/archive:/archive:ro" EXTERNAL_LIBRARIES="" -# Machine Learning settings -# For GPU acceleration, change to: release-cuda, release-openvino, or release-armnn +# Machine Learning GPU Acceleration +# Options: +# release - CPU only (default) +# release-cuda - NVIDIA GPU +# release-openvino - Intel GPU (Iris Xe, Arc) +# release-armnn - ARM GPU ML_IMAGE_TAG=release + +# Enable GPU device access (set to "true" for openvino or cuda) +ML_GPU_ENABLED=false diff --git a/immich/docker-compose.yml.template b/immich/docker-compose.yml.template index 32b67a5..e495c86 100644 --- a/immich/docker-compose.yml.template +++ b/immich/docker-compose.yml.template @@ -24,7 +24,7 @@ services: immich-machine-learning: container_name: ${CONTAINER_NAME}_machine_learning - image: ghcr.io/immich-app/immich-machine-learning:${ML_IMAGE_TAG:-release} + image: ghcr.io/immich-app/immich-machine-learning:${ML_IMAGE_TAG} volumes: - ${CONTAINER_NAME}_model_cache:/cache environment: @@ -33,6 +33,7 @@ services: - DB_DATABASE_NAME=${DB_DATABASE_NAME} - DB_HOSTNAME=${CONTAINER_NAME}_postgres - REDIS_HOSTNAME=${CONTAINER_NAME}_redis +#GPU_PLACEHOLDER# restart: unless-stopped healthcheck: disable: false diff --git a/immich/install.sh b/immich/install.sh index 58c5ddf..00612e2 100755 --- a/immich/install.sh +++ b/immich/install.sh @@ -9,6 +9,7 @@ _check_required_env_vars "CONTAINER_NAME" "UPLOAD_LOCATION" "DB_DATA_LOCATION" " # Set defaults IMMICH_VERSION="${IMMICH_VERSION:-release}" ML_IMAGE_TAG="${ML_IMAGE_TAG:-release}" +ML_GPU_ENABLED="${ML_GPU_ENABLED:-false}" WEB_PORT="${WEB_PORT:-2283}" DB_USERNAME="${DB_USERNAME:-postgres}" DB_DATABASE_NAME="${DB_DATABASE_NAME:-immich}" @@ -24,6 +25,16 @@ echo "Generating docker-compose.yml..." envsubst < docker-compose.yml.template > docker-compose.yml \ || _die "Failed to generate docker-compose.yml" +# Add GPU configuration if enabled +if [ "$ML_GPU_ENABLED" = "true" ]; then + echo "Enabling GPU acceleration..." + GPU_CONFIG=" devices:\n - /dev/dri:/dev/dri" + sed -i "s|#GPU_PLACEHOLDER#|${GPU_CONFIG}|" docker-compose.yml +else + # Remove the placeholder + sed -i '/#GPU_PLACEHOLDER#/d' docker-compose.yml +fi + # Create data directories _create_folder "${UPLOAD_LOCATION}" _create_folder "${DB_DATA_LOCATION}"