-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile.amd64_gpu_onnxruntime1.7.1_cuda11.1
59 lines (46 loc) · 2.17 KB
/
Dockerfile.amd64_gpu_onnxruntime1.7.1_cuda11.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM c3sr/base:amd64-gpu-go1.15-cuda11.1-latest
MAINTAINER Yen-Hsiang Chang <[email protected]>
# Build-time metadata as defined at http://label-schema.org
ARG BUILD_DATE
ARG VCS_REF
ARG VCS_URL
ARG VERSION
ARG ARCH
ARG ONNXRUNTIME_VERSION
LABEL org.carml.go-onnxruntime.build-date=$BUILD_DATE \
org.carml.go-onnxruntime.name="go-onnxruntime bindings for go" \
org.carml.go-onnxruntime.description="" \
org.carml.go-onnxruntime.url="https://www.mlmodelscope.org/" \
org.carml.go-onnxruntime.vcs-ref=$VCS_REF \
org.carml.go-onnxruntime.vcs-url=$VCS_URL \
org.carml.go-onnxruntime.vendor="MLModelScope" \
org.carml.go-onnxruntime.arch=$ARCH \
org.carml.go-onnxruntime.version=$VERSION \
org.carml.go-onnxruntime.framework_version=$ONNXRUNTIME_VERSION \
org.carml.go-onnxruntime.schema-version="1.0"
########## DEPENDENCIES INSTALLATION ###################
RUN apt update && apt install -y --no-install-recommends \
gcc-8 \
g++-8 \
&& \
rm -rf /var/lib/apt/lists/* && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8 && \
gcc --version && \
g++ --version
########## LIBRARY INSTALLATION ###################
WORKDIR /
# SOURCE INSTALLATION
ARG BRANCH=v${ONNXRUNTIME_VERSION}
RUN git clone --depth=1 --recurse-submodules --branch=${BRANCH} https://github.com/microsoft/onnxruntime.git && cd onnxruntime && \
git submodule update --init && \
./build.sh --cuda_home /usr/local/cuda --cudnn_home /usr/lib/x86_64-linux-gnu/ --use_cuda --config Release --build_shared_lib --parallel --cmake_extra_defines CMAKE_INSTALL_PREFIX=${FRAMEWORKS_DIR}/onnxruntime/ --update --build && \
cd build/Linux/Release && \
make install
RUN rm -fr onnxruntime
ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${FRAMEWORKS_DIR}/onnxruntime/lib
ENV LIBRARY_PATH ${LIBRARY_PATH}:${FRAMEWORKS_DIR}/onnxruntime/lib
########## GO BINDING INSTALLATION ###################
ENV PKG github.com/c3sr/go-onnxruntime
WORKDIR /c3sr/go-onnxruntime
RUN git clone --depth=1 --branch=master https://${PKG}.git .
RUN go install -a -installsuffix cgo -ldflags "-s -w -X ${PKG}/Version=${VERSION} -X ${PKG}/GitCommit=${VCS_REF} -X ${PKG}/BuildDate=${BUILD_DATE}"