From 96a0efbbda276d9af5a6a7ba5bb931b6cd6c81a9 Mon Sep 17 00:00:00 2001 From: Sergio Lopez Date: Wed, 9 Oct 2024 15:27:41 +0200 Subject: [PATCH] container/ramalama: build it with kompute backend 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 --- container-images/cpuonly/Containerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/container-images/cpuonly/Containerfile b/container-images/cpuonly/Containerfile index 48e18ecf..1b355943 100644 --- a/container-images/cpuonly/Containerfile +++ b/container-images/cpuonly/Containerfile @@ -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(?.*) 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* @@ -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 / && \