-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(//docker): Adding CUDA11 based container for Ampere support
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
- Loading branch information
1 parent
cc32c22
commit 970d775
Showing
4 changed files
with
131 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM nvcr.io/nvidia/pytorch:20.07-py3 | ||
|
||
RUN apt-get update && apt-get install curl gnupg && rm -rf /var/lib/apt/lists/* | ||
|
||
RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add - && \ | ||
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list | ||
|
||
RUN apt-get update && apt-get install bazel-3.4.1 && rm -rf /var/lib/apt/lists/* | ||
RUN ln -s /usr/bin/bazel-3.4.1 /usr/bin/bazel | ||
|
||
RUN pip install notebook | ||
|
||
COPY . /workspace/TRTorch | ||
RUN rm /workspace/TRTorch/WORKSPACE | ||
COPY ./docker/WORKSPACE.cu11.docker /workspace/TRTorch/WORKSPACE | ||
|
||
WORKDIR /workspace/TRTorch | ||
RUN bazel build //:libtrtorch --compilation_mode opt | ||
|
||
WORKDIR /workspace/TRTorch/py | ||
|
||
# Locale is not set by default | ||
RUN apt-get update && apt-get install -y locales ninja-build && rm -rf /var/lib/apt/lists/* && locale-gen en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
RUN python3 setup.py install --use-cxx11-abi | ||
|
||
RUN conda init bash | ||
|
||
WORKDIR /workspace/TRTorch/notebooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
workspace(name = "TRTorch") | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") | ||
|
||
git_repository( | ||
name = "rules_python", | ||
remote = "https://github.com/bazelbuild/rules_python.git", | ||
commit = "4fcc24fd8a850bdab2ef2e078b1de337eea751a6", | ||
shallow_since = "1589292086 -0400" | ||
) | ||
|
||
load("@rules_python//python:repositories.bzl", "py_repositories") | ||
py_repositories() | ||
|
||
load("@rules_python//python:pip.bzl", "pip_repositories", "pip3_import") | ||
pip_repositories() | ||
|
||
http_archive( | ||
name = "rules_pkg", | ||
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz", | ||
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a", | ||
) | ||
|
||
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") | ||
rules_pkg_dependencies() | ||
|
||
git_repository( | ||
name = "googletest", | ||
remote = "https://github.com/google/googletest", | ||
commit = "703bd9caab50b139428cea1aaff9974ebee5742e", | ||
shallow_since = "1570114335 -0400" | ||
) | ||
|
||
# CUDA should be installed on the system locally | ||
new_local_repository( | ||
name = "cuda", | ||
path = "/usr/local/cuda-11.0/", | ||
build_file = "@//third_party/cuda:BUILD", | ||
) | ||
|
||
new_local_repository( | ||
name = "cublas", | ||
path = "/usr", | ||
build_file = "@//third_party/cublas:BUILD", | ||
) | ||
|
||
#################################################################################### | ||
# Locally installed dependencies (use in cases of custom dependencies or aarch64) | ||
#################################################################################### | ||
|
||
new_local_repository( | ||
name = "libtorch", | ||
path = "/opt/conda/lib/python3.6/site-packages/torch", | ||
build_file = "third_party/libtorch/BUILD" | ||
) | ||
|
||
new_local_repository( | ||
name = "libtorch_pre_cxx11_abi", | ||
path = "/opt/conda/lib/python3.6/site-packages/torch", | ||
build_file = "third_party/libtorch/BUILD" | ||
) | ||
|
||
new_local_repository( | ||
name = "cudnn", | ||
path = "/usr/", | ||
build_file = "@//third_party/cudnn/local:BUILD" | ||
) | ||
|
||
new_local_repository( | ||
name = "tensorrt", | ||
path = "/usr/", | ||
build_file = "@//third_party/tensorrt/local:BUILD" | ||
) | ||
|
||
######################################################################### | ||
# Testing Dependencies (optional - comment out on aarch64) | ||
######################################################################### | ||
pip3_import( | ||
name = "trtorch_py_deps", | ||
requirements = "//py:requirements.txt" | ||
) | ||
|
||
load("@trtorch_py_deps//:requirements.bzl", "pip_install") | ||
pip_install() | ||
|
||
pip3_import( | ||
name = "py_test_deps", | ||
requirements = "//tests/py:requirements.txt" | ||
) | ||
|
||
load("@py_test_deps//:requirements.bzl", "pip_install") | ||
pip_install() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters