From d1249cd993e94d3fddfbd11ba3dfe95374c61009 Mon Sep 17 00:00:00 2001 From: pkv Date: Sat, 1 Feb 2025 14:32:51 +0100 Subject: [PATCH] nv-filters: Remove CUDA RT functions We don't use CUDA RT functions anymore. So this commit removes their loading from the CUDA RT DLL. This also fixes a crash when loading different versions of CUDA RT when the SDK is updated [1]. [1] https://github.com/obsproject/obs-studio/issues/11813 Signed-off-by: pkv --- plugins/nv-filters/nvidia-videofx-filter.c | 8 -------- plugins/nv-filters/nvvfx-load.h | 12 +----------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/plugins/nv-filters/nvidia-videofx-filter.c b/plugins/nv-filters/nvidia-videofx-filter.c index 15a974dd9..f721f6d96 100644 --- a/plugins/nv-filters/nvidia-videofx-filter.c +++ b/plugins/nv-filters/nvidia-videofx-filter.c @@ -1189,14 +1189,6 @@ bool load_nvidia_vfx(void) LOAD_SYM(NvCVImage_FromD3DColorSpace); #undef LOAD_SYM -#define LOAD_SYM(sym) LOAD_SYM_FROM_LIB(sym, nv_cudart, "cudart64_110.dll") - LOAD_SYM(cudaMalloc); - LOAD_SYM(cudaStreamSynchronize); - LOAD_SYM(cudaFree); - LOAD_SYM(cudaMemcpy); - LOAD_SYM(cudaMemsetAsync); -#undef LOAD_SYM - #define LOAD_SYM(sym) LOAD_SYM_FROM_LIB2(sym, nv_videofx, "NVVideoEffects.dll") LOAD_SYM(NvVFX_SetStateObjectHandleArray); LOAD_SYM(NvVFX_AllocateState); diff --git a/plugins/nv-filters/nvvfx-load.h b/plugins/nv-filters/nvvfx-load.h index ff8bef7f3..5b52c574f 100644 --- a/plugins/nv-filters/nvvfx-load.h +++ b/plugins/nv-filters/nvvfx-load.h @@ -670,15 +670,6 @@ static inline void release_nv_vfx() FreeLibrary(nv_cvimage); nv_cvimage = NULL; } - cudaMalloc = NULL; - cudaStreamSynchronize = NULL; - cudaFree = NULL; - cudaMemcpy = NULL; - cudaMemsetAsync = NULL; - if (nv_cudart) { - FreeLibrary(nv_cudart); - nv_cudart = NULL; - } } static inline void nvvfx_get_sdk_path(char *buffer, const size_t len) @@ -702,9 +693,8 @@ static inline bool load_nv_vfx_libs() nv_videofx = LoadLibrary(L"NVVideoEffects.dll"); nv_cvimage = LoadLibrary(L"NVCVImage.dll"); - nv_cudart = LoadLibrary(L"cudart64_110.dll"); SetDllDirectoryA(NULL); - return !!nv_videofx && !!nv_cvimage && !!nv_cudart; + return !!nv_videofx && !!nv_cvimage; } static unsigned int get_lib_version(void)