From a6b540737fa60acc9cd82c33e1fd1d21dd152a55 Mon Sep 17 00:00:00 2001 From: cryptk <421501+cryptk@users.noreply.github.com> Date: Thu, 14 Mar 2024 02:40:37 -0500 Subject: [PATCH] fix: missing OpenCL libraries from docker containers during clblas docker build (#1830) --- .dockerignore | 1 + Dockerfile | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/.dockerignore b/.dockerignore index cf963888..979a26a3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,3 +3,4 @@ models examples/chatbot-ui/models examples/rwkv/models examples/**/models +Dockerfile \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index fd365962..d9354e6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -105,6 +105,13 @@ COPY . . COPY .git . RUN make prepare +# If we are building with clblas support, we need the libraries for the builds +RUN if [ "${BUILD_TYPE}" = "clblas" ]; then \ + apt-get update && \ + apt-get install -y libclblast-dev && \ + apt-get clean \ + ; fi + # stablediffusion does not tolerate a newer version of abseil, build it first RUN GRPC_BACKENDS=backend-assets/grpc/stablediffusion make build @@ -148,6 +155,13 @@ RUN if [ "${FFMPEG}" = "true" ]; then \ apt-get install -y ffmpeg && apt-get clean \ ; fi +# Add OpenCL +RUN if [ "${BUILD_TYPE}" = "clblas" ]; then \ + apt-get update && \ + apt-get install -y libclblast1 && \ + apt-get clean \ + ; fi + WORKDIR /build # we start fresh & re-copy all assets because `make build` does not clean up nicely after itself