Compare commits

...

3 Commits

Author SHA1 Message Date
d34a4d3647 refactor: move hermes files into ai/hermes/ subdirectory
- ai/Dockerfile -> ai/hermes/Dockerfile
- ai/fix-permissions.sh -> ai/hermes/fix-permissions.sh
- ai/patch_tts_tool.py -> ai/hermes/patch_tts_tool.py
- ai/compose.yml: update hermes build context to ./hermes
- ollama stays at ai/ollama/Dockerfile
2026-05-09 21:50:04 -04:00
ef58155897 feat: add custom ollama image with ROCm 6.1 + gfx906 support
- Add ollama/Dockerfile that builds ollama from source with AMDGPU_TARGETS=gfx906
- Uses ROCm 6.1 (rocm/dev-ubuntu-22.04:6.1.2-complete) for MI50 support
- Builds llama.cpp runner with HIPBLAS for gfx906 architecture
- Updates compose.yml to build from this Dockerfile instead of pulling ollama/ollama:latest
2026-05-09 21:18:37 -04:00
0580603f27 Merge pull request 'fix: add TZ=America/Montreal for correct cron scheduling' (#18) from fix/hermes-timezone-v2 into master
Reviewed-on: #18
2026-05-09 19:54:52 +00:00
5 changed files with 62 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ services:
# - "traefik.http.routers.webui-https.tls.certresolver=njalla"
hermes:
build: ./
build: ./hermes
container_name: hermes
restart: always
# Gateway run enables the internal API server on port 8642
@@ -58,7 +58,10 @@ services:
- ai_backend
ollama:
image: ollama/ollama:latest
build:
context: ./ollama
dockerfile: Dockerfile
image: ollama/ollama:rocm-gfx906
container_name: ollama
privileged: true
tty: true

57
ai/ollama/Dockerfile Normal file
View File

@@ -0,0 +1,57 @@
# ollama-gfx906/Dockerfile
#
# 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.
#
# Build: docker build -t ollama/ollama:rocm-gfx906 .
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 \
&& rm -rf /var/lib/apt/lists/*
ARG OLLAMA_VERSION=v0.13.5
RUN git clone --depth 1 --branch ${OLLAMA_VERSION} https://github.com/ollama/ollama.git /build
WORKDIR /build
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 && \
cmake .. \
-DLLAMA_HIPBLAS=ON \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DAMDGPU_TARGETS=gfx906 \
-DCMAKE_BUILD_TYPE=Release \
-DLLAMA_NATIVE=OFF \
-DLLAMA_BUILD_TESTS=OFF \
-DLLAMA_BUILD_EXAMPLES=OFF \
-DLLAMA_BUILD_SERVER=OFF && \
cmake --build . --config Release -j$(nproc) && \
cmake --install . --prefix /build/dist
ENV CGO_ENABLED=0
RUN go build -trimpath -o dist/ollama .
FROM ubuntu:22.04
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates curl libstdc++6 libgomp1 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /opt/rocm/lib/ /opt/rocm/lib/
COPY --from=builder /opt/rocm/share/ /opt/rocm/share/
COPY --from=builder /build/dist/ollama /usr/bin/ollama
COPY --from=builder /build/dist/lib/ /usr/lib/ollama/
RUN ldconfig
ENV LD_LIBRARY_PATH=/opt/rocm/lib:/usr/lib/ollama
ENV HSA_OVERRIDE_GFX_VERSION=9.0.6
EXPOSE 11434
CMD ["serve"]