Skip to content

Commit 6f9c8ab

Browse files
svenchiltoncolossus
authored andcommitted
Modified the Dockerfile to make the demo notebooks visible in the container's working directory.
2 parents cb33cd9 + cdd8b12 commit 6f9c8ab

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

docker/Dockerfile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,20 @@ FROM base as torch-tensorrt-builder-base
88

99
RUN rm -rf /opt/torch-tensorrt /usr/bin/bazel
1010

11-
RUN apt-get update && apt-get install --no-install-recommends -y curl gnupg
12-
RUN curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/bazel.gpg
13-
RUN echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
11+
ARG ARCH="x86_64"
12+
ARG TARGETARCH="amd64"
13+
ARG BAZEL_VERSION=4.0.0
1414

15-
RUN apt-get update && apt-get install -y --no-install-recommends bazel-4.0.0
16-
RUN ln -s /usr/bin/bazel-4.0.0 /usr/bin/bazel
15+
RUN [[ "$TARGETARCH" == "amd64" ]] && ARCH="x86_64" || ARCH="${TARGETARCH}" \
16+
&& wget -q https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-${ARCH} -O /usr/bin/bazel \
17+
&& chmod a+x /usr/bin/bazel
1718

1819
# Workaround for bazel expecting both static and shared versions, we only use shared libraries inside container
19-
RUN cp /usr/lib/x86_64-linux-gnu/libnvinfer.so /usr/lib/x86_64-linux-gnu/libnvinfer_static.a
20+
RUN touch /usr/lib/$HOSTTYPE-linux-gnu/libnvinfer_static.a
21+
22+
RUN rm -rf /usr/local/cuda/lib* /usr/local/cuda/include \
23+
&& ln -sf /usr/local/cuda/targets/$HOSTTYPE-linux/lib /usr/local/cuda/lib64 \
24+
&& ln -sf /usr/local/cuda/targets/$HOSTTYPE-linux/include /usr/local/cuda/include
2025

2126
RUN apt-get update && apt-get install -y --no-install-recommends locales ninja-build && rm -rf /var/lib/apt/lists/* && locale-gen en_US.UTF-8
2227

@@ -47,6 +52,7 @@ ENV PATH /opt/conda/lib/python3.8/site-packages/torch_tensorrt/bin:${PATH}
4752

4853
WORKDIR /workspace
4954
RUN mv /workspace/torch_tensorrt /opt/pytorch/torch_tensorrt
55+
# Make the notebooks visible to Jupyter in the current WORKDIR
5056
RUN mkdir torch_tensorrt
5157
RUN ln -s /opt/pytorch/torch_tensorrt/notebooks /workspace/torch_tensorrt/notebooks
5258

third_party/cuda/BUILD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ cc_library(
1414
"lib/x64/cudart.lib",
1515
],
1616
"//conditions:default": [
17-
"targets/x86_64-linux/lib/libcudart.so",
17+
"lib64/libcudart.so",
1818
],
1919
}),
2020
hdrs = glob([
@@ -32,7 +32,7 @@ cc_library(
3232
"bin/nvToolsExt64_1.dll",
3333
],
3434
"//conditions:default": [
35-
"targets/x86_64-linux/lib/libnvToolsExt.so.1",
35+
"lib64/libnvToolsExt.so.1",
3636
],
3737
}),
3838
)
@@ -44,7 +44,7 @@ cc_library(
4444
"bin/*.dll",
4545
],
4646
"//conditions:default": glob([
47-
"targets/x86_64-linux/lib/**/lib*.so",
47+
"lib64/**/lib*.so",
4848
]),
4949
}),
5050
hdrs = glob([
@@ -63,7 +63,7 @@ cc_library(
6363
"lib/x64/cublas.lib",
6464
]),
6565
"//conditions:default": glob([
66-
"targets/x86_64-linux/lib/**/*libcublas.so",
66+
"lib64/**/*libcublas.so",
6767
]),
6868
}),
6969
hdrs = glob([

0 commit comments

Comments
 (0)