obs-nvenc: Fix GPU selector visibility on dual-GPU systems
Description
This change ensures the GPU (encoder device) selector is visible whenever at least one compatible device is detected, rather than requiring two or more devices.
Motivation and Context
Problem: On systems where a previously saved GPU encoder device has been removed or disabled, OBS returns a CUDA_ERROR_INVALID_DEVICE error when attempting to stream or record. In dual-GPU configurations, the device selector dropdown not appear, leaving users unable to select the remaining valid GPU through the UI.
How Has This Been Tested?
Not a breaking change, but tested the build on a dual-GPU setup with Windows 11 Professional (x64) Build 26100.7171 (24H2)
Types of changes
Checklist:
- [x] My code has been run through clang-format.
- [x] I have read the contributing document.
- [x] My code is not on the master branch.
- [x] The code has been tested.
- [x] All commit messages are properly formatted and commits squashed where appropriate.
- [ ] I have included updates to all appropriate documentation.
Is the general reproduction here that both GPUs are Nvidia to start, and then later aren't? Or that both GPUs are Nvidia and one is disabled via Device Manager?
Is the general reproduction here that both GPUs are Nvidia to start, and then later aren't? Or that both GPUs are Nvidia and one is disabled via Device Manager?
- System has 2 NVIDIA GPUs installed (GPU1 at index 0, GPU2 at index 1)
- OBS encoder is configured to use GPU2 (index 1)
- GPU2 is physically removed from motherboard OR disabled in Device Manager
- System restarts, OBS starts
GPU selector becomes invisible/hidden in UI, but OBS still attempts to use GPU2 (index 1) for encoding