Question / Help Hardware Encoding Not Available? (Ubuntu 19.10 w/ Nvidia)

rdegges

New Member
Hi all. I loveeee OBS. It's been amazing for recording tech videos and screencasts.

I recently upgraded from Ubuntu 19.04 -> 19.10, and ever since then I haven't been able to get OBS to recognize my Nvidia card and support hardware encoding. If I go to settings -> output -> encoder and select the dropdown, the only option available is Software (x264). Here's a picture:

Screenshot from 2019-12-20 14-33-03.png


I've tried just about everything I can think of to get the hardware encoding option to show up like it used to:

- I formatted my computer fresh using stock Ubuntu 19.10
- I double-checked that I am using the proper Nvidia drivers and that they are actually in-use (they are)

But no matter what I try, I can't get OBS to recognize my GPU and support hardware encoding in Ubuntu 19.10 :(

Do you have any ideas/suggestions for me as to how I can get this to work?

I really need to get hardware encoding working as I'm currently unable to record from my webcam (a Logitech 4k webcam) with a reasonable framerate using only the software encoder. This makes my videos look terrible because while audio is being recorded fine, the video isn't in-sync since the framerate is so low. When I was previously on Ubuntu 19.04 this wasn't an issue at all (same hardware) as I had the hardware encoding working and things were 100% great!

Here are my computer specs and some troubleshooting information as well.

- Video Card: nVidia GeForce GTX 1070 TI
- Processor: Intel Core i7-6700K CPU @ 4.00GHz x 8
- RAM: 64GB

Here's the output from me running the nvidia-smi command on the terminal, it shows that my GPU is being used properly as other applications (Xorg, gnome, etc.) are using it:

Screenshot from 2019-12-20 14-55-16.png


Here's the output of the ubuntu-drivers devices command, which shows what version of driver I'm using for my nVidia card: (NOTE: the driver I'm using is the proprietary nvidia 435 driver currently)

Screenshot from 2019-12-20 14-56-52.png


Anyhow, any help would be appreciated!
 

Harold

Active Member
It's likely that the ffmpeg install that OBS is trying to use doesn't recognize nvenc support on your system.
 

Claytonus Prime

New Member
So is there anything that can be done to correct the issue? I'm having the exact same issues with a fresh install of Ubuntu19.10 on a system with a Radeon R2 240 Graphic card. Just installed OBS except in my case I downloaded from the Ubuntu Software center. Nonetheless, my OBS encoder options only show (software) x264. No hardware options.
 

Claytonus Prime

New Member
I've been continuing to try to find the source of my problems. One possibility is that the drivers available on the AMD website only go up to 18.04. On other forums, people have said that I don't need the proprietary drivers because Ubuntu comes with adequate graphics drivers for my card, but I suspect thats not true.

I did uninstall OBS, then I installed ffmpeg, added the PPA to my repositories and installed OSB just as directed here:
https://obsproject.com/wiki/install-instructions#linux

Unfortunately, the problem persists. I got to Settings: Output/ Streaming/ Encoder and the only option available is "Software (x264)"

Here are my system specs:
3.5 GHz Ryzen 3 2300U
RAM 8 GB DDR4
Memory Speed 2400 MHz
Hard Drive 1 TB Hybrid Drive
Graphics Coprocessor Radeon R7 240
Chipset Brand AMD
Card Description Dedicated
Graphics Card Ram Size 2 GB

Unfortunately a look at my drivers devices shows nothing for the graphics card:

clay@Darth-Buntu:~$ ubuntu-drivers devices​
== /sys/devices/pci0000:00/0000:00:01.3/0000:01:00.2/0000:02:06.0/0000:04:00.0 ==​
modalias : pci:v00008086d000024FBsv00008086sd00002110bc02sc80i00​
vendor : Intel Corporation​
model : Dual Band Wireless-AC 3168NGW [Stone Peak]​
manual_install: True​
driver : backport-iwlwifi-dkms - distro free​

Further research confirms that the AMD drivers do not work for Ubuntu 19.10. So my question at this point is this-
Do I just suck it up and install Ubuntu 18.04? or is there some other option that I don't know about?

(Sorry this post is so long, and thank you for your help!)
 

Tuna

Member
Check via "vainfo" tool what VAAPI modes are supported. If you see something like "VAProfileH264Main : VAEntrypointEncSliceLP" your driver setup is okay. If not you need to fix that.

On OBS you can only select the hardware encoder via advanced mode and selecting FFMPEG VAAPI. It will never show up as an option in the simple configuration mode.
 

Claytonus Prime

New Member
So here's what I got from vainfo:

clay@Darth-Buntu:~$ vainfo​
libva info: VA-API version 1.5.0​
libva info: va_getDriverName() returns 0​
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so​
libva info: Found init function __vaDriverInit_1_5​
libva info: va_openDriver() returns 0​
vainfo: VA-API version: 1.5 (libva 2.5.0)​
vainfo: Driver version: Mesa Gallium driver 19.2.1 for AMD OLAND (DRM 2.50.0, 5.3.0-24-generic, LLVM 9.0.0)​
vainfo: Supported profile and entrypoints​
VAProfileMPEG2Simple : VAEntrypointVLD​
VAProfileMPEG2Main : VAEntrypointVLD​
VAProfileVC1Simple : VAEntrypointVLD​
VAProfileVC1Main : VAEntrypointVLD​
VAProfileVC1Advanced : VAEntrypointVLD​
VAProfileH264ConstrainedBaseline: VAEntrypointVLD​
VAProfileH264Main : VAEntrypointVLD​
VAProfileH264High : VAEntrypointVLD​
VAProfileNone : VAEntrypointVideoProc​

After looking it up it looks like my card is capable of encoding these formats, but it it doesn't look like it currently is. Am I interpreting that right?

I did find the FFMPEG VAAPI option under the advanced setting just like you said (Thank you!) but now when I try to record I get the following error:
Screenshot from 2020-01-01 14-01-47.png


The end of my output log looks like this:

01:51:25 PM.389: ---------------------------------​
01:51:25 PM.389: [FFMPEG VAAPI encoder: 'streaming_h264'] settings:​
01:51:25 PM.389: device: /dev/dri/renderD128​
01:51:25 PM.389: qp: 20​
01:51:25 PM.389: quality: 0​
01:51:25 PM.389: profile: 578​
01:51:25 PM.389: level: 40​
01:51:25 PM.389: bitrate: 2500​
01:51:25 PM.389: keyint: 60​
01:51:25 PM.389: width: 1280​
01:51:25 PM.389: height: 720​
01:51:25 PM.389: b-frames: 0​
01:51:25 PM.389:​
01:51:25 PM.405: [FFMPEG VAAPI encoder: 'streaming_h264'] Failed to open VAAPI codec: Function not implemented​

Any thoughts? I'm trying hard not to develop a severe inferiority complex over how foreign all of this seems to me. Thanks again for the help.
 

Tuna

Member
I'm afraid it looks to me that this cards does not have encoding capabilities. At least in its current form. The format listed are all DECODING methods. So the card can decode videos on the GPU, but does not list an ENCODER method.
 

Claytonus Prime

New Member
Well that is disappointing. Blargh! Okay. Thanks for all the help. Looks like i'll have to do a lot more research to see if I can come up with some kind of solution. Thanks again.
 
Top