Skip to content

Commit efe66fb

Browse files
committed
bazel file for NGC docker container
1 parent 3e8d735 commit efe66fb

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

docker/MODULE.bazel.ngc

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
module(
2+
name = "torch_tensorrt",
3+
version = "2.5.0a0",
4+
repo_name = "org_pytorch_tensorrt",
5+
)
6+
7+
bazel_dep(name = "googletest", version = "1.14.0")
8+
bazel_dep(name = "platforms", version = "0.0.10")
9+
bazel_dep(name = "rules_cc", version = "0.0.9")
10+
bazel_dep(name = "rules_python", version = "0.34.0")
11+
12+
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
13+
python.toolchain(
14+
ignore_root_user_error = True,
15+
python_version = "3.11",
16+
)
17+
18+
bazel_dep(name = "rules_pkg", version = "1.0.1")
19+
git_override(
20+
module_name = "rules_pkg",
21+
commit = "17c57f4",
22+
remote = "https://github.com/narendasan/rules_pkg",
23+
)
24+
25+
local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository")
26+
27+
new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
28+
29+
30+
# CUDA should be installed on the system locally
31+
new_local_repository(
32+
name = "cuda",
33+
build_file = "@//third_party/cuda:BUILD",
34+
path = "/usr/local/cuda/",
35+
)
36+
37+
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
38+
39+
40+
####################################################################################
41+
# Locally installed dependencies (use in cases of custom dependencies or aarch64)
42+
####################################################################################
43+
44+
# NOTE: In the case you are using just the pre-cxx11-abi path or just the cxx11 abi path
45+
# with your local libtorch, just point deps at the same path to satisfy bazel.
46+
47+
# NOTE: NVIDIA's aarch64 PyTorch (python) wheel file uses the CXX11 ABI unlike PyTorch's standard
48+
# x86_64 python distribution. If using NVIDIA's version just point to the root of the package
49+
# for both versions here and do not use --config=pre-cxx11-abi
50+
51+
new_local_repository(
52+
name = "libtorch",
53+
path = "/usr/local/lib/python3.10/dist-packages/torch/",
54+
build_file = "third_party/libtorch/BUILD"
55+
)
56+
57+
new_local_repository(
58+
name = "libtorch_pre_cxx11_abi",
59+
path = "/usr/local/lib/python3.10/dist-packages/torch/",
60+
build_file = "third_party/libtorch/BUILD"
61+
)
62+
63+
new_local_repository(
64+
name = "tensorrt",
65+
path = "/usr/",
66+
build_file = "@//third_party/tensorrt/local:BUILD"
67+
)

0 commit comments

Comments
 (0)