@@ -79,12 +79,13 @@ def load_dep_info():
79
79
dir_path = os .path .join (str (get_root_dir ()), "py" )
80
80
81
81
PRE_CXX11_ABI = False
82
- JETPACK_VERSION = None
82
+ IS_JETPACK = False
83
83
PY_ONLY = False
84
84
NO_TS = False
85
85
LEGACY = False
86
86
RELEASE = False
87
87
CI_BUILD = False
88
+ IS_SBSA = False
88
89
89
90
if "--fx-only" in sys .argv :
90
91
PY_ONLY = True
@@ -136,40 +137,12 @@ def load_dep_info():
136
137
if ci_env_var == "1" :
137
138
CI_BUILD = True
138
139
139
- if "--use-pre-cxx11-abi" in sys .argv :
140
- sys .argv .remove ("--use-pre-cxx11-abi" )
141
- PRE_CXX11_ABI = True
142
-
143
- if (pre_cxx11_abi_env_var := os .environ .get ("USE_PRE_CXX11_ABI" )) is not None :
144
- if pre_cxx11_abi_env_var == "1" :
145
- PRE_CXX11_ABI = True
146
-
147
140
if platform .uname ().processor == "aarch64" :
148
- if "--jetpack-version" in sys .argv :
149
- version_idx = sys .argv .index ("--jetpack-version" ) + 1
150
- version = sys .argv [version_idx ]
151
- sys .argv .remove (version )
152
- sys .argv .remove ("--jetpack-version" )
153
- if version == "4.5" :
154
- JETPACK_VERSION = "4.5"
155
- elif version == "4.6" :
156
- JETPACK_VERSION = "4.6"
157
- elif version == "5.0" :
158
- JETPACK_VERSION = "5.0"
159
- elif version == "6.1" :
160
- JETPACK_VERSION = "6.1"
161
-
162
- if not JETPACK_VERSION :
163
- warnings .warn (
164
- "Assuming jetpack version to be 6.1, if not use the --jetpack-version option"
165
- )
166
- JETPACK_VERSION = "6.1"
167
-
168
- if PRE_CXX11_ABI :
169
- warnings .warn (
170
- "Jetson platform detected. Please remove --use-pre-cxx11-abi flag if you are using it."
171
- )
172
-
141
+ if "--jetpack" in sys .argv :
142
+ sys .argv .remove ("--jetpack" )
143
+ IS_JETPACK = True
144
+ else :
145
+ IS_SBSA = True
173
146
174
147
BAZEL_EXE = None
175
148
if not PY_ONLY :
@@ -204,30 +177,13 @@ def build_libtorchtrt_cxx11_abi(
204
177
if target_python :
205
178
cmd .append ("--config=python" )
206
179
207
- if pre_cxx11_abi :
208
- cmd .append ("--config=pre_cxx11_abi" )
209
- print ("using PRE CXX11 ABI build" )
210
- else :
211
- cmd .append ("--config=cxx11_abi" )
212
- print ("using CXX11 ABI build" )
213
-
214
180
if IS_WINDOWS :
215
181
cmd .append ("--config=windows" )
216
182
else :
217
183
cmd .append ("--config=linux" )
218
184
219
- if JETPACK_VERSION == "4.5" :
220
- cmd .append ("--platforms=//toolchains:jetpack_4.5" )
221
- print ("Jetpack version: 4.5" )
222
- elif JETPACK_VERSION == "4.6" :
223
- cmd .append ("--platforms=//toolchains:jetpack_4.6" )
224
- print ("Jetpack version: 4.6" )
225
- elif JETPACK_VERSION == "5.0" :
226
- cmd .append ("--platforms=//toolchains:jetpack_5.0" )
227
- print ("Jetpack version: 5.0" )
228
- elif JETPACK_VERSION == "6.1" :
229
- cmd .append ("--platforms=//toolchains:jetpack_6.1" )
230
- print ("Jetpack version: 6.1" )
185
+ if IS_JETPACK :
186
+ cmd .append ("--config=jetpack" )
231
187
232
188
if CI_BUILD :
233
189
cmd .append ("--platforms=//toolchains:ci_rhel_x86_64_linux" )
@@ -497,17 +453,52 @@ def run(self):
497
453
package_data = {}
498
454
499
455
if not (PY_ONLY or NO_TS ):
500
- tensorrt_linux_external_dir = (
456
+ tensorrt_windows_external_dir = (
457
+ lambda : subprocess .check_output (
458
+ [BAZEL_EXE , "query" , "@tensorrt_win//:nvinfer" , "--output" , "location" ]
459
+ )
460
+ .decode ("ascii" )
461
+ .strip ()
462
+ .split ("/BUILD.bazel" )[0 ]
463
+ )
464
+
465
+ tensorrt_x86_64_external_dir = (
501
466
lambda : subprocess .check_output (
502
467
[BAZEL_EXE , "query" , "@tensorrt//:nvinfer" , "--output" , "location" ]
503
468
)
504
469
.decode ("ascii" )
505
470
.strip ()
506
471
.split ("/BUILD.bazel" )[0 ]
507
472
)
473
+
474
+ tensorrt_sbsa_external_dir = (
475
+ lambda : subprocess .check_output (
476
+ [BAZEL_EXE , "query" , "@tensorrt_sbsa//:nvinfer" , "--output" , "location" ]
477
+ )
478
+ .decode ("ascii" )
479
+ .strip ()
480
+ .split ("/BUILD.bazel" )[0 ]
481
+ )
482
+
483
+ tensorrt_jetpack_external_dir = (
484
+ lambda : subprocess .check_output (
485
+ [BAZEL_EXE , "query" , "@tensorrt_l4t//:nvinfer" , "--output" , "location" ]
486
+ )
487
+ .decode ("ascii" )
488
+ .strip ()
489
+ .split ("/BUILD.bazel" )[0 ]
490
+ )
491
+
492
+ if IS_SBSA :
493
+ tensorrt_linux_external_dir = tensorrt_sbsa_external_dir ()
494
+ elif IS_JETPACK :
495
+ tensorrt_linux_external_dir = tensorrt_jetpack_external_dir ()
496
+ else :
497
+ tensorrt_linux_external_dir = tensorrt_x86_64_external_dir ()
498
+
508
499
tensorrt_windows_external_dir = (
509
500
lambda : subprocess .check_output (
510
- [BAZEL_EXE , "query" , "@tensorrt_win //:nvinfer" , "--output" , "location" ]
501
+ [BAZEL_EXE , "query" , "@tensorrt_windows //:nvinfer" , "--output" , "location" ]
511
502
)
512
503
.decode ("ascii" )
513
504
.strip ()
0 commit comments