OBS 27.2.4 and Nvidia Gforce GTX 1660Ti/1660 Super with Ubuntu 22.04

Filip S

Member
I have been running 21.10 for a while and using nvidia 470 driver and it was working fine.
Then I did a "do-upgrade" and everything looks OK running with 510.60.2 driver and it looks nice but it can record or stream
on the Ubuntu 21.10 it is working fine using h264 nvidia and CBR but on Ubuntu 22,04 is say streaming_h264 faild to open NVENC codec: unknown error.
Streamtype output '(null)' I even made a clean install after the upgrade just to make sure it was not because of som old Ubuntu 21.10 stuf.
I tried all the drivers from 450 and up but no lock and it looks like Ubuntu 22.04 LTS have some issues with OBS 27.2.4.

I have two computers with simular Graphics card one is NVIDIA GeForce GTX 1660 Super and the other is NVIDIA GeForce GTX 1660 Ti
they both have the same problem using Ubuntu 22.04 - but Ubuntu 21.10 is working using Nvidia 470.103.01 Driver so dont think its cpu
related - and the problem is only when I try to record or stream... can it be a bug in the current OBS 24.2.4 encodig part ?
 

Filip S

Member
I have tried all now also clean install to 22.04 - also all drivers to from 460 to envidia 515 on older Ubuntu 21.10 i was to run
current OBS 27.2.4 but if I upgrade to 22,04 its not working for me.


1:57:08.150: Initializing OpenGL...
11:57:08.339: Loading up OpenGL on adapter NVIDIA Corporation NVIDIA GeForce GTX 1660 SUPER/PCIe/SSE2
11:57:08.339: OpenGL loaded successfully, version 3.3.0 NVIDIA 470.129.06, shading language 3.30 NVIDIA via Cg compiler

Works fine with 21.10 but I was forced to upgrade as no update support for 21.10 is possible.
 

Neigdoig

New Member
Being that I used Mint, before now using Nobara (Fedora), I'll recommend changing back to the 470 drivers, as the 510 drivers are really for Wayland support, which I don't think would really do well for OBS as far as I know. That's my guess.

In addition to 22.04, I never tried 22.04 (nor will I be), so I don't know what to do there.
 

Filip S

Member
On Ubuntu 21.10 i am running nvidia 470 currently and also davincy resolve 18 with TU116 [GeForce GTX 1660 SUPER]

On 21.10 I can encode using h264_envec but on Ubuntu 22.04LTS - mint and PopOs its the same problem with encoding is broken.
Something is brokken and think the GTX 1660 will driver does not make encoding work like 470 drivers included in 21.10
so ffmpeg and OBS will fail also think maybe newer drivers will fail possible.

On TU116 [GeForce GTX 1660 Ti] on PopOs 22.04 with nvidia 470 is also broken so I really dont know what to do.

Recompile the ffmpeg maybe solve it even the OBS problem
- decoding works fine both h264 h256 but no outgoing encoding with hevc_envec or h264_nvenc
maybe the problem is realted to all TU116 cards on Linux ?

OK Maybe another distribution non ubuntu is a solution staying on 21.10 maybe even windows would be a solution maybe
 

Filip S

Member
Being that I used Mint, before now using Nobara (Fedora), I'll recommend changing back to the 470 drivers, as the 510 drivers are really for Wayland support, which I don't think would really do well for OBS as far as I know. That's my guess.

In addition to 22.04, I never tried 22.04 (nor will I be), so I don't know what to do there.
And the ffmpeg and OBS is working on newer Fedora ? Mint, Ubunto, PopOs are almost the same to me and I have not used fedora redhat for years so I am more used to Ubuntu but if encoding is working fine for you and what version of GTX 1660 do you use?
 

Neigdoig

New Member
Essentially, with Nobara, FFmpeg works out of the box for me with 470, but in a different thread, I can't install the iOS Camera Source plugin.
 

Filip S

Member
Essentially, with Nobara, FFmpeg works out of the box for me with 470, but in a different thread, I can't install the iOS Camera Source plugin.
Can you use larix broadcaster with and SRT as a workaround ?

21.10 also work for me and older from Ubuntu 18 - I even upgraded from a GTX 970 card to GTX 1660 TI for performace and I was able to use the nvenc and hevc but now it just the nvidia encoding is just disapering in the newer driver or is not working anymore.

I only upgraded because Ubuntu 21.10 Impish Indri has reached End of Life (EOL) and hoped the driver problems was solved while I was keeping the 21.10 also 21.10 did work with SRT as the libsrt1.4.was included on 21.04 and 20.04 I needed to compile srt for ffmpeg as it was not included but my gtx 1660 cards should not already be to old also both the nvidia-450,460,470 is working on Ubuntu 21.10
Also I have enjoyed the nvidia encoding in kdenlive rendering.

I do run 21.10 with obs27.2.4 and Davincy Resolve 18 (free version) is running but I need to translate my canon files before import as a limit in the free Davincy resolve while this is not needed with kdenlive it just handle the video files from gopro8 and canon.

I have always tried to use Linux solution and now mainly debian because I use Raspberry PI also with SRT and elgato camlink for portable streaming to my OBS using the h264 OMX encoding is working working perfect also for my need, sure its possible to run other distrubutions on raspberry also but i am just used to debian but I will change if nvidia support is better on maybe Nobara/fedora.

I really can't buy never expensive hardware and this also a reason why I use Linux and normally I can find a solution but 22.04 LTS OBS says I should update my drivers as it cant use the envidia encoding any more even if it have been available in older cards two.

If a hardware upgrade is needed then I am not sure I would pick nvidia and normally it is possible to fint solutions in the community.
 

Neigdoig

New Member
Being that I have a 2060 with 470, the drivers don't treat me too bad. I did try my hand at one of those apps like that (I think Iriun, but didn't really like it). I haven't tried Larix, so you'd have to test that yourself. Could it be Wayland causing you issues? I know that Wayland doesn't work for me (mainly because I'm a little dumb in how Wayland is supposed to work)
 

Filip S

Member
Oh this just bad it can't even install the 21.10 because the repository cant be updated anymore and Ubuntu 22.04 nvidia encoding is not working for me like it used to work on 21.10 with nvidia driver so i am stuck with nvidia 1660 card where all works but NO GPU encoding is not working anymore - I would really like to know if anyone is running with Linux with gforce gtx 1660 TU116 where encoding is working ?

I have another pc where I am running NVIDIA GeForce GTX 1660 SUPER on Ubuntu 21.10 on this I can run envec encoding
and it runs | NVIDIA-SMI 470.129.06 Driver Version: 470.129.06 CUDA Version: 11.4 but no new updates possible anymore.
I am sure if I install 22.04 on this computer I will get a solution where h264_nvenc encoding is gone and not working with ffmpeg/obs.

I am stock and I cant go back to Ubuntu 21.10 that used to work as sudo apt install v4l2loopback-dkms is not possible.

I feel its like nvidia just whats people to buy newer hardware when the envec encoding is gone.
With newer 22.04 I can run newer nvidia 515 and all looks fine but without h264_nvenc encoding.

warning: [NVENC encoder: ‘streaming_h264’] Failed to open NVENC codec: Unknown error occurred

I have really tried alot to solve the problem but what can I do now ? change to Windows 10 installation maybe or any way to use a old reposititori but it looks like its closed down - just to make sure my problem is not hardware related I installed windows 10 and nvidia 516 driver and it can do the hardware encoding so we have bug related to the driver on Linux.
 

Filip S

Member
Today I did update the old ubuntu 21.10 with never popos 22.04 + nvidia 515 driver - a clean install and now it works for me obs+kdenlive+DavinciResolve 18 - using gpu power on gtx 1660 super - this my main work station - the other 12 years old computer with Amd phenom cpu and simular gtx 1660 is now running windows 10 pro and I will try to install the restreamer on both systems. The cpu is old so gpu power is needed. The now popOS looks very nice by the way
2e41bfdeba797283ee9da9bb439c3ece.svg
I can't run NDI on the old cpu but teleport maybe a usefull solution in some cases. I hope to run the restreamer on the old computer now with windows where the hardward enconding does work with windows but not if I try to run Ubuntu 22.04 but i used windows if i am really force todo it. By the way the restreamer I am speakting about is a docker solution is great https://github.com/datarhei/restreame
 

Filip S

Member
Well the other computer with NVIDIA GeForce GTX 1660 TI was "solved" by installing Windows 10 - not the best solution so the computer with PopOS 22.04 and GTX 1660 Super is solved - almost ;)

I also needed acces to GPU powers using

docker run -d --restart=always --name restreamer \ -p 8080:8080 -p 8181:8181 -p 1935:1935 -runtime=nvidia --privileged \ datarhei/restreamer:cuda-latest


Anyway I have the same problem with missing cuda on both regular Linux and the wsl2
 

Filip S

Member
I run restreamer on Linux, On WSL2 and my RaspberryPI4 (Raspbian 32bit with gpu) but on the other I only use passtru to avoid GPU encoding but its a problem the cpu load is around 75% and sure it would be alot cooler if the hardware encoding was working for me.


I now use GTX1660TI (windows wsl2) and GTX1660 super with latest nvidia drivers on PopOS(Ubuntu 22.04)

- OBS works fine and Davici resolve 18 can render video etc. but for some reason restreamer needs alot more to run with hardware gpu ?

For some reason it depends cuda something API but I am stuck because why is cuda needed by restreamer when other programs can do encoding/deconding ?

I need a guide on howto add the cuda support and possible simular for

Using nvidia-smi get something that says cuda 11.7

Sun Sep 18 11:02:34 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... Off | 00000000:02:00.0 Off | N/A |
| 5% 53C P8 24W / 125W | 662MiB / 6144MiB | 27% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+


Simular nvidia-smi
On my wsl2 it says Driver 516.94 also cuda 11.7

I did find a guide to install cuda (tool kit)


After that i installed restreamer for nvidia and but is it possible that it only works with cuda 11.4 and not 11.7 ?


I get the following errors

@1663619792 Duration: N/A, start: 373.607667, bitrate: N/A
@1663619792 Program 0
@1663619792 Metadata:
@1663619792 variant_bitrate : 4793958
@1663619792 Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
@1663619792 Metadata:
@1663619792 variant_bitrate : 4793958
@1663619792 Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
@1663619792 Metadata:
@1663619792 variant_bitrate : 4793958
@1663619792 [AVHWDeviceContext] Cannot load libcuda.so.1
@1663619792 [AVHWDeviceContext] Could not dynamically load CUDA
@1663619792 Device creation failed: -1313558101.
@1663619792 [h264 ] No device available for decoder: device type cuda needed for codec h264.
@1663619792 Stream mapping:

Anyway the restreamer works fine if I avoid hardware encoding/decoding - passtru works fine for my owncast, youtube+facebook streams.
 
Top