mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-03-12 17:05:38 +00:00

1. Allow TPU and GPU support at the same time. 2. Add Dockerfile to run example with [Coral USB](https://coral.ai/products/accelerator/).
38 lines
1.1 KiB
Docker
38 lines
1.1 KiB
Docker
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
FROM ubuntu:20.04 AS base
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# hadolint ignore=DL3008
|
|
RUN apt-get update && apt-get install -y \
|
|
cmake build-essential git curl gnupg --no-install-recommends && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# hadolint ignore=DL3008,DL4006
|
|
RUN echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | tee /etc/apt/sources.list.d/coral-edgetpu.list && \
|
|
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
|
|
apt-get update && apt-get install -y libedgetpu1-std --no-install-recommends && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /home/wamr
|
|
|
|
COPY . .
|
|
|
|
WORKDIR /home/wamr/product-mini/platforms/linux/build
|
|
|
|
RUN cmake \
|
|
-DWAMR_BUILD_WASI_NN=1 \
|
|
-DWAMR_BUILD_WASI_NN_ENABLE_EXTERNAL_DELEGATE=1 \
|
|
-DWAMR_BUILD_WASI_NN_EXTERNAL_DELEGATE_PATH="libedgetpu.so.1.0" \
|
|
-DWAMR_BUILD_WASI_NN_ENABLE_GPU=1 \
|
|
..
|
|
|
|
RUN make -j "$(grep -c ^processor /proc/cpuinfo)" && \
|
|
cp /home/wamr/product-mini/platforms/linux/build/iwasm /iwasm
|
|
|
|
WORKDIR /assets
|
|
|
|
ENTRYPOINT [ "/iwasm" ]
|