Alfred's New Ramblings

Let’s give Immich some GPU

Immich uses machine learning to extract info like text and faces from the photos. To aid this, it can use the GPU like any AI.

In the docker compose file, add the following in bold. Note the indentations are sensitive.

immich-machine-learning:
  image: ghcr.io/immich-app/immich-machine-learning:release-openvino
  devices:
    - /dev/dri:/dev/dri

Start the container by

docker compose up -d

Check if /dev/dri is available inside the container

docker exec -it immich_machine_learning ls /dev/dri

There should be

card0
renderD128

I got

by-path
card0

Install the GPU drivers

sudo apt install mesa-utils -y
sudo apt install intel-gpu-tools -y
lspci | grep -i vga

It should return

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630

Check the Docker OpenVINO status

docker exec -it immich_machine_learning python3 -c "import onnxruntime as ort; print(ort.get_available_providers())"

Both of the following should be shown. If it shows CPUExecution Provider only it means GPU support is not available.

['OpenVINOExecutionProvider', 'CPUExecutionProvider']

Immich machine learning is now running on the GPU.




One thought on “Let’s give Immich some GPU

  1. Pingback: New Immich server - Alfred’s New Ramblings

Leave a Reply

Your email address will not be published. Required fields are marked *