From fd46b4d1f962c10d42209add3ea6e5c5fe04be27 Mon Sep 17 00:00:00 2001 From: Stephen von Takach Date: Wed, 22 May 2024 18:07:08 +1000 Subject: [PATCH] fix: libedgetpu on arm64 --- Dockerfile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0686542..008b10f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,12 +52,19 @@ RUN git clone https://github.com/google-coral/libedgetpu WORKDIR /tensorflow/libedgetpu # Build TensorFlow Lite GPU delegate (excluding Android, linux only) -RUN make libedgetpu-direct - -# Copy the built shared libraries to /usr/local/lib -RUN mkdir -p /usr/local/lib && \ - cp /tensorflow/libedgetpu/out/direct/k8/libedgetpu.so.1.0 /usr/local/lib/libedgetpu.so - +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; \ + 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; \ + else \ + echo "Unknown platform"; \ + exit 1; \ + fi # ================================== # Build tensorflow lite GPU delegate