File tree 3 files changed +11
-20
lines changed
3 files changed +11
-20
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,5 @@ pybind11==2.6.2
5
5
torch >= 2.8.0.dev ,< 2.9.0
6
6
torchvision >= 0.22.0.dev ,< 0.23.0
7
7
--extra-index-url https://pypi.ngc.nvidia.com
8
- pyyaml
8
+ pyyaml
9
+ dllist
Original file line number Diff line number Diff line change 4
4
from typing import Any
5
5
6
6
import torch
7
- from torch_tensorrt import _find_lib
8
7
9
8
10
9
def sanitized_torch_version () -> Any :
@@ -16,24 +15,13 @@ def sanitized_torch_version() -> Any:
16
15
17
16
18
17
def check_cross_compile_trt_win_lib ():
19
- if sys .platform .startswith ("linux" ):
20
- LINUX_PATHS = ["/usr/local/cuda-12.8/lib64" , "/usr/lib" , "/usr/lib64" ]
21
-
22
- if platform .uname ().processor == "x86_64" :
23
- LINUX_PATHS += [
24
- "/usr/lib/x86_64-linux-gnu" ,
25
- ]
26
- elif platform .uname ().processor == "aarch64" :
27
- LINUX_PATHS += ["/usr/lib/aarch64-linux-gnu" ]
18
+ # cross compile feature is only available on linux
19
+ # build engine on linux and run on windows
20
+ import dllist
28
21
29
- LINUX_LIBS = [
30
- f"libnvinfer_builder_resource_win.so.*" ,
31
- ]
32
-
33
- for lib in LINUX_LIBS :
34
- try :
35
- ctypes .CDLL (_find_lib (lib , LINUX_PATHS ))
22
+ if sys .platform .startswith ("linux" ):
23
+ loaded_libs = dllist .dllist ()
24
+ target_lib = "libnvinfer_builder_resource_win.so.*"
25
+ if target_lib in loaded_libs :
36
26
return True
37
- except :
38
- continue
39
27
return False
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ requires = [
13
13
" pybind11==2.6.2" ,
14
14
" numpy" ,
15
15
" sympy" ,
16
+ " dllist" ,
16
17
]
17
18
build-backend = " setuptools.build_meta"
18
19
@@ -63,6 +64,7 @@ dependencies = [
63
64
" packaging>=23" ,
64
65
" numpy" ,
65
66
" typing-extensions>=4.7.0" ,
67
+ " dllist" ,
66
68
]
67
69
68
70
dynamic = [" version" ]
You can’t perform that action at this time.
0 commit comments