Skip to content

Commit 43d0bb0

Browse files
authored
Add Windows GPU support again (#702)
* Update DownloadOnnxruntime.cmake * Add TensorRT execution provider support This commit adds support for the ONNX Runtime TensorRT execution provider, including detection in CMake, new localization strings, and integration in background and enhance filters. It also updates session creation logic to handle TensorRT-specific options and cache management. * Update DownloadOnnxruntime.cmake * Update DownloadOnnxruntime.cmake * Update CMakePresets.json * Update background-filter.cpp * Update ort-session-utils.cpp * Update ort-session-utils.cpp
1 parent a5ebc9e commit 43d0bb0

21 files changed

+46
-9
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,17 @@ if(HAVE_ONNXRUNTIME_ROCM_EP)
183183
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE HAVE_ONNXRUNTIME_ROCM_EP)
184184
endif()
185185

186+
check_library_exists(
187+
onnxruntime::onnxruntime
188+
OrtSessionOptionsAppendExecutionProvider_Tensorrt
189+
onnxruntime_c_api.h
190+
HAVE_ONNXRUNTIME_TENSORRT_EP
191+
)
192+
if(HAVE_ONNXRUNTIME_TENSORRT_EP)
193+
message(STATUS "ONNX Runtime TensorRT Execution Provider found")
194+
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE HAVE_ONNXRUNTIME_TENSORRT_EP)
195+
endif()
196+
186197
target_sources(
187198
${CMAKE_PROJECT_NAME}
188199
PRIVATE

CMakePresets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"displayName": "Windows x64 CI build",
7777
"description": "Build for Windows x64 on CI",
7878
"cacheVariables": {
79-
"CMAKE_COMPILE_WARNING_AS_ERROR": false
79+
"CMAKE_COMPILE_WARNING_AS_ERROR": true
8080
}
8181
},
8282
{

cmake/DownloadOnnxruntime.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ if(PLATFORM STREQUAL "macos")
2626
elseif(PLATFORM STREQUAL "windows")
2727
file(
2828
DOWNLOAD
29-
https://github.com/microsoft/onnxruntime/releases/download/v1.23.2/onnxruntime-win-x64-1.23.2.zip
30-
onnxruntime-win-x64-1.23.2.zip
31-
EXPECTED_HASH SHA256=0b38df9af21834e41e73d602d90db5cb06dbd1ca618948b8f1d66d607ac9f3cd
29+
https://github.com/microsoft/onnxruntime/releases/download/v1.23.2/onnxruntime-win-x64-gpu-1.23.2.zip
30+
onnxruntime-win-x64-gpu-1.23.2.zip
31+
EXPECTED_HASH SHA256=e77afdbbc2b8cb6da4e5a50d89841b48c44f3e47dce4fb87b15a2743786d0bb9
3232
)
3333
execute_process(
34-
COMMAND ${CMAKE_COMMAND} -E tar xf onnxruntime-win-x64-1.23.2.zip
34+
COMMAND ${CMAKE_COMMAND} -E tar xf onnxruntime-win-x64-gpu-1.23.2.zip
3535
)
36-
file(RENAME onnxruntime-win-x64-1.23.2 onnxruntime)
36+
file(RENAME onnxruntime-win-x64-gpu-1.23.2 onnxruntime)
3737
elseif(PLATFORM STREQUAL "linux")
3838
file(
3939
DOWNLOAD

data/locale/ar-EG.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ InferenceDevice="جهاز الإستدلال"
99
CPU="وحدة المعالجة المركزية"
1010
GPUCUDA="الوحدة المركزية - CUDA"
1111
GPUROCM="GPU - ROCM"
12+
TENSORRT="TensorRT"
1213
CoreML="CoreML"
1314
SegmentationModel="نموذج التقسيم"
1415
SINet="SINet"

data/locale/bn-IN.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ InferenceDevice="নিখরচনা ডিভাইস"
99
CPU="সিপিইউ"
1010
GPUCUDA="জিপিইউ - কুড়া"
1111
GPUROCM="GPU - ROCM"
12+
TENSORRT="TensorRT"
1213
CoreML="কোরএমএল"
1314
SegmentationModel="সেগমেন্টেশন মডেল"
1415
SINet="এসআইনেট"

data/locale/en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ InferenceDevice="Inference device"
99
CPU="CPU"
1010
GPUCUDA="GPU - CUDA"
1111
GPUROCM="GPU - ROCM"
12+
TENSORRT="TensorRT"
1213
CoreML="CoreML"
1314
SegmentationModel="Segmentation model"
1415
SINet="SINet"

data/locale/es-SP.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ InferenceDevice="Dispositivo de inferencia"
99
CPU="CPU"
1010
GPUCUDA="GPU - CUDA"
1111
GPUROCM="GPU - ROCM"
12+
TENSORRT="TensorRT"
1213
CoreML="CoreML"
1314
SegmentationModel="Modelo de segmentación"
1415
SINet="SINet"

data/locale/fr-FR.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ InferenceDevice="Dispositif d'inférence"
99
CPU="CPU"
1010
GPUCUDA="GPU - CUDA"
1111
GPUROCM="GPU - ROCM"
12+
TENSORRT="TensorRT"
1213
CoreML="CoreML"
1314
SegmentationModel="Modèle de segmentation"
1415
SINet="SINet"

data/locale/hi-IN.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ InferenceDevice="संदर्भ डिवाइस"
99
CPU="सीपीयू"
1010
GPUCUDA="जीपीयू - क्यूडा"
1111
GPUROCM="जीपीयू - ROCM"
12+
TENSORRT="TensorRT"
1213
CoreML="कोरएमएल"
1314
SegmentationModel="सेगमेंटेशन मॉडल"
1415
SINet="ऐसआईनेट"

data/locale/it-IT.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ InferenceDevice="Dispositivo di inferenza"
99
CPU="CPU"
1010
GPUCUDA="GPU - CUDA"
1111
GPUROCM="GPU - ROCM"
12+
TENSORRT="TensorRT"
1213
CoreML="CoreML"
1314
SegmentationModel="Modello di segmentazione".
1415
SINet="SINet"

0 commit comments

Comments
 (0)