Skip to content

Commit 7024bf2

Browse files
committed
changes for DLFW for l4t target and removal of BUILD files from package
1 parent e5782c7 commit 7024bf2

File tree

2 files changed

+107
-3
lines changed

2 files changed

+107
-3
lines changed

docker/MODULE.bazel.ngc

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,17 @@ git_override(
2424

2525
local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository")
2626

27+
28+
new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
29+
30+
2731
# External dependency for torch_tensorrt if you already have precompiled binaries.
28-
local_repository(
32+
new_local_repository(
2933
name = "torch_tensorrt",
34+
build_file = "@//third_party:BUILD",
3035
path = "/usr/local/lib/python3.12/dist-packages/torch_tensorrt/",
3136
)
3237

33-
new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
34-
3538

3639
# CUDA should be installed on the system locally
3740
new_local_repository(
@@ -55,8 +58,26 @@ new_local_repository(
5558
build_file = "third_party/libtorch/BUILD"
5659
)
5760

61+
new_local_repository(
62+
name = "torch_l4t",
63+
path = "/usr/local/lib/python3.12/dist-packages/torch/",
64+
build_file = "third_party/libtorch/BUILD"
65+
)
66+
5867
new_local_repository(
5968
name = "tensorrt",
6069
path = "/usr/",
6170
build_file = "@//third_party/tensorrt/local:BUILD"
6271
)
72+
73+
new_local_repository(
74+
name = "tensorrt_sbsa",
75+
path = "/usr/",
76+
build_file = "@//third_party/tensorrt/local:BUILD"
77+
)
78+
79+
new_local_repository(
80+
name = "tensorrt_l4t",
81+
path = "/usr/",
82+
build_file = "@//third_party/tensorrt/local:BUILD"
83+
)

third_party/BUILD

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
2+
3+
package(default_visibility = ["//visibility:public"])
4+
5+
load("@rules_cc//cc:defs.bzl", "cc_library")
6+
7+
config_setting(
8+
name = "aarch64_linux",
9+
constraint_values = [
10+
"@platforms//cpu:aarch64",
11+
"@platforms//os:linux",
12+
],
13+
)
14+
15+
config_setting(
16+
name = "windows",
17+
constraint_values = [
18+
"@platforms//os:windows",
19+
],
20+
)
21+
22+
cc_library(
23+
name = "libtorchtrt",
24+
srcs = select({
25+
":windows": [
26+
"lib/x64/torchtrt.dll",
27+
],
28+
"//conditions:default": [
29+
"lib/libtorchtrt.so",
30+
],
31+
}),
32+
hdrs = glob([
33+
"include/**/*.h",
34+
]),
35+
includes = ["include/"],
36+
strip_include_prefix = "include",
37+
)
38+
39+
cc_library(
40+
name = "libtorchtrt_runtime",
41+
srcs = select({
42+
":windows": [
43+
"lib/x64/torchtrt_runtime.dll",
44+
],
45+
"//conditions:default": [
46+
"lib/libtorchtrt_runtime.so",
47+
],
48+
}),
49+
)
50+
51+
cc_library(
52+
name = "libtorchtrt_plugins",
53+
srcs = select({
54+
":windows": [
55+
"lib/x64/torchtrt_plugins.dll",
56+
],
57+
"//conditions:default": [
58+
"lib/libtorchtrt_plugins.so",
59+
],
60+
}),
61+
hdrs = glob([
62+
"include/torch_tensorrt/core/plugins/**/*.h",
63+
]),
64+
includes = ["include/"],
65+
strip_include_prefix = "include",
66+
)
67+
68+
cc_library(
69+
name = "torch_tensorrt_core_hdrs",
70+
hdrs = glob([
71+
"include/torch_tensorrt/core/**/*.h",
72+
]),
73+
includes = ["include/torch_tensorrt/"],
74+
strip_include_prefix = "include/torch_tensorrt",
75+
)
76+
77+
# Alias for ease of use
78+
cc_library(
79+
name = "torch_tensorrt",
80+
deps = [
81+
":libtorchtrt",
82+
],
83+
)

0 commit comments

Comments
 (0)