Skip to content

Commit

Permalink
container/ramalama: build it with kompute backend
Browse files Browse the repository at this point in the history
Install Vulkan dependencies in the container and build llama.cpp
with GGML_KOMPUTE=1 to enable the kompute backend. This enables
users with a Vulkan-capable GPU to optionally offload part of the
workload to it.

Signed-off-by: Sergio Lopez <[email protected]>
  • Loading branch information
slp committed Oct 9, 2024
1 parent 6f7dccb commit 96a0efb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions container-images/cpuonly/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ ARG HUGGINGFACE_HUB_VERSION=0.25.2
ARG OMLMD_VERSION=0.1.5
# renovate: datasource=github-releases depName=tqdm/tqdm extractVersion=^v(?<version>.*)
ARG TQDM_VERSION=4.66.5
ARG LLAMA_CPP_SHA=70392f1f81470607ba3afef04aa56c9f65587664
ARG LLAMA_CPP_SHA=2a24c8caa6d10a7263ca317fa7cb64f0edc72aae
# renovate: datasource=git-refs depName=ggerganov/whisper.cpp packageName=https://github.com/ggerganov/whisper.cpp gitRef=master versioning=loose type=digest
ARG WHISPER_CPP_SHA=5caa19240d55bfd6ee316d50fbad32c6e9c39528

# vulkan-headers vulkan-loader-devel vulkan-tools glslc glslang python3-pip mesa-libOpenCL-$MESA_VER.aarch64
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
crb enable && \
dnf install -y epel-release && \
dnf --enablerepo=ubi-9-appstream-rpms install -y git procps-ng vim \
dnf-plugins-core python3-dnf-plugin-versionlock cmake gcc-c++ \
RUN dnf install -y git procps-ng vim dnf-plugins-core cmake gcc-c++ \
python3-pip python3-argcomplete && \
dnf copr enable -y slp/mesa-krunkit epel-9-$(uname -m) && \
dnf install -y mesa-vulkan-drivers-23.3.3-102.el9 \
vulkan-headers vulkan-loader-devel vulkan-tools spirv-tools glslc && \
dnf clean all && \
rm -rf /var/cache/*dnf*

Expand All @@ -26,11 +24,13 @@ RUN pip install "omlmd==${OMLMD_VERSION}"
RUN pip install "tqdm==${TQDM_VERSION}"

ENV GGML_CCACHE=0
ENV GGML_KOMPUTE=1

RUN git clone https://github.com/ggerganov/llama.cpp && \
cd llama.cpp && \
git reset --hard ${LLAMA_CPP_SHA} && \
cmake -B build -DCMAKE_INSTALL_PREFIX:PATH=/usr -DGGML_CCACHE=0 && \
git submodule init && git submodule update && \
cmake -B build -DCMAKE_INSTALL_PREFIX:PATH=/usr -DGGML_KOMPUTE=1 -DGGML_CCACHE=0 && \
cmake --build build --config Release -j $(nproc) && \
cmake --install build && \
cd / && \
Expand Down

0 comments on commit 96a0efb

Please sign in to comment.