From 702663423ccd45605e0ff0e0ea6411201d61a9ac Mon Sep 17 00:00:00 2001 From: Stephen von Takach Date: Thu, 23 May 2024 13:30:47 +1000 Subject: [PATCH] fix(Dockerfile): include opencl lib for GPU support --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 008b10f..4cbbedb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,11 +56,13 @@ ARG TARGETPLATFORM RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ make libedgetpu-direct CPU=k8 && \ mkdir -p /usr/local/lib && \ - cp /tensorflow/libedgetpu/out/direct/k8/libedgetpu.so.1.0 /usr/local/lib/libedgetpu.so; \ + cp /tensorflow/libedgetpu/out/direct/k8/libedgetpu.so.1.0 /usr/local/lib/libedgetpu.so && \ + cp /usr/lib/x86_64-linux-gnu/libOpenCL.so /usr/local/lib/libOpenCL.so; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ make libedgetpu-direct CPU=aarch64 && \ mkdir -p /usr/local/lib && \ - cp /tensorflow/libedgetpu/out/direct/aarch64/libedgetpu.so.1.0 /usr/local/lib/libedgetpu.so; \ + cp /tensorflow/libedgetpu/out/direct/aarch64/libedgetpu.so.1.0 /usr/local/lib/libedgetpu.so && \ + cp /usr/lib/aarch64-linux-gnu/libOpenCL.so /usr/local/lib/libOpenCL.so; \ else \ echo "Unknown platform"; \ exit 1; \ @@ -128,3 +130,6 @@ FROM scratch COPY --from=build /usr/local/lib/libedgetpu.so /usr/local/lib/libedgetpu.so COPY --from=build /usr/local/lib/libtensorflowlite_c.so /usr/local/lib/libtensorflowlite_c.so COPY --from=build /usr/local/lib/libtensorflowlite_gpu_delegate.so /usr/local/lib/libtensorflowlite_gpu_delegate.so + +# copy the opencl lib +COPY --from=build /usr/local/lib/libOpenCL.so /usr/local/lib/libOpenCL.so