Fix CUDA driver linking in llama.cpp image

This commit is contained in:
Mikei386
2026-08-21 13:38:28 +02:00
parent d754d35229
commit db6e93296d
+7
View File
@@ -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"