imagegenius / docker-immich

Monolithic (Single) Docker Container for Immich
GNU General Public License v3.0
618 stars 28 forks source link

Unraid: Setup for OpenVINO branch #449

Closed ptruka closed 1 month ago

ptruka commented 1 month ago

I have the latest openvino branch running on my unraid machine. Overall it is running very smooth and the iGPU passtrough is working by adding the /dev/dri device. Thanks for the work on this container in the first place!

As I tooked a closer look to the setup of the Hardware Acceleration with OpenVINO I tried to find a way to add the two options

--device-cgroup-rule='c 189:* rmw' -v /dev/bus/usb:/dev/bus/usb

to my running instance. Of cause the volume is easy to add, but I found no hint in the internet on how to set the device-cgroup-rule on the unraid UI. So I think this is simply missing in the docker implementation of Unraid. Therefore I thought it should work with the Compose Plugin.

This is the compose file I create for this test, where all paths and parameters are matching my initial immich instance that was installed via Apps.

services:
  immichdc:
    image: ghcr.io/imagegenius/immich:openvino
    container_name: immichdc
    networks:
      - bridge
    cpuset: "1,2,3"
    pids_limit: 2048
    environment:
      TZ: "Europe/Berlin"
      HOST_OS: "Unraid"
      HOST_HOSTNAME: "myhostname"
      HOST_CONTAINERNAME: "immich"
      DB_HOSTNAME: "192.168.50.9"
      DB_USERNAME: "postgres"
      DB_PASSWORD: "***"
      DB_DATABASE_NAME: "immich"
      DB_PORT: "5433"
      REDIS_HOSTNAME: "192.168.50.9"
      REDIS_PORT: "6379"
      REDIS_PASSWORD: ""
      MACHINE_LEARNING_HOST: "0.0.0.0"
      MACHINE_LEARNING_PORT: "3003"
      MACHINE_LEARNING_WORKERS: "1"
      MACHINE_LEARNING_WORKER_TIMEOUT: "120"
      PUID: "99"
      PGID: "100"
      UMASK: "022"
    labels:
      - "net.unraid.docker.webui=http://[IP]:[PORT:8080]"
      - "net.unraid.docker.icon=https://raw.githubusercontent.com/imagegenius/templates/main/unraid/img/immich.png"
    ports:
      - "2283:8080"
    volumes:
      - /mnt/user/photos/immich/:/photos:rw
      - /mnt/user/photos/albums/:/libraries:rw
      - /mnt/user/appdata/immich/:/config:rw
      - /dev/bus/usb:/dev/bus/usb:rw
    devices:
      - /dev/dri
    device_cgroup_rules:
      - 'c 189:* rmw'

networks:
  bridge:
    driver: bridge

After I stopped my "main" immich container and ran the docker compose file (UP) everything started up without any errors.

I got 2 questions:

  1. Is there a way I haven't been able to find to add the cgroup rule via the unraid ui?
  2. How can I verify that openvino is working in the container?
martabal commented 1 month ago

Is there a way I haven't been able to find to add the cgroup rule via the unraid ui?

Add that argument to Extra Parameters

How can I verify that openvino is working in the container?

You can use the Gpu statistics plugin to Check your gpu usage

ptruka commented 1 month ago

Is there a way I haven't been able to find to add the cgroup rule via the unraid ui?

Add that argument to Extra Parameters

Ahh, thank you very much!

How can I verify that openvino is working in the container?

You can use the Gpu statistics plugin to Check your gpu usage

Yes, the GPU stats are showing some activities. But this was already the case when only the iGPU (/dev/dri) was added. As I see no errors concerning openvino in the docker logs, I guess it is working.

thanks for your response!