From d010ea70d20db9064e9c0c73cab36d611d4d35eb Mon Sep 17 00:00:00 2001 From: Pradyumna Singh Rathore <36568190+pradhyumna85@users.noreply.github.com> Date: Thu, 10 Aug 2023 20:41:34 +0530 Subject: [PATCH] Fixed Cuda Dockerfile Previously models produced garbage output when running on GPU with layers offloaded. Similar to related fix on another repo: https://github.com/noneabove1182/koboldcpp-docker/commit/331326a0e340ac845855d346f730356b000650c7 --- docker/cuda_simple/Dockerfile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/docker/cuda_simple/Dockerfile b/docker/cuda_simple/Dockerfile index e4a2f07..e5aaf17 100644 --- a/docker/cuda_simple/Dockerfile +++ b/docker/cuda_simple/Dockerfile @@ -4,13 +4,24 @@ FROM nvidia/cuda:${CUDA_IMAGE} # We need to set the host to 0.0.0.0 to allow outside access ENV HOST 0.0.0.0 +RUN apt-get update && apt-get upgrade -y \ + && apt-get install -y git build-essential \ + python3 python3-pip gcc wget \ + ocl-icd-opencl-dev opencl-headers clinfo \ + libclblast-dev libopenblas-dev \ + && mkdir -p /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd + COPY . . -# Install the package -RUN apt update && apt install -y python3 python3-pip +# setting build related env vars +ENV CUDA_DOCKER_ARCH=all +ENV LLAMA_CUBLAS=1 + +# Install depencencies RUN python3 -m pip install --upgrade pip pytest cmake scikit-build setuptools fastapi uvicorn sse-starlette pydantic-settings -RUN LLAMA_CUBLAS=1 pip install llama-cpp-python +# Install llama-cpp-python (build with cuda) +RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 pip install llama-cpp-python # Run the server CMD python3 -m llama_cpp.server