OBS keeps using Intel graphics instead of Nvidia

aidanii

New Member
Hello!

I've been struggling to get OBS use Nvidia graphics for a while now, just so I can try out using Nvenc. Regardless of whether I choose to use Hybrid or Nvidia Graphics, OBS keeps using the Intel one. Because of this, OBS will fallback to a different format, disregarding Nvenc. Any help would be appreciated.

Here's more details about my setup:
OBS 30.2.3 (Flathub)
Fedora 40 KDE Plama 6.1.4
Wayland
NVIDIA GeForce RTX 3050 Laptop GPU
 

Attachments

  • 2024-09-01 13-01-16.txt
    16.9 KB · Views: 17

AaronD

Active Member
Is the container biting you? Install native, and see if that works.

Containers, like snap, flatpak, docker, etc., are meant for security, privacy, and portability. They make it difficult, on purpose, to access system resources, as part of that security. That's fine for things that are self-contained anyway and don't need to use external stuff, and it's possible to grant enough permissions to allow a (formerly, at that point) containerized app to use the actual hardware. But by the time you jump through enough hoops to make that work, you've pretty well nullified the purpose of the container, and kept the downsides.

Don't use containers for OBS. Always install it native.
 

aidanii

New Member
Thank you for your response.

I see flatpaks are not the way to go then. I somewhat remember installing it from Fedora repositories, though I forget if it really was their Flathub or their non-flathub repository. I'll double check when I get home later and can try it out.
 

aidanii

New Member
Hello!

I've just removed the Flatpak version, and downloaded straight from Fedora's repositories. I followed the instructions from "https://github.com/obsproject/obs-studio/wiki/unofficial-linux-builds#fedora" and as far as I can tell, it shouldn't be containerized? Still though, the problem persists. Using Envycontrol to switch between Hybrid and Nvidia, in both cases OBS still uses the Intel Mesa graphics. I've attached the log files generated from both tests.
 

Attachments

  • 2024-09-03 08-22-37.txt
    16.9 KB · Views: 16
  • 2024-09-03 08-26-58.txt
    16.9 KB · Views: 8

AaronD

Active Member
I've just removed the Flatpak version, and downloaded straight from Fedora's repositories. I followed the instructions from "https://github.com/obsproject/obs-studio/wiki/unofficial-linux-builds#fedora" and as far as I can tell, it shouldn't be containerized?
I wouldn't think so. But I'm not familiar with Fedora either, so I can't tell for sure.

I'm on Ubuntu Studio, and it "just works" here...provided of course, that the hardware is still supported. My 2015 Mobile Workstation has a no-longer-supported GPU, which I found out when a recording session crashed. My other UStudio rigs are running just fine.

Still though, the problem persists. Using Envycontrol to switch between Hybrid and Nvidia, in both cases OBS still uses the Intel Mesa graphics.
I'm not really sure what's going on then. According to the logs, it appears to see what you want to use:
08:22:38.629: Available Encoders:
08:22:38.629: Video Encoders:
08:22:38.629: - ffmpeg_openh264 (OpenH264)
08:22:38.629: - ffmpeg_svt_av1 (SVT-AV1)
08:22:38.629: - ffmpeg_aom_av1 (AOM AV1)
08:22:38.629: - jim_nvenc (NVIDIA NVENC H.264)
08:22:38.629: - jim_hevc_nvenc (NVIDIA NVENC HEVC)
08:22:38.629: - jim_av1_nvenc (NVIDIA NVENC AV1)
08:22:38.629: - ffmpeg_vaapi_tex (FFmpeg VAAPI H.264)
08:22:38.629: - hevc_ffmpeg_vaapi_tex (FFmpeg VAAPI HEVC)
08:22:38.629: - obs_qsv11_v2 (QuickSync H.264)
08:22:38.629: - obs_qsv11_hevc (QuickSync HEVC)
08:22:38.629: - obs_x264 (x264)
08:22:38.629: Audio Encoders:
08:22:38.629: - ffmpeg_aac (FFmpeg AAC)
08:22:38.629: - ffmpeg_opus (FFmpeg Opus)
08:22:38.629: - ffmpeg_pcm_s16le (FFmpeg PCM (16-bit))
08:22:38.629: - ffmpeg_pcm_s24le (FFmpeg PCM (24-bit))
08:22:38.629: - ffmpeg_pcm_f32le (FFmpeg PCM (32-bit float))
08:22:38.629: - ffmpeg_alac (FFmpeg ALAC (24-bit))
08:22:38.629: - ffmpeg_flac (FFmpeg FLAC (16-bit))
08:22:38.629: - libfdk_aac (libfdk AAC)
but for some reason it's not?

I've attached the log files generated from both tests.
Can you upload those to the automated Analyzer and see what it says? Link in my signature. I don't expect much from that, but I've been surprised before.
 

aidanii

New Member
I've put the logs on the analyzer and it showed no critical or warning messages. It simply just returned the plugins I have, which is linux-vkcapture and obs-webkitgtk.
 

AaronD

Active Member
I've put the logs on the analyzer and it showed no critical or warning messages. It simply just returned the plugins I have, which is linux-vkcapture and obs-webkitgtk.
Okay. So you're probably doing everything else right too.

I'm stumped. I keep thinking that this must be a clue, but I can't think of where it would lead:
Regardless of whether I choose to use Hybrid or Nvidia Graphics, OBS keeps using the Intel one. Because of this, OBS will fallback to a different format, disregarding Nvenc.
Maybe someone else will come across this thread, who knows better?

Sorry I couldn't solve it.
 

aidanii

New Member
Its alright. I hope someone else can help as well. In the meantime, maybe I should also ask this on Fedora forums as well and see if they might figure it out.

I do have some inkling of what else I could try though. I've been trying to search the threads here before I sent this question, and a few (I can't remember which ones unfortunately) have led me to believe my Desktop Environment?/OS? has to run on the GPU too for OBS to use it. But just like OBS, my DE/OS won't run on Nvidia either regardless of what I set Envycontrol to make it use. All the more reason to ask on Fedora forums I suppose. This conclusion isn't rooted in solid evidence though, so I'll just have to see where it gets me.

Thanks again for your time. I'll update here if I ever solve it. And if anyone else has an idea for what could work, it'll be greatly appreciated as well.
 

aidanii

New Member
Hello! I have finally resolved the problem.

While playing a game that was too weak for the system to be automatically offloaded but too heavy for the iGPU, it reminded me that I can use environment variables to offload applications to the GPU. Though I seem to struggle pulling it off for the game, launching obs with the environment variables of __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia [I]command[/I] managed to solve the issue, as the logs now properly say that it loads the Nvidia GPU, and no fallback action occurs. The command comes from the this page of the Arch Wiki regarding PRIME.
 

Attachments

  • 2024-09-09 20-46-29.txt
    22.3 KB · Views: 7
Top