From db6e93296d770f941cbc811fa5a5037c23dc0803 Mon Sep 17 00:00:00 2001 From: Mikei386 <44135113+Mikei386@users.noreply.github.com> Date: Fri, 21 Aug 2026 13:38:28 +0200 Subject: [PATCH] Fix CUDA driver linking in llama.cpp image --- platform/docker/llama-cpp/Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/docker/llama-cpp/Dockerfile b/platform/docker/llama-cpp/Dockerfile index dd8a213..a87a058 100644 --- a/platform/docker/llama-cpp/Dockerfile +++ b/platform/docker/llama-cpp/Dockerfile @@ -8,6 +8,13 @@ ARG CUDA_ARCHITECTURES="86;120" RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates cmake git libcurl4-openssl-dev ninja-build pkg-config && \ rm -rf /var/lib/apt/lists/* +# CUDA's devel image keeps libcuda.so.1 in its compatibility directory, which +# is not part of the default linker search path. llama.cpp's shared CUDA +# backend links successfully without this, but the final server link then +# cannot resolve CUDA driver symbols such as cuMemCreate. Register it for the +# build stage; at runtime the NVIDIA container runtime supplies the host driver. +RUN printf '%s\n' /usr/local/cuda/compat >/etc/ld.so.conf.d/cuda-compat.conf && \ + ldconfig RUN test -n "$LLAMA_CPP_COMMIT" RUN git clone --filter=blob:none https://github.com/ggml-org/llama.cpp /src/llama.cpp && \ git -C /src/llama.cpp checkout "$LLAMA_CPP_COMMIT"