Skip to content

Instantly share code, notes, and snippets.

@LukaPrebil
Last active March 20, 2026 07:27
Show Gist options
  • Select an option

  • Save LukaPrebil/590f433b55cfe1bfb1690674c24df05c to your computer and use it in GitHub Desktop.

Select an option

Save LukaPrebil/590f433b55cfe1bfb1690674c24df05c to your computer and use it in GitHub Desktop.
Immich machine learning fix on Ryzen AI 9 370 HX (Radeon 890M, RDNA 3.5, gfx1150)

Immich machine learning fix on Ryzen AI 9 370 HX (Radeon 890M, RDNA 3.5, gfx1150)

Update (2026-03-20): This workaround is no longer needed as of Immich v2.6.0+

Immich v2.6.0 (PR #26178) ships with ROCm 7.2 and replaces the old ROCM ONNX Runtime provider with the MIGraphX backend. ROCm 7.2 natively supports gfx1150/gfx1151 (RDNA 3.5), so the custom Dockerfile and HSA_OVERRIDE_GFX_VERSION hack are no longer necessary. See the v2.6.0+ instructions below.


Legacy workaround (Immich ≤ v2.5.x)

Immich uses ROCm to run GPU accelerated ML (facial recognition, smart search, etc). Versions up to v2.5.x came bundled with ROCm 6.4.3, which does not support RDNA 3.5 GPUs like the 890M. The first version that supports these GPUs is 6.4.4, so here are the steps to take when setting up Immich to be able to run ML models on the GPU.

  1. Make sure that your .env contains HSA_OVERRIDE_GFX_VERSION=11.0.0
  2. You will need to extend the existing immich_machine_learning image and replace the ROCm runtime inside it.
    1. Create a new Dockerfile that looks like this
      FROM ghcr.io/immich-app/immich-machine-learning:v2.5.6-rocm
      
      USER root
      
      # Add the AMD GPU repository for Ubuntu 22.04 (used by the base image)
      # This will provide the latest ROCm packages
      RUN apt-get update && apt-get install -y wget gnupg
      RUN wget -qO - https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add -
      RUN echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/6.4.4/ jammy main" | tee /etc/apt/sources.list.d/rocm.list
      
      # Update package lists and upgrade to the latest ROCm
      # This will overwrite the older ROCm version with the new one
      RUN apt-get update && \
          apt-get install -y --allow-downgrades \
          rocm-hip-sdk \
          rocm-libs && \
          apt-get clean && \
          rm -rf /var/lib/apt/lists/*
      
      # Install onnxruntime-rocm using pip, which is the new standard
      RUN pip install onnxruntime-rocm
    2. Build the image (in the same folder as the Dockerfile): docker build -t immich-machine-learning-custom-rocm .
  3. In your immich docker-compose.yml file, replace the image property of the immich-machine-learning service with the newly built image immich-machine-learning-custom-rocm
  4. Run docker compose up -d to start immich

This will update ROCm to 6.4.4 and pick up the gfx1100 precompiled libraries. You will know that this works if the immich_machine_learning container does not emit an error regarding missing libraries, and the immich_server container emits output like:

[Nest] 7  - 10/05/2025, 4:37:53 PM     LOG [Microservices:MachineLearningRepository] Machine learning server became healthy (http://immich-machine-learning:3003).
[Nest] 7  - 10/05/2025, 4:37:54 PM     LOG [Microservices:PersonService] Detected 2 new faces in asset 9419603f-14b9-4d81-a415-c6eea76d199a

Immich v2.6.0+ (native support)

As of v2.6.0, the official -rocm image uses ROCm 7.2 with the MIGraphX backend, which natively supports gfx1150. No custom image or HSA override needed.

Just use the official image:

image: ghcr.io/immich-app/immich-machine-learning:v2.6.1-rocm

Recommended env vars for MIGraphX performance tuning:

MIGRAPHX_DISABLE_MIOPEN_FUSION=1
MIGRAPHX_DISABLE_SCHEDULE_PASS=1
MIGRAPHX_DISABLE_REDUCE_FUSION=1
MIGRAPHX_ENABLE_HIPRTC_WORKAROUNDS=1

Notes from testing on gfx1150 (Radeon 890M):

  • CLIP (smart search) and face detection/recognition work perfectly on the GPU
  • OCR (PP-OCRv5) has a MIGraphX runtime error on gfx1150 — disable it in Administration → Machine Learning → OCR until upstream fixes it
  • First run is slow (~2 min per model) while MIGraphX compiles for gfx1150 — subsequent runs use the cached compilation
  • HSA_OVERRIDE_GFX_VERSION can be removed entirely — ROCm 7.2 detects gfx1150 natively
@1oh1

1oh1 commented Nov 8, 2025

Copy link
Copy Markdown

Awesome, thank you! What's the performance like running Immich on Ryzen AI 9 370 HX?

@LukaPrebil

Copy link
Copy Markdown
Author

@1oh1 im running it in a linux container (4cpu, 16GB memory) in proxmox, and i cant see any performance issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment