Skip to content

Commit 27aa2f2

Browse files
committed
dll file path update for windows
1 parent 9c238ae commit 27aa2f2

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

py/torch_tensorrt/dynamo/utils.py

+15-16
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
import gc
55
import logging
66
import os
7-
import shutil
8-
import subprocess
9-
import sys
107
import urllib.request
118
import warnings
129
from dataclasses import fields, replace
@@ -847,20 +844,22 @@ def download_plugin_lib_path(py_version: str, platform: str) -> str:
847844

848845
# Proceeding with the unzip of the wheel file
849846
# This will exist if the filename was already downloaded
850-
if os.path.exists("./tensorrt_llm/libs/libnvinfer_plugin_tensorrt_llm.so"):
851-
plugin_lib_path = "./tensorrt_llm/libs/" + "libnvinfer_plugin_tensorrt_llm.so"
847+
if "linux" in platform:
848+
lib_filename = "libnvinfer_plugin_tensorrt_llm.so"
852849
else:
853-
try:
854-
import zipfile
855-
except:
856-
raise ImportError(
857-
"zipfile module is required but not found. Please install zipfile"
858-
)
859-
with zipfile.ZipFile(file_name, "r") as zip_ref:
860-
zip_ref.extractall(".") # Extract to a folder named 'tensorrt_llm'
861-
plugin_lib_path = (
862-
"./tensorrt_llm/libs/" + "libnvinfer_plugin_tensorrt_llm.so"
863-
)
850+
lib_filename = "libnvinfer_plugin_tensorrt_llm.dll"
851+
plugin_lib_path = os.path.join("./tensorrt_llm/libs", lib_filename)
852+
if os.path.exists(plugin_lib_path):
853+
return plugin_lib_path
854+
try:
855+
import zipfile
856+
except:
857+
raise ImportError(
858+
"zipfile module is required but not found. Please install zipfile"
859+
)
860+
with zipfile.ZipFile(file_name, "r") as zip_ref:
861+
zip_ref.extractall(".") # Extract to a folder named 'tensorrt_llm'
862+
plugin_lib_path = "./tensorrt_llm/libs/" + lib_filename
864863
return plugin_lib_path
865864

866865

0 commit comments

Comments
 (0)