flathub / com.obsproject.Studio

This repository is no longer used to build OBS. Issues should be reported at https://github.com/obsproject/obs-studio
https://github.com/obsproject/obs-studio
29 stars 21 forks source link

Unknown NVENC error with nvidia driver from Debian backports #83

Closed aidalgol closed 2 years ago

aidalgol commented 3 years ago

I have been able to successfully record with NVENC when using the nvidia drivers from Debian buster, but since upgrading to the newer version from buster-backports, OBS gives the following error when I press "Start recording".

Failed to open NVENC codec: Unknown error occurred

Please check your video drivers are up to date.

With the following logging on stdout:

Attempted path: share/obs/obs-studio/locale/en-US.ini
Attempted path: /app/share/obs/obs-studio/locale/en-US.ini
Attempted path: share/obs/obs-studio/locale.ini
Attempted path: /app/share/obs/obs-studio/locale.ini
Attempted path: share/obs/obs-studio/themes/Dark.qss
Attempted path: /app/share/obs/obs-studio/themes/Dark.qss
info: CPU Name: Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz
info: CPU Speed: 2879.575MHz
info: Physical Cores: 4, Logical Cores: 4
info: Physical Memory: 15991MB Total, 9166MB Free
info: Kernel Version: Linux 4.19.0-10-amd64
info: Distribution: "KDE Flatpak runtime" "5.14"
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.4
info: Portable mode: false
qt.svg: Cannot open file '/app/share/obs/obs-studio/themes/Dark/Close.svg', because: No such file or directory
qt.svg: Cannot open file '/app/share/obs/obs-studio/themes/Dark/Close.svg', because: No such file or directory
qt.svg: Cannot open file '/app/share/obs/obs-studio/themes/Dark/Popout.svg', because: No such file or directory
qt.svg: Cannot open file '/app/share/obs/obs-studio/themes/Dark/Popout.svg', because: No such file or directory
Attempted path: share/obs/obs-studio/themes/Dark/no_sources.svg
Attempted path: /app/share/obs/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_clicked()
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_destroyed()
QMetaObject::connectSlotsByName: No matching signal for on_actionGridMode_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_program_customContextMenuRequested(QPoint)
info: OBS 25.0.8 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
    samples per sec: 44100
    speakers:        2
info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter NVIDIA Corporation GeForce GTX 1070/PCIe/SSE2
info: OpenGL loaded successfully, version 3.3.0 NVIDIA 440.100, shading language 3.30 NVIDIA via Cg compiler
info: ---------------------------------
info: video settings reset:
    base resolution:   1920x1080
    output resolution: 1280x720
    downscale filter:  Bicubic
    fps:               30/1
    format:            NV12
    YUV mode:          601/Partial
info: NV12 texture support not available
info: Audio monitoring device:
    name: Default
    id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
info: No blackmagic support
info: NVENC supported
info: FFMPEG VAAPI supported
error: os_dlopen(/app//lib/obs-plugins/obs-ndi.so->/app//lib/obs-plugins/obs-ndi.so): /app//lib/obs-plugins/obs-ndi.so: cannot open shared object file: No such file or directory

warning: Module '/app//lib/obs-plugins/obs-ndi.so' not loaded
error: os_dlopen(/app//lib/obs-plugins/obs-v4l2sink.so->/app//lib/obs-plugins/obs-v4l2sink.so): /app//lib/obs-plugins/obs-v4l2sink.so: cannot open shared object file: No such file or directory

warning: Module '/app//lib/obs-plugins/obs-v4l2sink.so' not loaded
info: ---------------------------------
info:   Loaded Modules:
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-xdg-portal.so
info:     obs-x264.so
info:     obs-transitions.so
info:     obs-outputs.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-decklink.so
info:     linux-capture.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-ouput-ui.so
info: ---------------------------------
info: ==== Startup complete ===============================================
error: Service '' not found
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'pulseaudio 12.2'
info: pulse-input: Audio format: s16le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor'
info: [Loaded global audio device]: 'Desktop Audio'
info: xshm-input: Geometry 1920x1200 @ 0,0
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (XSHM)' (xshm_input)
info: ------------------------------------------------
Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /app/share/obs/obs-studio/images/overflow.png
info: adding 23 milliseconds of audio buffering, total audio buffering is now 23 milliseconds (source: Desktop Audio)

info: ---------------------------------
info: [NVENC encoder: 'simple_h264_stream'] settings:
    rate_control: CBR
    bitrate:      2500
    cqp:          0
    keyint:       250
    preset:       hq
    profile:      high
    width:        1280
    height:       720
    2-pass:       false
    b-frames:     2
    GPU:          0

[h264_nvenc @ 0x55ae9debf600] dl_fn->cuda_dl->cuInit(0) failed -> CUDA_ERROR_UNKNOWN: unknown error
warning: [NVENC encoder: 'simple_h264_stream'] Failed to open NVENC codec: Unknown error occurred
info: ==== Shutting down ==================================================
info: Switched to scene '(null)'
info: pulse-input: Stopped recording from 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor'
info: pulse-input: Got 1423 packets with 308250 frames
info: All scene data cleared
info: ------------------------------------------------
info: Freeing OBS context data
info: [Scripting] Total detached callbacks: 0
info: == Profiler Results =============================
info: run_program_init: 358.806 ms
info:  ┣OBSApp::AppInit: 1.457 ms
info:  ┃ ┗OBSApp::InitLocale: 0.657 ms
info:  ┗OBSApp::OBSInit: 336.246 ms
info:    ┣obs_startup: 24.922 ms
info:    ┗OBSBasic::OBSInit: 245.945 ms
info:      ┣OBSBasic::InitBasicConfig: 0.085 ms
info:      ┣OBSBasic::ResetAudio: 0.127 ms
info:      ┣OBSBasic::ResetVideo: 77.75 ms
info:      ┣OBSBasic::InitOBSCallbacks: 0.015 ms
info:      ┣OBSBasic::InitHotkeys: 0.047 ms
info:      ┣obs_load_all_modules: 104.259 ms
info:      ┃ ┣obs_init_module(decklink-ouput-ui.so): 0.52 ms
info:      ┃ ┣obs_init_module(frontend-tools.so): 72.759 ms
info:      ┃ ┣obs_init_module(image-source.so): 0.004 ms
info:      ┃ ┣obs_init_module(linux-capture.so): 0.305 ms
info:      ┃ ┣obs_init_module(linux-decklink.so): 0.14 ms
info:      ┃ ┣obs_init_module(linux-pulseaudio.so): 0.001 ms
info:      ┃ ┣obs_init_module(linux-v4l2.so): 0.001 ms
info:      ┃ ┣obs_init_module(obs-ffmpeg.so): 0.352 ms
info:      ┃ ┃ ┗nvenc_check: 0.286 ms
info:      ┃ ┣obs_init_module(obs-filters.so): 0.009 ms
info:      ┃ ┣obs_init_module(obs-libfdk.so): 0.001 ms
info:      ┃ ┣obs_init_module(obs-outputs.so): 0.001 ms
info:      ┃ ┣obs_init_module(obs-transitions.so): 0.005 ms
info:      ┃ ┣obs_init_module(obs-x264.so): 0 ms
info:      ┃ ┣obs_init_module(obs-xdg-portal.so): 11.51 ms
info:      ┃ ┣obs_init_module(rtmp-services.so): 0.487 ms
info:      ┃ ┗obs_init_module(text-freetype2.so): 0.008 ms
info:      ┣OBSBasic::ResetOutputs: 0.095 ms
info:      ┣OBSBasic::CreateHotkeys: 0.024 ms
info:      ┣OBSBasic::InitService: 1.042 ms
info:      ┣OBSBasic::InitPrimitives: 0.19 ms
info:      ┗OBSBasic::Load: 5.093 ms
info: obs_hotkey_thread(25 ms): min=0.068 ms, median=0.292 ms, max=3.329 ms, 99th percentile=3.133 ms, 100% below 25 ms
info: audio_thread(Audio): min=0 ms, median=0.042 ms, max=0.199 ms, 99th percentile=0.125 ms
info: obs_graphics_thread(33.3333 ms): min=0.538 ms, median=6.179 ms, max=26.581 ms, 99th percentile=11.008 ms, 100% below 33.333 ms
info:  ┣tick_sources: min=0.001 ms, median=4.51 ms, max=23.409 ms, 99th percentile=6.425 ms
info:  ┣output_frame: min=0.148 ms, median=0.535 ms, max=2.914 ms, 99th percentile=2.912 ms
info:  ┃ ┗gs_context(video->graphics): min=0.148 ms, median=0.534 ms, max=2.913 ms, 99th percentile=2.912 ms
info:  ┃   ┣render_video: min=0.058 ms, median=0.253 ms, max=2.65 ms, 99th percentile=1.488 ms
info:  ┃   ┃ ┗render_main_texture: min=0.048 ms, median=0.224 ms, max=2.629 ms, 99th percentile=1.468 ms
info:  ┃   ┗gs_flush: min=0.004 ms, median=0.018 ms, max=0.049 ms, 99th percentile=0.037 ms
info:  ┗render_displays: min=0.061 ms, median=0.772 ms, max=4.425 ms, 99th percentile=2.084 ms
info: =================================================
info: == Profiler Time Between Calls ==================
info: obs_hotkey_thread(25 ms): min=25.143 ms, median=25.373 ms, max=28.423 ms, 82.8897% within ±2% of 25 ms (0% lower, 17.1103% higher)
info: obs_graphics_thread(33.3333 ms): min=31.466 ms, median=33.332 ms, max=35.21 ms, 98.9848% within ±2% of 33.333 ms (0.507614% lower, 0.507614% higher)
info: =================================================
info: Number of memory leaks: 0
eszlari commented 3 years ago

@aidalgol Could you try the test build from the PR?

aidalgol commented 3 years ago

@eszlari It does not appear to fix the issue. I ran the command on the linked PR to install the test build...

$ flatpak install --user https://dl.flathub.org/build-repo/28101/com.obsproject.Studio.flatpakref

Then ran flatpak run com.obsproject.Studio to run OBS. This is the output of that run:

Attempted path: share/obs/obs-studio/locale/en-US.ini
Attempted path: /app/share/obs/obs-studio/locale/en-US.ini
Attempted path: share/obs/obs-studio/locale.ini
Attempted path: /app/share/obs/obs-studio/locale.ini
Attempted path: share/obs/obs-studio/themes/Dark.qss
Attempted path: /app/share/obs/obs-studio/themes/Dark.qss
info: CPU Name: AMD Ryzen 9 3950X 16-Core Processor
info: CPU Speed: 2195.357MHz
info: Physical Cores: 16, Logical Cores: 32
info: Physical Memory: 32126MB Total, 10455MB Free
info: Kernel Version: Linux 5.7.0-0.bpo.2-amd64
info: Distribution: "KDE Flatpak runtime" "5.14"
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.4
info: Portable mode: false
Attempted path: share/obs/obs-studio/themes/Dark/no_sources.svg
Attempted path: /app/share/obs/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_clicked()
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_destroyed()
QMetaObject::connectSlotsByName: No matching signal for on_actionGridMode_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_program_customContextMenuRequested(QPoint)
QMetaObject::connectSlotsByName: No matching signal for on_transitionRemove_clicked()
info: OBS 26.0.0 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
    samples per sec: 48000
    speakers:        2
info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter NVIDIA Corporation GeForce GTX 1070/PCIe/SSE2
info: OpenGL loaded successfully, version 3.3.0 NVIDIA 450.66, shading language 3.30 NVIDIA via Cg compiler
info: ---------------------------------
info: video settings reset:
    base resolution:   1920x1080
    output resolution: 1280x720
    downscale filter:  Bicubic
    fps:               30/1
    format:            NV12
    YUV mode:          709/Partial
info: NV12 texture support not available
info: Audio monitoring device:
    name: Default
    id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
info: No blackmagic support
info: NVENC supported
info: FFMPEG VAAPI supported
error: os_dlopen(/app//lib/obs-plugins/obs-ndi.so->/app//lib/obs-plugins/obs-ndi.so): /app//lib/obs-plugins/obs-ndi.so: cannot open shared object file: No such file or directory

warning: Module '/app//lib/obs-plugins/obs-ndi.so' not loaded
error: os_dlopen(/app//lib/obs-plugins/obs-v4l2sink.so->/app//lib/obs-plugins/obs-v4l2sink.so): /app//lib/obs-plugins/obs-v4l2sink.so: cannot open shared object file: No such file or directory

warning: Module '/app//lib/obs-plugins/obs-v4l2sink.so' not loaded
info: ---------------------------------
info:   Loaded Modules:
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-xdg-portal.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-outputs.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-decklink.so
info:     linux-capture.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-ouput-ui.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'pulseaudio 12.2'
info: pulse-input: Audio format: s16le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_0b_00.4.analog-stereo.monitor'
info: [Loaded global audio device]: 'Desktop Audio'
info: xshm-input: Geometry 1920x1200 @ 0,0
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (XSHM)' (xshm_input)
info: ------------------------------------------------
Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /app/share/obs/obs-studio/images/overflow.png
info: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Desktop Audio)

info: ---------------------------------
info: [NVENC encoder: 'simple_h264_stream'] settings:
    rate_control: CBR
    bitrate:      2500
    cqp:          0
    keyint:       250
    preset:       hq
    profile:      high
    width:        1280
    height:       720
    2-pass:       false
    b-frames:     2
    GPU:          0

[h264_nvenc @ 0x55b817998180] dl_fn->cuda_dl->cuInit(0) failed -> CUDA_ERROR_UNKNOWN: unknown error
warning: [NVENC encoder: 'simple_h264_stream'] Failed to open NVENC codec: Unknown error occurred
info: ==== Shutting down ==================================================
info: pulse-input: Stopped recording from 'alsa_output.pci-0000_0b_00.4.analog-stereo.monitor'
info: pulse-input: Got 595 packets with 202361 frames
info: All scene data cleared
info: ------------------------------------------------
info: [Scripting] Total detached callbacks: 0
info: Freeing OBS context data
info: == Profiler Results =============================
info: run_program_init: 296.251 ms
info:  ┣OBSApp::AppInit: 2.141 ms
info:  ┃ ┗OBSApp::InitLocale: 0.964 ms
info:  ┗OBSApp::OBSInit: 271.371 ms
info:    ┣obs_startup: 21.578 ms
info:    ┗OBSBasic::OBSInit: 207.849 ms
info:      ┣OBSBasic::InitBasicConfig: 0.072 ms
info:      ┣OBSBasic::ResetAudio: 0.074 ms
info:      ┣OBSBasic::ResetVideo: 70.249 ms
info:      ┣OBSBasic::InitOBSCallbacks: 0.002 ms
info:      ┣OBSBasic::InitHotkeys: 0.029 ms
info:      ┣obs_load_all_modules: 77.431 ms
info:      ┃ ┣obs_init_module(decklink-ouput-ui.so): 0.358 ms
info:      ┃ ┣obs_init_module(frontend-tools.so): 54.009 ms
info:      ┃ ┣obs_init_module(image-source.so): 0.004 ms
info:      ┃ ┣obs_init_module(linux-capture.so): 0.198 ms
info:      ┃ ┣obs_init_module(linux-decklink.so): 0.077 ms
info:      ┃ ┣obs_init_module(linux-pulseaudio.so): 0.001 ms
info:      ┃ ┣obs_init_module(linux-v4l2.so): 0 ms
info:      ┃ ┣obs_init_module(obs-ffmpeg.so): 0.258 ms
info:      ┃ ┃ ┗nvenc_check: 0.226 ms
info:      ┃ ┣obs_init_module(obs-filters.so): 0.01 ms
info:      ┃ ┣obs_init_module(obs-libfdk.so): 0.001 ms
info:      ┃ ┣obs_init_module(obs-outputs.so): 0.001 ms
info:      ┃ ┣obs_init_module(obs-transitions.so): 0.003 ms
info:      ┃ ┣obs_init_module(obs-vst.so): 0.001 ms
info:      ┃ ┣obs_init_module(obs-x264.so): 0 ms
info:      ┃ ┣obs_init_module(obs-xdg-portal.so): 9.626 ms
info:      ┃ ┣obs_init_module(rtmp-services.so): 0.396 ms
info:      ┃ ┗obs_init_module(text-freetype2.so): 0.006 ms
info:      ┣OBSBasic::ResetOutputs: 0.07 ms
info:      ┣OBSBasic::CreateHotkeys: 0.026 ms
info:      ┣OBSBasic::InitService: 0.841 ms
info:      ┣OBSBasic::InitPrimitives: 0.111 ms
info:      ┗OBSBasic::Load: 6.193 ms
info: obs_hotkey_thread(25 ms): min=0.044 ms, median=0.071 ms, max=19.875 ms, 99th percentile=10.214 ms, 100% below 25 ms
info: audio_thread(Audio): min=0 ms, median=0.016 ms, max=0.101 ms, 99th percentile=0.032 ms
info: obs_graphics_thread(33.3333 ms): min=0.332 ms, median=2.961 ms, max=66.766 ms, 99th percentile=24.851 ms, 99.2908% below 33.333 ms
info:  ┣tick_sources: min=0.001 ms, median=2.447 ms, max=22.71 ms, 99th percentile=17.432 ms
info:  ┣output_frame: min=0.099 ms, median=0.182 ms, max=4.292 ms, 99th percentile=2.266 ms
info:  ┃ ┗gs_context(video->graphics): min=0.099 ms, median=0.181 ms, max=4.292 ms, 99th percentile=2.266 ms
info:  ┃   ┣render_video: min=0.048 ms, median=0.115 ms, max=4.207 ms, 99th percentile=1.807 ms
info:  ┃   ┃ ┗render_main_texture: min=0.038 ms, median=0.104 ms, max=4.192 ms, 99th percentile=1.792 ms
info:  ┃   ┗gs_flush: min=0.003 ms, median=0.007 ms, max=0.567 ms, 99th percentile=0.043 ms
info:  ┗render_displays: min=0.039 ms, median=0.244 ms, max=63.621 ms, 99th percentile=1.099 ms
info: =================================================
info: == Profiler Time Between Calls ==================
info: obs_hotkey_thread(25 ms): min=25.089 ms, median=25.133 ms, max=44.948 ms, 93.6508% within ±2% of 25 ms (0% lower, 6.34921% higher)
info: obs_graphics_thread(33.3333 ms): min=33.235 ms, median=33.333 ms, max=66.771 ms, 99.2857% within ±2% of 33.333 ms (0% lower, 0.714286% higher)
info: =================================================
info: Number of memory leaks: 0

Note that I have updated the nvidia driver and the Linux kernel since reporting this issue.

eszlari commented 3 years ago

What does

$ flatpak --gl-drivers

show?

Have you run

$ flatpak update

to update the flatpak driver part?

aidalgol commented 3 years ago

flatpak --gl-drivers outputs

nvidia-450-66
default
host

And I have run flatpak update before and after a reboot.

aidalgol commented 3 years ago

I just ran flatpak update again today, which pulled in some updates to org.freedesktop.Platform.GL[32].nvidia-450-66, and now I can record with OBS using NVENC.

aidalgol commented 3 years ago

This is happening again. I have run flatpak update before and after a reboot, and the output of flatpak --gl-drivers on my system today is:

nvidia-460-32-03
default
host

The error from OBS is exactly the same as before.

vchernin commented 3 years ago

It sounds like something between org.freedesktop.Platform.GL[32].nvidia-450-66 and org.freedesktop.Platform.GL[32].nvidia-460* regressed this. This is maybe a good place to look.

How are the latest 470 drivers? (Whenever they make it to backports). Is Debian 11 any better with this?

aidalgol commented 2 years ago

This is still broken on Debian 11. I have raised a separate issue (#172 ) for Debian 11 and am closing this one, as it is about Debian buster with buster-backports, which is no longer the current Debian release.