File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM nvcr.io/nvidia/pytorch:21.07-py3 as builder
2
+
3
+ RUN apt-get update && apt-get install -y curl gnupg && rm -rf /var/lib/apt/lists/*
4
+
5
+ RUN curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
6
+ RUN mv bazel.gpg /etc/apt/trusted.gpg.d/
7
+ RUN echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
8
+
9
+ RUN apt-get update && apt-get install -y bazel-4.0.0 && rm -rf /var/lib/apt/lists/*
10
+ RUN ln -s /usr/bin/bazel-4.0.0 /usr/bin/bazel
11
+ # Workaround for bazel expecting both static and shared versions, we only use shared libraries inside container
12
+ RUN cp /usr/lib/x86_64-linux-gnu/libnvinfer.so /usr/lib/x86_64-linux-gnu/libnvinfer_static.a
13
+
14
+ RUN pip install notebook
15
+
16
+ FROM builder as trtorch
17
+
18
+ COPY . /opt/trtorch
19
+ RUN rm /opt/trtorch/WORKSPACE
20
+ COPY ./docker/WORKSPACE.cu.docker /opt/trtorch/WORKSPACE
21
+
22
+ WORKDIR /opt/trtorch
23
+ RUN bazel build //:libtrtorch --compilation_mode opt
24
+
25
+ WORKDIR /opt/trtorch/py
26
+
27
+ RUN pip install ipywidgets --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org
28
+ RUN jupyter nbextension enable --py widgetsnbextension
29
+
30
+ # Locale is not set by default
31
+ RUN apt-get update && apt-get install -y locales ninja-build && rm -rf /var/lib/apt/lists/* && locale-gen en_US.UTF-8
32
+ ENV LANG en_US.UTF-8
33
+ ENV LANGUAGE en_US:en
34
+ ENV LC_ALL en_US.UTF-8
35
+ RUN python3 setup.py install --use-cxx11-abi
36
+
37
+ RUN conda init bash
38
+
39
+ ENV LD_LIBRARY_PATH /opt/conda/lib/python3.8/site-packages/torch/lib:$LD_LIBRARY_PATH
40
+
41
+ WORKDIR /opt/trtorch/
42
+ CMD /bin/bash
You can’t perform that action at this time.
0 commit comments