Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 16, 2025

On Linux systems with CUDA-enabled ONNX Runtime, the CUDA inference option was missing from the UI despite successful build-time detection.

Root Cause

Preprocessor macro typo in background-filter.cpp:

  • Used: HAVE_ONNXRUNTIME_CUDA_CP
  • Expected: HAVE_ONNXRUNTIME_CUDA_EP

CMakeLists.txt defines HAVE_ONNXRUNTIME_CUDA_EP when CUDA support is detected. The typo caused the conditional compilation block to never execute, preventing the CUDA option from being added to the UI dropdown.

Changes

  • Fixed macro name to match CMake definition and align with other execution providers (ROCM_EP, TENSORRT_EP)
  • Consistent with correct usage in enhance-filter.cpp
// Before
#ifdef HAVE_ONNXRUNTIME_CUDA_CP
    obs_property_list_add_string(p_use_gpu, obs_module_text("GPUCUDA"), USEGPU_CUDA);
#endif

// After  
#ifdef HAVE_ONNXRUNTIME_CUDA_EP
    obs_property_list_add_string(p_use_gpu, obs_module_text("GPUCUDA"), USEGPU_CUDA);
#endif
Original prompt

This section details on the original issue you should resolve

<issue_title>CUDA option not available on Linux</issue_title>
<issue_description>### Operating System

Arch Linux

Other OS (if not listed above)

No response

Plugin Version

1.3.3

OBS Studio Version

32.0.1

OBS Studio Log URL

https://obsproject.com/logs/OJ8FxWPEJpaTuF9Z

OBS Studio Crash Log URL (if applicable)

No response

Expected Behavior

The option should be present.
From build logs:

-- Looking for OrtSessionOptionsAppendExecutionProvider_CUDA in onnxruntime::onnxruntime
-- Looking for OrtSessionOptionsAppendExecutionProvider_CUDA in onnxruntime::onnxruntime - found
-- ONNX Runtime CUDA Execution Provider found

Actual Behavior

No option other than CPU.

Steps to Reproduce

  1. Compile the AUR package with onnxruntime-cuda installed
  2. Add filter to webcam source
  3. Notice no option for using the GPU

Additional Notes / Screenshots

There is a typo here:

#ifdef HAVE_ONNXRUNTIME_CUDA_CP

it should end in _EP

Confirmation

  • I have attached the required OBS log file(s).</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix CUDA option not available on Linux Fix CUDA option not appearing on Linux due to preprocessor macro typo Nov 16, 2025
Copilot AI requested a review from umireon November 16, 2025 08:31
@umireon umireon mentioned this pull request Nov 16, 2025
1 task
@umireon umireon requested a review from royshil November 16, 2025 08:33
@umireon
Copy link
Collaborator

umireon commented Nov 16, 2025

@royshil review plz

Copy link
Owner

@royshil royshil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@umireon umireon marked this pull request as ready for review November 16, 2025 08:38
@umireon umireon merged commit 22367cb into main Nov 16, 2025
11 checks passed
sobalap pushed a commit to sobalap/obs-backgroundremoval that referenced this pull request Jan 7, 2026
…royshil#713)

* Initial plan

* Fix typo: HAVE_ONNXRUNTIME_CUDA_CP -> HAVE_ONNXRUNTIME_CUDA_EP

Co-authored-by: umireon <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: umireon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CUDA option not available on Linux

3 participants