File tree Expand file tree Collapse file tree 2 files changed +61
-0
lines changed
Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ ARG OS=ubuntu18.04
2+ ARG CUDA_VER=11.0-cudnn8
3+
4+ FROM nvidia/cuda:11.0-cudnn8-devel-ubuntu18.04
5+
6+ ARG ONNXRUNTIME_REPO=https://github.com/RedisAI/onnxruntime
7+ ARG ONNXRUNTIME_VER=1.6.0
8+ ARG ARCH=x64-gpu
9+
10+ RUN apt-get -qq update
11+ RUN apt-get -qq install -y curl wget tar git
12+ RUN apt-get -qq install -y build-essential
13+ RUN apt-get -qq install -y libcurl4-openssl-dev libssl-dev libatlas-base-dev zlib1g-dev
14+
15+ RUN apt-get -qq install -y python3 python3-pip python3-dev
16+ RUN pip3 install --upgrade pip setuptools wheel
17+ # RUN pip3 install numpy
18+ RUN apt-get -q install -y python3-numpy
19+ RUN apt-get install -y snapd
20+ RUN wget https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2.tar.gz; \
21+ tar -zxvf cmake-3.15.2.tar.gz; \
22+ cd cmake-3.15.2; \
23+ ./bootstrap; \
24+ make -j4; \
25+ make install
26+
27+
28+ ENV LANG=en_US.UTF-8
29+ RUN apt-get install -y locales && \
30+ sed -i -e "s/# $LANG.*/$LANG UTF-8/" /etc/locale.gen && \
31+ dpkg-reconfigure --frontend=noninteractive locales && \
32+ update-locale LANG=$LANG
33+
34+ WORKDIR /build
35+
36+ ADD ./pack.sh /build/
37+ ARG BUILDTYPE=MinSizeRel
38+ ARG BUILDARGS="--config ${BUILDTYPE} --parallel"
39+
40+ RUN git clone --single-branch --branch rel-${ONNXRUNTIME_VER} --recursive ${ONNXRUNTIME_REPO} onnxruntime
41+
42+
43+ RUN cd onnxruntime ;\
44+ ./build.sh ${BUILDARGS} --update --build --use_cuda --cudnn_home /usr/local/cuda --cuda_home /usr/local/cuda --build_shared_lib --parallel
45+ # RUN ./build.sh ${BUILDARGS} --enable_pybind --build_wheel
46+
47+ RUN ./pack.sh ${ONNXRUNTIME_VER} ${ARCH}
Original file line number Diff line number Diff line change @@ -48,6 +48,19 @@ build_x64:
4848.PHONY: build_x64
4949endef
5050
51+ define build_x64-gpu # (1=arch, 2=tar-arch)
52+ IID_$(1 ) =$(1 ) _$(VERSION ) .iid
53+ CID_$(1 ) =$(1 ) _$(VERSION ) .cid
54+
55+ build_x64-gpu:
56+ @docker build --iidfile $$(IID_$(1 ) ) -t redisfab/$(STEM ) -x64:$(VERSION ) -f Dockerfile.x64-gpu \
57+ --build-arg OS=$(DOCKER_OS ) $(ROOT )
58+ @docker create --cidfile $$(CID_$(1 ) ) `cat $$(IID_$(1 ) ) `
59+ @docker cp `cat $$(CID_$(1 ) ) `:/build/$(STEM ) -x64-$(VERSION ) .tgz .
60+
61+ .PHONY: build_x64
62+ endef
63+
5164define build_arm # (1=arch, 2=tar-arch)
5265IID_$(1 ) =$(1 ) _$(VERSION ) .iid
5366CID_$(1 ) =$(1 ) _$(VERSION ) .cid
@@ -97,6 +110,7 @@ all: build publish
97110build : $(BUILD_TARGETS )
98111
99112$(eval $(call build_x64,x64,x86_64))
113+ $(eval $(call build_x64-gpu,x64-gpu,x86_64-gpu))
100114$(eval $(call build_arm,arm64v8,arm64))
101115$(eval $(call build_arm,arm32v7,arm))
102116
You can’t perform that action at this time.
0 commit comments