set up immich to work with nvidia gpu

This commit is contained in:
Jef Roosens 2026-04-20 21:56:25 +02:00
parent 4c54a80122
commit fcd36a1035
Signed by: Jef Roosens
GPG key ID: 21FD3D77D56BAF49
5 changed files with 130 additions and 34 deletions

View file

@ -0,0 +1,36 @@
# vim: ft=systemd
[Unit]
Description=Immich machine learning container
After=network.target
[Container]
Environment=IMMICH_VERSION={{ immich_version }}
{% if immich_hw_accel == 'nvidia' %}
Image=ghcr.io/immich-app/immich-machine-learning:{{ immich_version }}-cuda
{% elif immich_hw_accel == 'intel' %}
Image=ghcr.io/immich-app/immich-machine-learning:{{ immich_version }}-openvino
{% else %}
Image=ghcr.io/immich-app/immich-machine-learning:{{ immich_version }}
{% endif %}
Volume={{ immich_model_cache_dir }}:/cache
{% if immich_hw_accel == 'nvidia' %}
# Nvidia GPU access via CDI - requires nvidia-container-toolkit with CDI configured:
# nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
AddDevice=nvidia.com/gpu=all
{% elif immich_hw_accel == 'intel' %}
# Intel GPU and OpenVINO device access
AddDevice=/dev/dri
Volume=/dev/bus/usb:/dev/bus/usb
{% endif %}
PublishPort=0.0.0.0:8028:3003
User=0
[Service]
Restart=always
[Install]
WantedBy=default.target