-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile.buildonly
54 lines (42 loc) · 2.19 KB
/
Dockerfile.buildonly
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
ARG SERVERBASE=21.06-py3
FROM nvcr.io/nvidia/pytorch:${SERVERBASE} AS builder
ENV FORCE_CUDA=1
ARG LIB_WITH_CUDA=ON
ARG NPROC=4
RUN git clone https://github.com/rusty1s/pytorch_cluster.git
RUN pushd pytorch_cluster &&\
mkdir build && pushd build &&\
cmake -DCMAKE_PREFIX_PATH=/opt/conda/lib/python3.8/site-packages/torch -DWITH_CUDA=${LIB_WITH_CUDA} .. &&\
make -j ${NPROC} && mv *.so /workspace/ && popd &&\
popd
RUN git clone https://github.com/rusty1s/pytorch_scatter.git
RUN pushd pytorch_scatter &&\
mkdir build && pushd build &&\
cmake -DCMAKE_PREFIX_PATH=/opt/conda/lib/python3.8/site-packages/torch -DWITH_CUDA=${LIB_WITH_CUDA} .. &&\
make -j ${NPROC} && mv *.so /workspace/ && popd &&\
popd
RUN git clone https://github.com/rusty1s/pytorch_spline_conv.git
RUN pushd pytorch_spline_conv &&\
mkdir build && pushd build &&\
cmake -DCMAKE_PREFIX_PATH=/opt/conda/lib/python3.8/site-packages/torch -DWITH_CUDA=${LIB_WITH_CUDA} .. &&\
make -j ${NPROC} && mv *.so /workspace/ && popd &&\
popd
RUN git clone https://github.com/rusty1s/pytorch_sparse.git -b 0.6.10
RUN pushd pytorch_sparse &&\
mkdir build && pushd build &&\
cmake -DCMAKE_PREFIX_PATH=/opt/conda/lib/python3.8/site-packages/torch -DWITH_CUDA=${LIB_WITH_CUDA} .. &&\
make -j ${NPROC} && mv *.so /workspace/ && popd &&\
popd
RUN git clone https://github.com/rusty1s/pytorch_geometric.git
RUN pushd pytorch_geometric && pip install -e . && popd
FROM nvcr.io/nvidia/tritonserver:${SERVERBASE}
ENV LD_LIBRARY_PATH="/opt/tritonserver/backends/pytorch:/usr/local/cuda/compat/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64"
ENV LD_PRELOAD="/torch_geometric/lib/libtorchscatter.so /torch_geometric/lib/libtorchsparse.so /torch_geometric/lib/libtorchcluster.so /torch_geometric/lib/libtorchsplineconv.so"
RUN mkdir -p /run/shm
RUN mkdir -p /models
RUN mkdir -p /torch_geometric/lib
RUN mkdir -p /torch_geometric/examples/
COPY --from=builder /workspace/libtorchscatter.so /torch_geometric/lib/
COPY --from=builder /workspace/libtorchsparse.so /torch_geometric/lib/
COPY --from=builder /workspace/libtorchcluster.so /torch_geometric/lib/
COPY --from=builder /workspace/libtorchsplineconv.so /torch_geometric/lib/