From 3feab478f18b4d519a05d79a3d80853811381004 Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Tue, 11 Nov 2025 03:02:12 +0900 Subject: [PATCH 1/8] Update CMakeLists.txt --- CMakeLists.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39fb6ff3..83bbe250 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,6 +164,29 @@ endif() add_subdirectory(src/update-checker/CurlClient) target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE CurlClient OpenCV::opencv_core OpenCV::opencv_imgproc) +# Check for ONNX Runtime Execution Providers +include(CheckLibraryExists) + +check_library_exists( + onnxruntime::onnxruntime + OrtSessionOptionsAppendExecutionProvider_CUDA + onnxruntime_c_api.h + HAVE_ONNXRUNTIME_CUDA_EP +) +if(HAVE_ONNXRUNTIME_CUDA_EP) + target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE HAVE_ONNXRUNTIME_CUDA_EP) +endif() + +check_library_exists( + onnxruntime::onnxruntime + OrtSessionOptionsAppendExecutionProvider_ROCM + onnxruntime_c_api.h + HAVE_ONNXRUNTIME_ROCM_EP +) +if(HAVE_ONNXRUNTIME_ROCM_EP) + target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE HAVE_ONNXRUNTIME_ROCM_EP) +endif() + target_sources( ${CMAKE_PROJECT_NAME} PRIVATE From 5c4d54094f5fa8d8aa98305209c154f0010a9c60 Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Tue, 11 Nov 2025 03:24:50 +0900 Subject: [PATCH 2/8] Add ROCm support for ONNX Runtime GPU execution This commit introduces support for the ROCm execution provider in ONNX Runtime. It adds new UI options for selecting ROCm as the inference device, updates constants, and conditionally compiles ROCm-related code paths. CUDA and ROCm options are now only shown if the corresponding ONNX Runtime support is available. --- CMakeLists.txt | 2 -- data/locale/en-US.ini | 1 + src/background-filter.cpp | 7 ++++++- src/consts.h | 1 + src/enhance-filter.cpp | 7 ++++++- src/ort-utils/ort-session-utils.cpp | 10 +++++++++- 6 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 83bbe250..02cba7eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,8 +85,6 @@ else() find_package(OpenCV CONFIG REQUIRED) endif() -target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE DISABLE_ONNXRUNTIME_GPU) - if(USE_SYSTEM_ONNXRUNTIME) if(OS_LINUX) find_package(Onnxruntime 1.16.3 REQUIRED) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index c2ae325d..c693bbd8 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -8,6 +8,7 @@ BackgroundColor="Background Color" InferenceDevice="Inference device" CPU="CPU" GPUCUDA="GPU - CUDA" +GPUCUDA="GPU - ROCM" GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="Segmentation model" diff --git a/src/background-filter.cpp b/src/background-filter.cpp index ccb938a3..b8f0e62f 100644 --- a/src/background-filter.cpp +++ b/src/background-filter.cpp @@ -155,7 +155,12 @@ obs_properties_t *background_filter_properties(void *data) obs_property_list_add_string(p_use_gpu, obs_module_text("CPU"), USEGPU_CPU); #if defined(__linux__) && defined(__x86_64__) obs_property_list_add_string(p_use_gpu, obs_module_text("GPUTensorRT"), USEGPU_TENSORRT); - obs_property_list_add_string(p_use_gpu, obs_module_text("GPUCUDA"), USEGPU_CUDA); +#endif +#ifdef HAVE_ONNXRUNTIME_CUDA + obs_property_list_add_string(p_use_gpu, obs_module_text("GPUCuda"), USEGPU_CUDA); +#endif +#ifdef HAVE_ONNXRUNTIME_ROCM + obs_property_list_add_string(p_use_gpu, obs_module_text("GPURocm"), USEGPU_ROCM); #endif #if defined(__APPLE__) obs_property_list_add_string(p_use_gpu, obs_module_text("CoreML"), USEGPU_COREML); diff --git a/src/consts.h b/src/consts.h index f1c71c45..6e6c0036 100644 --- a/src/consts.h +++ b/src/consts.h @@ -15,6 +15,7 @@ const char *const MODEL_RMBG = "models/bria_rmbg_1_4_qint8.onnx"; const char *const USEGPU_CPU = "cpu"; const char *const USEGPU_CUDA = "cuda"; +const char *const USEGPU_ROCM = "rocm"; const char *const USEGPU_TENSORRT = "tensorrt"; const char *const USEGPU_COREML = "coreml"; diff --git a/src/enhance-filter.cpp b/src/enhance-filter.cpp index c0802fe0..7295f92d 100644 --- a/src/enhance-filter.cpp +++ b/src/enhance-filter.cpp @@ -55,7 +55,12 @@ obs_properties_t *enhance_filter_properties(void *data) obs_property_list_add_string(p_use_gpu, obs_module_text("CPU"), USEGPU_CPU); #ifdef __linux__ obs_property_list_add_string(p_use_gpu, obs_module_text("GPUTensorRT"), USEGPU_TENSORRT); - obs_property_list_add_string(p_use_gpu, obs_module_text("GPUCUDA"), USEGPU_CUDA); +#endif +#ifdef HAVE_ONNXRUNTIME_CUDA + obs_property_list_add_string(p_use_gpu, obs_module_text("GPUCuda"), USEGPU_CUDA); +#endif +#ifdef HAVE_ONNXRUNTIME_ROCM + obs_property_list_add_string(p_use_gpu, obs_module_text("GPURocm"), USEGPU_ROCM); #endif #if defined(__APPLE__) obs_property_list_add_string(p_use_gpu, obs_module_text("CoreML"), USEGPU_COREML); diff --git a/src/ort-utils/ort-session-utils.cpp b/src/ort-utils/ort-session-utils.cpp index 01e24a54..def52d13 100644 --- a/src/ort-utils/ort-session-utils.cpp +++ b/src/ort-utils/ort-session-utils.cpp @@ -95,10 +95,18 @@ int createOrtSession(filter_data *tf) // Append execution provider sessionOptions.AppendExecutionProvider_TensorRT_V2(*tensorrt_options); - } else if (tf->useGPU == USEGPU_CUDA) { + } +#endif +#ifdef HAVE_ONNXRUNTIME_CUDA + if (tf->useGPU == USEGPU_CUDA) { Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_CUDA(sessionOptions, 0)); } #endif +#ifdef HAVE_ONNXRUNTIME_ROCM + if (tf->useGPU == USEGPU_ROCM) { + Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_ROCM(sessionOptions, 0)); + } +#endif #if defined(__APPLE__) if (tf->useGPU == USEGPU_COREML) { uint32_t coreml_flags = 0; From 6e3a111c7a82b578388d6da1e89b4367f1e76f79 Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Tue, 11 Nov 2025 03:27:27 +0900 Subject: [PATCH 3/8] Add GPU-ROCM translation to all locale files Introduced the 'GPUROCM' key with appropriate translations in all supported locale .ini files to support ROCM inference device labeling in the UI. --- data/locale/ar-EG.ini | 1 + data/locale/bn-IN.ini | 1 + data/locale/es-SP.ini | 1 + data/locale/fr-FR.ini | 1 + data/locale/hi-IN.ini | 1 + data/locale/it-IT.ini | 1 + data/locale/ja-JP.ini | 1 + data/locale/ko-KR.ini | 1 + data/locale/pt-BR.ini | 1 + data/locale/ru-RU.ini | 1 + data/locale/ta-IN.ini | 1 + data/locale/tr-TR.ini | 1 + data/locale/zh-CN.ini | 1 + 13 files changed, 13 insertions(+) diff --git a/data/locale/ar-EG.ini b/data/locale/ar-EG.ini index a4009bec..85d03b80 100644 --- a/data/locale/ar-EG.ini +++ b/data/locale/ar-EG.ini @@ -8,6 +8,7 @@ BackgroundColor="لون الخلفية" InferenceDevice="جهاز الإستدلال" CPU="وحدة المعالجة المركزية" GPUCUDA="الوحدة المركزية - CUDA" +GPUROCM="GPU - ROCM" GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="نموذج التقسيم" diff --git a/data/locale/bn-IN.ini b/data/locale/bn-IN.ini index db5ac448..cdb3bd86 100644 --- a/data/locale/bn-IN.ini +++ b/data/locale/bn-IN.ini @@ -8,6 +8,7 @@ BackgroundColor="পটভূমি রঙ" InferenceDevice="নিখরচনা ডিভাইস" CPU="সিপিইউ" GPUCUDA="জিপিইউ - কুড়া" +GPUROCM="GPU - ROCM" GPUTensorRT="জিপিইউ - টেনসরআরটি" CoreML="কোরএমএল" SegmentationModel="সেগমেন্টেশন মডেল" diff --git a/data/locale/es-SP.ini b/data/locale/es-SP.ini index c1951b66..1aa4fefc 100644 --- a/data/locale/es-SP.ini +++ b/data/locale/es-SP.ini @@ -8,6 +8,7 @@ BackgroundColor="Color de fondo" InferenceDevice="Dispositivo de inferencia" CPU="CPU" GPUCUDA="GPU - CUDA" +GPUROCM="GPU - ROCM" GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="Modelo de segmentación" diff --git a/data/locale/fr-FR.ini b/data/locale/fr-FR.ini index ea064e76..147a5217 100644 --- a/data/locale/fr-FR.ini +++ b/data/locale/fr-FR.ini @@ -8,6 +8,7 @@ BackgroundColor="Couleur de l'arrière-plan" InferenceDevice="Dispositif d'inférence" CPU="CPU" GPUCUDA="GPU - CUDA" +GPUROCM="GPU - ROCM" GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="Modèle de segmentation" diff --git a/data/locale/hi-IN.ini b/data/locale/hi-IN.ini index ad8745a9..0cdf34ad 100644 --- a/data/locale/hi-IN.ini +++ b/data/locale/hi-IN.ini @@ -8,6 +8,7 @@ BackgroundColor="बैकग्राउंड रंग" InferenceDevice="संदर्भ डिवाइस" CPU="सीपीयू" GPUCUDA="जीपीयू - क्यूडा" +GPUROCM="जीपीयू - ROCM" GPUTensorRT="जीपीयू - टेंसरआरटी" CoreML="कोरएमएल" SegmentationModel="सेगमेंटेशन मॉडल" diff --git a/data/locale/it-IT.ini b/data/locale/it-IT.ini index 73b8101b..3457e0c4 100644 --- a/data/locale/it-IT.ini +++ b/data/locale/it-IT.ini @@ -8,6 +8,7 @@ BackgroundColor="Colore di sfondo" InferenceDevice="Dispositivo di inferenza" CPU="CPU" GPUCUDA="GPU - CUDA" +GPUROCM="GPU - ROCM" GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="Modello di segmentazione". diff --git a/data/locale/ja-JP.ini b/data/locale/ja-JP.ini index 0041c0da..fb51c6bd 100644 --- a/data/locale/ja-JP.ini +++ b/data/locale/ja-JP.ini @@ -8,6 +8,7 @@ BackgroundColor="背景色" InferenceDevice="推論デバイス" CPU="CPU" GPUCUDA="GPU - CUDA" +GPUROCM="GPU - ROCM" GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="セグメンテーションモデル" diff --git a/data/locale/ko-KR.ini b/data/locale/ko-KR.ini index 67175029..d02090bd 100644 --- a/data/locale/ko-KR.ini +++ b/data/locale/ko-KR.ini @@ -8,6 +8,7 @@ BackgroundColor="배경 색상" InferenceDevice="추론 장치" CPU="CPU" GPUCUDA="GPU - CUDA" +GPUROCM="GPU - ROCM" GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="세분화 모델" diff --git a/data/locale/pt-BR.ini b/data/locale/pt-BR.ini index 0f74ba7a..19aefed6 100644 --- a/data/locale/pt-BR.ini +++ b/data/locale/pt-BR.ini @@ -8,6 +8,7 @@ BackgroundColor="Cor de Fundo" InferenceDevice="Dispositivo de Inferência" CPU="CPU" GPUCUDA="GPU - CUDA" +GPUROCM="GPU - ROCM" GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="Modelo de segmentação" diff --git a/data/locale/ru-RU.ini b/data/locale/ru-RU.ini index 67e94f47..98ac1e2d 100644 --- a/data/locale/ru-RU.ini +++ b/data/locale/ru-RU.ini @@ -8,6 +8,7 @@ BackgroundColor="Цвет фона" InferenceDevice="Устройство вывода" CPU="ЦПУ" GPUCUDA="ГПУ - CUDA" +GPUROCM="ГПУ - ROCM" GPUTensorRT="ГПУ - TensorRT" CoreML="CoreML" SegmentationModel="Модель сегментации" diff --git a/data/locale/ta-IN.ini b/data/locale/ta-IN.ini index 253257cd..cfa11366 100644 --- a/data/locale/ta-IN.ini +++ b/data/locale/ta-IN.ini @@ -8,6 +8,7 @@ BackgroundColor="பின்னணி நிறம்" InferenceDevice="பரிமாற்ற சாதனம்" CPU="சிபியூ" GPUCUDA="GPU-CUDA" +GPUROCM="GPU - ROCM" GPUTensorRT="GPU-TensorRT" CoreML="CoreML" SegmentationModel="பிரிவு மாதிரி" diff --git a/data/locale/tr-TR.ini b/data/locale/tr-TR.ini index d03cd715..b435ad7c 100644 --- a/data/locale/tr-TR.ini +++ b/data/locale/tr-TR.ini @@ -8,6 +8,7 @@ BackgroundColor="Arka Plan Rengi" InferenceDevice="Tahmin Cihazı" CPU="CPU" GPUCUDA="GPU - CUDA" +GPUROCM="GPU - ROCM" GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="Segmentasyon Modeli" diff --git a/data/locale/zh-CN.ini b/data/locale/zh-CN.ini index 56fae8c8..f82c8496 100644 --- a/data/locale/zh-CN.ini +++ b/data/locale/zh-CN.ini @@ -8,6 +8,7 @@ BackgroundColor="背景颜色" InferenceDevice="推断设备" CPU="CPU" GPUCUDA="GPU-CUDA" +GPUROCM="GPU - ROCM" GPUTensorRT="GPU-TensorRT" CoreML="CoreML" SegmentationModel="分割模型" From 441a7afc69c585348c9310123313947c0fa79c1a Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Tue, 11 Nov 2025 03:32:42 +0900 Subject: [PATCH 4/8] Update enhance-filter.cpp --- src/enhance-filter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/enhance-filter.cpp b/src/enhance-filter.cpp index 7295f92d..a2871699 100644 --- a/src/enhance-filter.cpp +++ b/src/enhance-filter.cpp @@ -57,10 +57,10 @@ obs_properties_t *enhance_filter_properties(void *data) obs_property_list_add_string(p_use_gpu, obs_module_text("GPUTensorRT"), USEGPU_TENSORRT); #endif #ifdef HAVE_ONNXRUNTIME_CUDA - obs_property_list_add_string(p_use_gpu, obs_module_text("GPUCuda"), USEGPU_CUDA); + obs_property_list_add_string(p_use_gpu, obs_module_text("GPUCUDA"), USEGPU_CUDA); #endif #ifdef HAVE_ONNXRUNTIME_ROCM - obs_property_list_add_string(p_use_gpu, obs_module_text("GPURocm"), USEGPU_ROCM); + obs_property_list_add_string(p_use_gpu, obs_module_text("GPUROCM"), USEGPU_ROCM); #endif #if defined(__APPLE__) obs_property_list_add_string(p_use_gpu, obs_module_text("CoreML"), USEGPU_COREML); From ee7e874e73ade3d61cd8a2e66ee06e5cbcc90fc5 Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Tue, 11 Nov 2025 03:51:37 +0900 Subject: [PATCH 5/8] Update CMakeLists.txt --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 02cba7eb..34999454 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,6 +172,7 @@ check_library_exists( HAVE_ONNXRUNTIME_CUDA_EP ) if(HAVE_ONNXRUNTIME_CUDA_EP) + message(STATUS "ONNX Runtime CUDA Execution Provider found") target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE HAVE_ONNXRUNTIME_CUDA_EP) endif() @@ -181,7 +182,9 @@ check_library_exists( onnxruntime_c_api.h HAVE_ONNXRUNTIME_ROCM_EP ) +message(FATAL_ERROR ${HAVE_ONNXRUNTIME_ROCM_EP}) if(HAVE_ONNXRUNTIME_ROCM_EP) + message(STATUS "ONNX Runtime ROCM Execution Provider found") target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE HAVE_ONNXRUNTIME_ROCM_EP) endif() From 4b9e9f563b94546ae8c328565a276b355d64dea6 Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Tue, 11 Nov 2025 03:52:27 +0900 Subject: [PATCH 6/8] Update CMakeLists.txt --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34999454..52f4140a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,7 +182,6 @@ check_library_exists( onnxruntime_c_api.h HAVE_ONNXRUNTIME_ROCM_EP ) -message(FATAL_ERROR ${HAVE_ONNXRUNTIME_ROCM_EP}) if(HAVE_ONNXRUNTIME_ROCM_EP) message(STATUS "ONNX Runtime ROCM Execution Provider found") target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE HAVE_ONNXRUNTIME_ROCM_EP) From 3dad3f0cf05b0267eaa3fdeffb1c16e8b6587f65 Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Tue, 11 Nov 2025 03:53:53 +0900 Subject: [PATCH 7/8] Update ONNX Runtime GPU provider macro names Replaces HAVE_ONNXRUNTIME_CUDA and HAVE_ONNXRUNTIME_ROCM with HAVE_ONNXRUNTIME_CUDA_EP and HAVE_ONNXRUNTIME_ROCM_EP to match updated macro definitions. Ensures correct conditional compilation for CUDA and ROCm execution providers. --- src/enhance-filter.cpp | 4 ++-- src/ort-utils/ort-session-utils.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/enhance-filter.cpp b/src/enhance-filter.cpp index a2871699..7d0d34b9 100644 --- a/src/enhance-filter.cpp +++ b/src/enhance-filter.cpp @@ -56,10 +56,10 @@ obs_properties_t *enhance_filter_properties(void *data) #ifdef __linux__ obs_property_list_add_string(p_use_gpu, obs_module_text("GPUTensorRT"), USEGPU_TENSORRT); #endif -#ifdef HAVE_ONNXRUNTIME_CUDA +#ifdef HAVE_ONNXRUNTIME_CUDA_EP obs_property_list_add_string(p_use_gpu, obs_module_text("GPUCUDA"), USEGPU_CUDA); #endif -#ifdef HAVE_ONNXRUNTIME_ROCM +#ifdef HAVE_ONNXRUNTIME_ROCM_EP obs_property_list_add_string(p_use_gpu, obs_module_text("GPUROCM"), USEGPU_ROCM); #endif #if defined(__APPLE__) diff --git a/src/ort-utils/ort-session-utils.cpp b/src/ort-utils/ort-session-utils.cpp index def52d13..144b1344 100644 --- a/src/ort-utils/ort-session-utils.cpp +++ b/src/ort-utils/ort-session-utils.cpp @@ -97,12 +97,12 @@ int createOrtSession(filter_data *tf) sessionOptions.AppendExecutionProvider_TensorRT_V2(*tensorrt_options); } #endif -#ifdef HAVE_ONNXRUNTIME_CUDA +#ifdef HAVE_ONNXRUNTIME_CUDA_EP if (tf->useGPU == USEGPU_CUDA) { Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_CUDA(sessionOptions, 0)); } #endif -#ifdef HAVE_ONNXRUNTIME_ROCM +#ifdef HAVE_ONNXRUNTIME_ROCM_EP if (tf->useGPU == USEGPU_ROCM) { Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_ROCM(sessionOptions, 0)); } From 92d111dd030405f39b07df5214f9803d0d9e4662 Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Tue, 11 Nov 2025 03:57:53 +0900 Subject: [PATCH 8/8] Remove TensorRT support and references This commit removes all code, localization strings, and documentation references related to TensorRT support. The affected files include source code, constants, and multiple locale files, reflecting the discontinuation of TensorRT as an inference device option. --- README.md | 8 +++--- data/locale/ar-EG.ini | 1 - data/locale/bn-IN.ini | 1 - data/locale/en-US.ini | 3 +-- data/locale/es-SP.ini | 1 - data/locale/fr-FR.ini | 1 - data/locale/hi-IN.ini | 1 - data/locale/it-IT.ini | 1 - data/locale/ja-JP.ini | 1 - data/locale/ko-KR.ini | 1 - data/locale/pt-BR.ini | 1 - data/locale/ru-RU.ini | 1 - data/locale/ta-IN.ini | 1 - data/locale/tr-TR.ini | 1 - data/locale/zh-CN.ini | 1 - src/background-filter.cpp | 7 ++--- src/consts.h | 1 - src/enhance-filter.cpp | 3 --- src/ort-utils/ort-session-utils.cpp | 42 ----------------------------- 19 files changed, 6 insertions(+), 71 deletions(-) diff --git a/README.md b/README.md index ffc4b794..aafe2975 100644 --- a/README.md +++ b/README.md @@ -57,14 +57,12 @@ If you are looking for hands-on help or private consultation please select a [sp ### Technical Details - Number of CPU threads is controllable through the UI settings. A 2-thread setting works best. diff --git a/data/locale/ar-EG.ini b/data/locale/ar-EG.ini index 85d03b80..e462efa4 100644 --- a/data/locale/ar-EG.ini +++ b/data/locale/ar-EG.ini @@ -9,7 +9,6 @@ InferenceDevice="جهاز الإستدلال" CPU="وحدة المعالجة المركزية" GPUCUDA="الوحدة المركزية - CUDA" GPUROCM="GPU - ROCM" -GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="نموذج التقسيم" SINet="SINet" diff --git a/data/locale/bn-IN.ini b/data/locale/bn-IN.ini index cdb3bd86..932f79c2 100644 --- a/data/locale/bn-IN.ini +++ b/data/locale/bn-IN.ini @@ -9,7 +9,6 @@ InferenceDevice="নিখরচনা ডিভাইস" CPU="সিপিইউ" GPUCUDA="জিপিইউ - কুড়া" GPUROCM="GPU - ROCM" -GPUTensorRT="জিপিইউ - টেনসরআরটি" CoreML="কোরএমএল" SegmentationModel="সেগমেন্টেশন মডেল" SINet="এসআইনেট" diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index c693bbd8..8c9ca6b5 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -8,8 +8,7 @@ BackgroundColor="Background Color" InferenceDevice="Inference device" CPU="CPU" GPUCUDA="GPU - CUDA" -GPUCUDA="GPU - ROCM" -GPUTensorRT="GPU - TensorRT" +GPUROCM="GPU - ROCM" CoreML="CoreML" SegmentationModel="Segmentation model" SINet="SINet" diff --git a/data/locale/es-SP.ini b/data/locale/es-SP.ini index 1aa4fefc..566c12c8 100644 --- a/data/locale/es-SP.ini +++ b/data/locale/es-SP.ini @@ -9,7 +9,6 @@ InferenceDevice="Dispositivo de inferencia" CPU="CPU" GPUCUDA="GPU - CUDA" GPUROCM="GPU - ROCM" -GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="Modelo de segmentación" SINet="SINet" diff --git a/data/locale/fr-FR.ini b/data/locale/fr-FR.ini index 147a5217..ade34566 100644 --- a/data/locale/fr-FR.ini +++ b/data/locale/fr-FR.ini @@ -9,7 +9,6 @@ InferenceDevice="Dispositif d'inférence" CPU="CPU" GPUCUDA="GPU - CUDA" GPUROCM="GPU - ROCM" -GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="Modèle de segmentation" SINet="SINet" diff --git a/data/locale/hi-IN.ini b/data/locale/hi-IN.ini index 0cdf34ad..f8ae693f 100644 --- a/data/locale/hi-IN.ini +++ b/data/locale/hi-IN.ini @@ -9,7 +9,6 @@ InferenceDevice="संदर्भ डिवाइस" CPU="सीपीयू" GPUCUDA="जीपीयू - क्यूडा" GPUROCM="जीपीयू - ROCM" -GPUTensorRT="जीपीयू - टेंसरआरटी" CoreML="कोरएमएल" SegmentationModel="सेगमेंटेशन मॉडल" SINet="ऐसआईनेट" diff --git a/data/locale/it-IT.ini b/data/locale/it-IT.ini index 3457e0c4..ec16fafa 100644 --- a/data/locale/it-IT.ini +++ b/data/locale/it-IT.ini @@ -9,7 +9,6 @@ InferenceDevice="Dispositivo di inferenza" CPU="CPU" GPUCUDA="GPU - CUDA" GPUROCM="GPU - ROCM" -GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="Modello di segmentazione". SINet="SINet" diff --git a/data/locale/ja-JP.ini b/data/locale/ja-JP.ini index fb51c6bd..f912f34f 100644 --- a/data/locale/ja-JP.ini +++ b/data/locale/ja-JP.ini @@ -9,7 +9,6 @@ InferenceDevice="推論デバイス" CPU="CPU" GPUCUDA="GPU - CUDA" GPUROCM="GPU - ROCM" -GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="セグメンテーションモデル" SINet="SINet" diff --git a/data/locale/ko-KR.ini b/data/locale/ko-KR.ini index d02090bd..f8825fc4 100644 --- a/data/locale/ko-KR.ini +++ b/data/locale/ko-KR.ini @@ -9,7 +9,6 @@ InferenceDevice="추론 장치" CPU="CPU" GPUCUDA="GPU - CUDA" GPUROCM="GPU - ROCM" -GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="세분화 모델" SINet="SINet" diff --git a/data/locale/pt-BR.ini b/data/locale/pt-BR.ini index 19aefed6..89005778 100644 --- a/data/locale/pt-BR.ini +++ b/data/locale/pt-BR.ini @@ -9,7 +9,6 @@ InferenceDevice="Dispositivo de Inferência" CPU="CPU" GPUCUDA="GPU - CUDA" GPUROCM="GPU - ROCM" -GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="Modelo de segmentação" SINet="SINet" diff --git a/data/locale/ru-RU.ini b/data/locale/ru-RU.ini index 98ac1e2d..4acdab2b 100644 --- a/data/locale/ru-RU.ini +++ b/data/locale/ru-RU.ini @@ -9,7 +9,6 @@ InferenceDevice="Устройство вывода" CPU="ЦПУ" GPUCUDA="ГПУ - CUDA" GPUROCM="ГПУ - ROCM" -GPUTensorRT="ГПУ - TensorRT" CoreML="CoreML" SegmentationModel="Модель сегментации" SINet="SINet" diff --git a/data/locale/ta-IN.ini b/data/locale/ta-IN.ini index cfa11366..832e8728 100644 --- a/data/locale/ta-IN.ini +++ b/data/locale/ta-IN.ini @@ -9,7 +9,6 @@ InferenceDevice="பரிமாற்ற சாதனம்" CPU="சிபியூ" GPUCUDA="GPU-CUDA" GPUROCM="GPU - ROCM" -GPUTensorRT="GPU-TensorRT" CoreML="CoreML" SegmentationModel="பிரிவு மாதிரி" SINet="SINet" diff --git a/data/locale/tr-TR.ini b/data/locale/tr-TR.ini index b435ad7c..23980257 100644 --- a/data/locale/tr-TR.ini +++ b/data/locale/tr-TR.ini @@ -9,7 +9,6 @@ InferenceDevice="Tahmin Cihazı" CPU="CPU" GPUCUDA="GPU - CUDA" GPUROCM="GPU - ROCM" -GPUTensorRT="GPU - TensorRT" CoreML="CoreML" SegmentationModel="Segmentasyon Modeli" SINet="SINet" diff --git a/data/locale/zh-CN.ini b/data/locale/zh-CN.ini index f82c8496..1bbdfe9f 100644 --- a/data/locale/zh-CN.ini +++ b/data/locale/zh-CN.ini @@ -9,7 +9,6 @@ InferenceDevice="推断设备" CPU="CPU" GPUCUDA="GPU-CUDA" GPUROCM="GPU - ROCM" -GPUTensorRT="GPU-TensorRT" CoreML="CoreML" SegmentationModel="分割模型" SINet="SINet" diff --git a/src/background-filter.cpp b/src/background-filter.cpp index b8f0e62f..baf1eb29 100644 --- a/src/background-filter.cpp +++ b/src/background-filter.cpp @@ -153,13 +153,10 @@ obs_properties_t *background_filter_properties(void *data) OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING); obs_property_list_add_string(p_use_gpu, obs_module_text("CPU"), USEGPU_CPU); -#if defined(__linux__) && defined(__x86_64__) - obs_property_list_add_string(p_use_gpu, obs_module_text("GPUTensorRT"), USEGPU_TENSORRT); -#endif -#ifdef HAVE_ONNXRUNTIME_CUDA +#ifdef HAVE_ONNXRUNTIME_CUDA_CP obs_property_list_add_string(p_use_gpu, obs_module_text("GPUCuda"), USEGPU_CUDA); #endif -#ifdef HAVE_ONNXRUNTIME_ROCM +#ifdef HAVE_ONNXRUNTIME_ROCM_EP obs_property_list_add_string(p_use_gpu, obs_module_text("GPURocm"), USEGPU_ROCM); #endif #if defined(__APPLE__) diff --git a/src/consts.h b/src/consts.h index 6e6c0036..e5d02e2a 100644 --- a/src/consts.h +++ b/src/consts.h @@ -16,7 +16,6 @@ const char *const MODEL_RMBG = "models/bria_rmbg_1_4_qint8.onnx"; const char *const USEGPU_CPU = "cpu"; const char *const USEGPU_CUDA = "cuda"; const char *const USEGPU_ROCM = "rocm"; -const char *const USEGPU_TENSORRT = "tensorrt"; const char *const USEGPU_COREML = "coreml"; const char *const EFFECT_PATH = "effects/mask_alpha_filter.effect"; diff --git a/src/enhance-filter.cpp b/src/enhance-filter.cpp index 7d0d34b9..c9c937e6 100644 --- a/src/enhance-filter.cpp +++ b/src/enhance-filter.cpp @@ -53,9 +53,6 @@ obs_properties_t *enhance_filter_properties(void *data) obs_property_t *p_use_gpu = obs_properties_add_list(props, "useGPU", obs_module_text("InferenceDevice"), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING); obs_property_list_add_string(p_use_gpu, obs_module_text("CPU"), USEGPU_CPU); -#ifdef __linux__ - obs_property_list_add_string(p_use_gpu, obs_module_text("GPUTensorRT"), USEGPU_TENSORRT); -#endif #ifdef HAVE_ONNXRUNTIME_CUDA_EP obs_property_list_add_string(p_use_gpu, obs_module_text("GPUCUDA"), USEGPU_CUDA); #endif diff --git a/src/ort-utils/ort-session-utils.cpp b/src/ort-utils/ort-session-utils.cpp index 144b1344..49ea7032 100644 --- a/src/ort-utils/ort-session-utils.cpp +++ b/src/ort-utils/ort-session-utils.cpp @@ -55,48 +55,6 @@ int createOrtSession(filter_data *tf) bfree(modelFilepath_rawPtr); try { -#if defined(__linux__) && defined(__x86_64__) && !defined(DISABLE_ONNXRUNTIME_GPU) - if (tf->useGPU == USEGPU_TENSORRT) { - const auto &api = Ort::GetApi(); - - // Folder in which TensorRT will place its cache - const char *tensorrt_cache_path = "~/.cache/obs-backgroundremoval/tensorrt"; - - // Initialize TensorRT provider options - OrtTensorRTProviderOptionsV2 *tensorrt_options; - Ort::ThrowOnError(api.CreateTensorRTProviderOptions(&tensorrt_options)); - - // Create cache folder if it does not exist - std::filesystem::path cache_folder(tensorrt_cache_path); - if (!std::filesystem::exists(cache_folder)) { - std::filesystem::create_directories(cache_folder); - } - - // Define TensorRT provider options - std::vector option_keys = { - "device_id", - "trt_engine_cache_enable", - "trt_engine_cache_path", - "trt_timing_cache_enable", - "trt_timing_cache_path", - }; - - std::vector option_values = { - "0", // Device ID 0 - "1", // Enable engine cache - tensorrt_cache_path, // Engine cache path - "1", // Enable timing cache - tensorrt_cache_path, // Timing cache path - }; - - // Update provider options - Ort::ThrowOnError(api.UpdateTensorRTProviderOptions(tensorrt_options, option_keys.data(), - option_values.data(), option_keys.size())); - - // Append execution provider - sessionOptions.AppendExecutionProvider_TensorRT_V2(*tensorrt_options); - } -#endif #ifdef HAVE_ONNXRUNTIME_CUDA_EP if (tf->useGPU == USEGPU_CUDA) { Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_CUDA(sessionOptions, 0));