OBS Studio NVENC Seg Fault

I'm having issues with using OBS and NVENC. I used to be able to record using obs-studio and hardware encoding. At some point OBS was removed from my system automatically and I reinstalled yesterday. Now, if I attempt to start recording using NVENC, OBS will seg fault and exit immediately. There are no errors or anything of interest in the OBS logs. I get the same crash regardless of what I'm trying to record. It will even crash on a completely empty scene. I'm thinking there might be some driver conflicts. Has anybody else experienced something similar or found a solution?

core dump:

Aug 06 16:56:58 canis-majoris systemd[1]: Started Process Core Dump (PID 11122/UID 0).
Aug 06 16:56:58 canis-majoris audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@3-11122-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? termi>
Aug 06 16:56:58 canis-majoris kernel: audit: type=1130 audit(1565125018.466:79): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@3-11122-0 comm="systemd" exe="/usr/lib/systemd/syste>
Aug 06 16:56:59 canis-majoris systemd-coredump[11123]: Process 11108 (obs) of user 1000 dumped core.
                                                       
                                                       Stack trace of thread 11108:
                                                       #0  0x00007f6019ce70c0 n/a (libnvcuvid.so.1)
                                                       #1  0x00007f6019cce355 n/a (libnvcuvid.so.1)
                                                       #2  0x00007f6019cbbf75 n/a (libnvcuvid.so.1)
                                                       #3  0x00007f6019cbca68 n/a (libnvcuvid.so.1)
                                                       #4  0x00007f6019d30eec n/a (libnvcuvid.so.1)
                                                       #5  0x00007f6019d31599 n/a (libnvcuvid.so.1)
                                                       #6  0x00007f601a1deb97 n/a (libnvidia-encode.so.1)
                                                       #7  0x00007f601a1e00a4 n/a (libnvidia-encode.so.1)
                                                       #8  0x00007f601a1e1736 n/a (libnvidia-encode.so.1)
                                                       #9  0x00007f601a1dc99a n/a (libnvidia-encode.so.1)
                                                       #10 0x00007f601a1ebe59 n/a (libnvidia-encode.so.1)
                                                       #11 0x00007f604e864232 n/a (libavcodec.so.58)
                                                       #12 0x00007f604e865af4 n/a (libavcodec.so.58)
                                                       #13 0x00007f604ee8a80f avcodec_open2 (libavcodec.so.58)
                                                       #14 0x00007f60272138ff n/a (obs-ffmpeg.so)
                                                       #15 0x00007f604dd4af3f obs_encoder_initialize (libobs.so.0)
                                                       #16 0x00007f604dd5eafd obs_output_initialize_encoders (libobs.so.0)
                                                       #17 0x00007f6027218073 n/a (obs-ffmpeg.so)
                                                       #18 0x00007f604dd5d48d obs_output_actual_start (libobs.so.0)
                                                       #19 0x00007f604dd5d5e3 obs_output_start (libobs.so.0)
                                                       #20 0x0000565273eef21a _ZN12SimpleOutput14StartRecordingEv (obs)
                                                       #21 0x0000565273e496cc _ZN8OBSBasic14StartRecordingEv (obs)
                                                       #22 0x0000565273e21975 n/a (obs)
                                                       #23 0x0000565273e253a3 _ZN8OBSBasic11qt_metacallEN11QMetaObject4CallEiPPv (obs)
                                                       #24 0x00007f604d4bcacd _ZN11QMetaObject8activateEP7QObjectiiPPv (libQt5Core.so.5)
                                                       #25 0x00007f604e00a663 _ZN15QAbstractButton7clickedEb (libQt5Widgets.so.5)
                                                       #26 0x00007f604e00a88c n/a (libQt5Widgets.so.5)
                                                       #27 0x00007f604e00bc92 n/a (libQt5Widgets.so.5)
                                                       #28 0x00007f604e00be56 _ZN15QAbstractButton17mouseReleaseEventEP11QMouseEvent (libQt5Widgets.so.5)
                                                       #29 0x00007f604df54cb6 _ZN7QWidget5eventEP6QEvent (libQt5Widgets.so.5)
                                                       #30 0x00007f604df114d5 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5)
                                                       #31 0x00007f604df1ac6c _ZN12QApplication6notifyEP7QObjectP6QEvent (libQt5Widgets.so.5)
                                                       #32 0x00007f604d4909c2 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5)
                                                       #33 0x00007f604df19d4b _ZN19QApplicationPrivate14sendMouseEventEP7QWidgetP11QMouseEventS1_S1_PS1_R8QPointerIS0_Ebb (libQt5Widgets.so.5)
                                                       #34 0x00007f604df71211 n/a (libQt5Widgets.so.5)
                                                       #35 0x00007f604df74154 n/a (libQt5Widgets.so.5)
                                                       #36 0x00007f604df114d5 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5)
                                                       #37 0x00007f604df1aa21 _ZN12QApplication6notifyEP7QObjectP6QEvent (libQt5Widgets.so.5)
                                                       #38 0x00007f604d4909c2 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5)
                                                       #39 0x00007f604d82c789 _ZN22QGuiApplicationPrivate17processMouseEventEPN29QWindowSystemInterfacePrivate10MouseEventE (libQt5Gui.so.5)
                                                       #40 0x00007f604d82e05b _ZN22QGuiApplicationPrivate24processWindowSystemEventEPN29QWindowSystemInterfacePrivate17WindowSystemEventE (libQt5Gui.so.5)
                                                       #41 0x00007f604d80637c _ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Gui.so.5)
                                                       #42 0x00007f6044c2cfec n/a (libQt5XcbQpa.so.5)
                                                       #43 0x00007f6047f97cf4 g_main_context_dispatch (libglib-2.0.so.0)
                                                       #44 0x00007f6047f99b11 n/a (libglib-2.0.so.0)
                                                       #45 0x00007f6047f99b51 g_main_context_iteration (libglib-2.0.so.0)
                                                       #46 0x00007f604d4e89a3 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5)
                                                       #47 0x00007f604d48f5ec _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5)
                                                       #48 0x00007f604d497326 _ZN16QCoreApplication4execEv (libQt5Core.so.5)
                                                       #49 0x0000565273e1d548 main (obs)
                                                       #50 0x00007f604ccf9ee3 __libc_start_main (libc.so.6)
                                                       #51 0x0000565273e1e3ce _start (obs)
                                                       
                                                       Stack trace of thread 11118:
                                                       #0  0x00007f604cdc4667 __poll (libc.so.6)
                                                       #1  0x00007f6048991673 n/a (libpulse.so.0)
                                                       #2  0x00007f6048982990 pa_mainloop_poll (libpulse.so.0)
                                                       #3  0x00007f6048982fe0 pa_mainloop_iterate (libpulse.so.0)
                                                       #4  0x00007f6048983091 pa_mainloop_run (libpulse.so.0)
                                                       #5  0x00007f60489915ae n/a (libpulse.so.0)
                                                       #6  0x00007f6046f779fc n/a (libpulsecommon-12.2.so)
                                                       #7  0x00007f604ce9f57f start_thread (libpthread.so.0)
                                                       #8  0x00007f604cdcf0e3 __clone (libc.so.6)
                                                       
                                                       Stack trace of thread 11114:
                                                       #0  0x00007f604cea9145 __nanosleep (libpthread.so.0)
                                                       #1  0x00007f604dd4604d os_sleepto_ns (libobs.so.0)
                                                       #2  0x00007f604dd8b05b obs_graphics_thread (libobs.so.0)
                                                       #3  0x00007f604ce9f57f start_thread (libpthread.so.0)
                                                       #4  0x00007f604cdcf0e3 __clone (libc.so.6)
                                                       
                                                       Stack trace of thread 11112:
                                                       #0  0x00007f604cd9c36d __nanosleep (libc.so.6)
                                                       #1  0x00007f604cdc76e9 usleep (libc.so.6)
                                                       #2  0x00007f604dd33345 n/a (libobs.so.0)
                                                       #3  0x00007f604ce9f57f start_thread (libpthread.so.0)
                                                       #4  0x00007f604cdcf0e3 __clone (libc.so.6)
                                                       
                                                       Stack trace of thread 11121:
                                                       #0  0x00007f604cea57ca pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0)
                                                       #1  0x00007f601a865be7 n/a (libcuda.so.1)
                                                       #2  0x00007f601a80b257 n/a (libcuda.so.1)
                                                       #3  0x00007f601a864e68 n/a (libcuda.so.1)
                                                       #4  0x00007f604ce9f57f start_thread (libpthread.so.0)
                                                       #5  0x00007f604cdcf0e3 __clone (libc.so.6)
                                                       
                                                       Stack trace of thread 11109:
                                                       #0  0x00007f604cdc4667 __poll (libc.so.6)
                                                       #1  0x00007f604784b630 n/a (libxcb.so.1)
                                                       #2  0x00007f604784d2db xcb_wait_for_event (libxcb.so.1)
                                                       #3  0x00007f6044c2c049 n/a (libQt5XcbQpa.so.5)
                                                       #4  0x00007f604d2c3520 n/a (libQt5Core.so.5)
                                                       #5  0x00007f604ce9f57f start_thread (libpthread.so.0)
                                                       #6  0x00007f604cdcf0e3 __clone (libc.so.6)
                                                       
                                                       Stack trace of thread 11120:
                                                       #0  0x00007f604cdc4667 __poll (libc.so.6)
                                                       #1  0x00007f601a8627f3 n/a (libcuda.so.1)
                                                       #2  0x00007f601a8eb06d n/a (libcuda.so.1)
                                                       #3  0x00007f601a864e68 n/a (libcuda.so.1)
                                                       #4  0x00007f604ce9f57f start_thread (libpthread.so.0)
                                                       #5  0x00007f604cdcf0e3 __clone (libc.so.6)
                                                       
                                                       Stack trace of thread 11113:
                                                       #0  0x00007f604cea7d16 do_futex_wait.constprop.0 (libpthread.so.0)
                                                       #1  0x00007f604cea7e18 __new_sem_wait_slow.constprop.0 (libpthread.so.0)
                                                       #2  0x00007f604dd31ccd n/a (libobs.so.0)
                                                       #3  0x00007f604ce9f57f start_thread (libpthread.so.0)
                                                       #4  0x00007f604cdcf0e3 __clone (libc.so.6)
                                                       
                                                       Stack trace of thread 11110:
                                                       #0  0x00007f604cea57ca pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0)
                                                       #1  0x00007f604dd4550c os_event_timedwait (libobs.so.0)
                                                       #2  0x00007f604dd76076 obs_hotkey_thread (libobs.so.0)
                                                       #3  0x00007f604ce9f57f start_thread (libpthread.so.0)
                                                       #4  0x00007f604cdcf0e3 __clone (libc.so.6)
                                                       
                                                       Stack trace of thread 11115:
                                                       #0  0x00007f604cea7d16 do_futex_wait.constprop.0 (libpthread.so.0)
                                                       #1  0x00007f604cea7e18 __new_sem_wait_slow.constprop.0 (libpthread.so.0)
                                                       #2  0x00007f6040147230 n/a (libobs-scripting.so)
                                                       #3  0x00007f604ce9f57f start_thread (libpthread.so.0)
                                                       #4  0x00007f604cdcf0e3 __clone (libc.so.6)
                                                       
                                                       Stack trace of thread 11111:
                                                       #0  0x00007f604cdc4667 __poll (libc.so.6)
                                                       #1  0x00007f6047f99a80 n/a (libglib-2.0.so.0)
                                                       #2  0x00007f6047f99b51 g_main_context_iteration (libglib-2.0.so.0)
                                                       #3  0x00007f604d4e89a3 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5)
                                                       #4  0x00007f604d48f5ec _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5)
                                                       #5  0x00007f604d2c22f5 _ZN7QThread4execEv (libQt5Core.so.5)
                                                       #6  0x00007f6044b3cb37 n/a (libQt5DBus.so.5)
                                                       #7  0x00007f604d2c3520 n/a (libQt5Core.so.5)
                                                       #8  0x00007f604ce9f57f start_thread (libpthread.so.0)
                                                       #9  0x00007f604cdcf0e3 __clone (libc.so.6)
                                                       
                                                       Stack trace of thread 11119:
                                                       #0  0x00007f604cdd0aa0 accept4 (libc.so.6)
                                                       #1  0x00007f601a86379a n/a (libcuda.so.1)
                                                       #2  0x00007f601a855a9d n/a (libcuda.so.1)
                                                       #3  0x00007f601a864e68 n/a (libcuda.so.1)
                                                       #4  0x00007f604ce9f57f start_thread (libpthread.so.0)
                                                       #5  0x00007f604cdcf0e3 __clone (libc.so.6)
Aug 06 16:56:59 canis-majoris systemd[1]: systemd-coredump@3-11122-0.service: Succeeded.

It's also worth noting that I can perform software encoding (x264) without crashing and I'm unable to use the obs-studio-git AUR package because it fails to install with the message "/usr/lib64 already exists"

Provide:
inxi -Fxxxz --no-host
so we know what GPU model and what drivers you installed ...

Graphics:  Device-1: NVIDIA GK110B [GeForce GTX TITAN Black] vendor: eVga.com. driver: nvidia v: 430.26 
           bus ID: 01:00.0 chip ID: 10de:100c 
           Display: x11 server: X.org 1.20.5 driver: nvidia resolution: <xdpyinfo missing> 
           OpenGL: renderer: GeForce GTX TITAN Black/PCIe/SSE2 v: 4.6.0 NVIDIA 430.26 direct render: Yes 

Been searching for a while and managed to find this: https://stackoverflow.com/questions/34628701/cant-titan-black-use-nvenc/34651193

But I don't really understand this and I'm not sure if it's related. It seems like it might be though.

NVENC is currently broken with nvidia 430 drivers.

https://devtalk.nvidia.com/default/topic/1054759/linux/nvenc-fails-on-latest-archlinux-nvidia-driver-430-14/

The only way to use nvenc is to use older drivers and kernels. The last working linux 4.19 driver for nvenc is linux419-nvidia-1:418.74-5 and linux419-4.19.45-1 from late May.

1 Like

I have no probs with nvenc with nvidia-430. And no probs with OBS in nvenc mode

So what is your solution for those who are having problems? This is a known bug acknowledged by a Nvidia developer.

No solution with no problem, just see that if you don't believe me

For infos

Graphics: Device-1: NVIDIA GM204 [GeForce GTX 970] vendor: CardExpert driver: nvidia v: 430.26 bus ID: 09:00.0
chip ID: 10de:13c2
Display: x11 server: X.Org 1.20.5 driver: nvidia compositor: marco v: 1.22.1 resolution: 1920x1080~60Hz
OpenGL: renderer: GeForce GTX 970/PCIe/SSE2 v: 4.6.0 NVIDIA 430.26 direct render: Yes

Now try recording something.

You just see in screenshot I'm on record...........

Recording is active

Démarrer l'enregistrement = Start recording
Arrêter l'enregistrement = Stop recording

No I don't see that. I see an option screen for preparing to record.

This video proving what I said: https://peertube.pcservice46.fr/videos/watch/db947bed-57d2-47be-8ab1-cb144ade3c21

From my own peertube instance

This does not prove these is no issue with 430 drivers and nvenc. It only proves you are not having this issue.

I just prove this issue not affecting everybody. This helps I think...

How does this help the people having segfaults?

It can just helps to track what is the Nvidia GPU families are affected

And why not trying to change these to the old version (from older drivers)

pacman -Qo /usr/lib/libnvcuvid.so.1
/usr/lib/libnvcuvid.so.1 appartient à nvidia-utils 1:430.26-1

pacman -Qo /usr/lib/libnvidia-encode.so.1
/usr/lib/libnvidia-encode.so.1 appartient à nvidia-utils 1:430.26-1

It is just cuda and encode, you can try to extract and rename libs from the old drivers to solve the bug.

This is an example from 340.xx

/usr/lib/libnvcuvid.so
/usr/lib/libnvcuvid.so.1
/usr/lib/libnvcuvid.so.340.107

It's just symbolic links from libnvcuvid.so.4xx.xx:

lrwxrwxrwx 1 root root 15 13 juin 14:09 libnvcuvid.so -> libnvcuvid.so.1
lrwxrwxrwx 1 root root 20 13 juin 14:09 libnvcuvid.so.1 -> libnvcuvid.so.430.26
-rwxr-xr-x 1 root root 3,2M 13 juin 14:09 libnvcuvid.so.430.26

Same for this: libnvidia-encode.so.4xx.xx

Proving which cards do or do not have issues seems pointless when Nvidia already knows there is a issue.

And copying libraries from different driver versions might work, but the simpler solution would be to just use the older drivers and wait for Nvidia fix it properly.

1 Like

and what about enhancement of this driver ?

Other than posting in that Nvidia forum thread that your particular card does not have issues, I do not know how you plan to contribute to closed-source drivers.

Even if someone could find a fix, it is unlikely Manjaro or any distro would maintain custom nvidia drivers. So the fixed driver(s) would have be distributed through unofficial sites or the AUR. Who is going to do all this?

You don't understand me, I said enhancements between the old and the new version of the drivers RELEASED. Downgrade can have a performance or stability impact for some games