The below CMakeUserPreset.json can be used to successfully build and install obs-backgroundremoval with a version of the ONNXRUNTIME that supports current NVIDIA CUDA 12.
It makes use of changes introduced in my fork with commit 2c658d8a. EDIT: The PR has now been merged into master
Due to changes upstream with ONNXRUNTIME, the plugin now depends on libcudnn for CUDA which is provided by nvidia-cudnn.
To make use of this:
Clone from my fork on theClone locaal-ai/obs-backgroundremovalfeature/custom-onnxruntimebranch.- Place the below
CMakeUserPresets.jsonfile at the projects root - Run the following:
rm -rf build_x86_64 release \ && cmake --preset cuda12 \ && cmake --build --preset cuda12 \ && cmake --build build_x86_64 -t package \ && sudo apt install ./release/obs-backgroundremoval-1.2.0-x86_64-linux-gnu.deb
- Profit
Update 9/15/2025: Changed debian package dependencies for more accurate cuda selection
@mercster The CMAKE_INSTALL_PREFIX guess was just an off the cuff guess that is a common gotcha when mixing compiled plugin debs with packaged obs. Admittedly I was on the go while responding and missed that you weren't creating a deb. I'm not that familiar with the rpm side of things if you're creating one or are you just installing directly to the dirs?
Regardless, your OBS log file might be helpful in chasing down what's happening since it appears to be loading into OBS.
This
CMakeUserPresets.jsonpreset is primarily to ensure required CUDA libraries are installed and override the default ONNX with a newer version that works with CUDA 12. Back in April my PR was accepted to have the flags for custom ONNX to work, but the actual runtime versions in the repo are still the older ones that don't work with CUDA 12.Happy to try and troubleshoot it further with you!