Dockerfile.nvidia-gpu 990 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright (C) 2019 Intel Corporation. All rights reserved.
  2. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  3. FROM ubuntu:20.04 AS base
  4. ENV DEBIAN_FRONTEND=noninteractive
  5. RUN apt-get update && apt-get install -y \
  6. cmake build-essential git
  7. WORKDIR /home/wamr
  8. COPY . .
  9. WORKDIR /home/wamr/core/iwasm/libraries/wasi-nn/test/build
  10. RUN cmake \
  11. -DWAMR_BUILD_WASI_NN=1 \
  12. -DWASI_NN_ENABLE_GPU=1 \
  13. ..
  14. RUN make -j $(grep -c ^processor /proc/cpuinfo)
  15. FROM nvidia/cuda:11.3.0-runtime-ubuntu20.04
  16. RUN apt-get update && apt-get install -y --no-install-recommends \
  17. ocl-icd-libopencl1 \
  18. ocl-icd-opencl-dev \
  19. clinfo && \
  20. rm -rf /var/lib/apt/lists/*
  21. RUN mkdir -p /etc/OpenCL/vendors && \
  22. echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
  23. ENV NVIDIA_VISIBLE_DEVICES=all
  24. ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
  25. COPY --from=base /home/wamr/core/iwasm/libraries/wasi-nn/test/build/iwasm /run/iwasm
  26. ENTRYPOINT [ "/run/iwasm" ]