Skip to content

Hardware‐Accelerated Machine Learning

linux-universe edited this page Oct 30, 2025 · 5 revisions

Hardware-Accelerated Machine Learning

Note

This guide is based on the quadlet files in main.

Warning

As I don't have the necessary hardware, I couldn't test the both the CUDA and ROCM instructions. Any confirmation of it working would be appreciated.

ROCM (AMD)

  1. Add -rocm to the end of the Image= line in immich-machine-learning.container.

    - Image=ghcr.io/immich-app/immich-server:${IMMICH_VERSION}
    + Image=ghcr.io/immich-app/immich-server:${IMMICH_VERSION}-rocm
  2. Add the following lines in immich-machine-learning.container under [Container].

    GroupAdd=video
    AddDevice=/dev/dri
    AddDevice=/dev/kfd
    

    You may need to add Environment=HSA_OVERRIDE_GFX_VERSION="x.x.x" depending on your GPU.

CUDA (NVIDIA)

  1. Add -cuda to the end of the Image= line in immich-machine-learning.container.

    - Image=ghcr.io/immich-app/immich-server:${IMMICH_VERSION}
    + Image=ghcr.io/immich-app/immich-server:${IMMICH_VERSION}-cuda
  2. Add the following lines in immich-machine-learning.container under [Container].

    AddDevice=/dev/dri
    # Make sure this matched your GPU ID
    AddDevice=nvidia.com/gpu=0
    Unmask=/dev/dri:/dev/dri
    

thanks to tbelways repo for inspiration

Clone this wiki locally