From f023dc1ee415c3440f09a3be89662e53ef10da51 Mon Sep 17 00:00:00 2001 From: Hermes Date: Sat, 9 May 2026 21:56:14 -0400 Subject: [PATCH] fix: update ollama Dockerfile to v0.23.2 with proper ROCm 6.1 + gfx906 build - Update OLLAMA_VERSION from v0.13.5 to v0.23.2 - Fix package: golang -> golang-go - Add ENV HCC_AMDGPU_TARGET=gfx906 and HSA_ENABLE_SDMA=0 - Set proper ENTRYPOINT + CMD --- ai/ollama/Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ai/ollama/Dockerfile b/ai/ollama/Dockerfile index aca5f3a..88cc8b3 100644 --- a/ai/ollama/Dockerfile +++ b/ai/ollama/Dockerfile @@ -2,17 +2,17 @@ # # Custom ollama image with ROCm 6.1 + gfx906 (MI50) support. # The default ollama/rocm image ships ROCm 7.2 which dropped gfx906 support. -# This builds ollama from source targeting AMDGPU_TARGETS=gfx906. +# This builds ollama and its llama.cpp runner from source, targeting gfx906. # -# Build: docker build -t ollama/ollama:rocm-gfx906 . +# Build: docker build -t ollama/ollama:rocm-gfx906 ./ai/ollama FROM rocm/dev-ubuntu-22.04:6.1.2-complete AS builder RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - git golang cmake build-essential pkg-config \ + git golang-go cmake build-essential pkg-config \ && rm -rf /var/lib/apt/lists/* -ARG OLLAMA_VERSION=v0.13.5 +ARG OLLAMA_VERSION=v0.23.2 RUN git clone --depth 1 --branch ${OLLAMA_VERSION} https://github.com/ollama/ollama.git /build WORKDIR /build @@ -20,7 +20,7 @@ ENV HIP_PATH=/opt/rocm ENV ROCM_PATH=/opt/rocm ENV PATH=/opt/rocm/bin:/opt/rocm/hip/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUN cd llama.cpp && \ - mkdir build && cd build && \ + mkdir -p build && cd build && \ cmake .. \ -DLLAMA_HIPBLAS=ON \ -DCMAKE_C_COMPILER=clang \ @@ -52,6 +52,9 @@ RUN ldconfig ENV LD_LIBRARY_PATH=/opt/rocm/lib:/usr/lib/ollama ENV HSA_OVERRIDE_GFX_VERSION=9.0.6 +ENV HCC_AMDGPU_TARGET=gfx906 +ENV HSA_ENABLE_SDMA=0 EXPOSE 11434 +ENTRYPOINT ["/bin/ollama"] CMD ["serve"]