You are not logged in.

#1 2020-06-18 16:51:29

gehngis
Member
From: France
Registered: 2020-06-18
Posts: 3

VA-API SIGSEGV with nvidia

Hi,

I am trying to get Chiaki running with VA-API video acceleration, but it seems that when a program tries to use VA-API it crashes.

My GPU is an RTX 2070, I am using nvidia proprietary drivers and I have tried with both linux and linux-zen kernels.

I have installed:

  • nvidia-dkms 440.82-2

  • nvidia-utils 440.82-2

  • libva 2.7.1-1

  • libva-vdpau-driver 0.7.4-4

I have then tried to run:

VDPAU_DRIVER=nvidia LIBVA_DRIVER_NAME=vdpau chiaki

But it crashes with SIGSEGV. The stack trace looks like this:

#0  0x00007ffff1efa110 in XDisplayString () at /usr/lib/libX11.so.6
#1  0x00007fffe41138a7 in __vaDriverInit_1_4 () at /usr/lib/dri/vdpau_drv_video.so
#2  0x00007ffff203d028 in  () at /usr/lib/libva.so.2
#3  0x00007ffff20413af in vaInitialize () at /usr/lib/libva.so.2
#4  0x00007ffff631517e in  () at /usr/lib/libavutil.so.56
#5  0x00007ffff630d8bf in av_hwdevice_ctx_create () at /usr/lib/libavutil.so.56

Frame #6 is in Chiaki code.

The problem seems to be not specific to Chiaki as even VLC crashes by selecting "VA-API video decoder" in the "Codecs" preferences of VLC.

$ VDPAU_DRIVER=nvidia LIBVA_DRIVER_NAME=vdpau vlc -v video.mkv
VLC media player 3.0.11 Vetinari (revision 3.0.11-0-gdc0c5ced72)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libzvbi_plugin.so' (libzvbi.so.0: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libsdl_image_plugin.so' (libSDL_image-1.2.so.0: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libmpg123_plugin.so' (libmpg123.so.0: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libkate_plugin.so' (libtiger.so.5: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libtwolame_plugin.so' (libtwolame.so.0: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/video_output/libaa_plugin.so' (libaa.so.1: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/control/liblirc_plugin.so' (liblirc_client.so.0: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/access_output/libaccess_output_shout_plugin.so' (libshout.so.3: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/visualization/libgoom_plugin.so' (libgoom2.so.0: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/visualization/libprojectm_plugin.so' (libprojectM.so.3: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/services_discovery/libmicrodns_plugin.so' (libmicrodns.so.0: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/stream_out/libstream_out_chromaprint_plugin.so' (libchromaprint.so.1: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/access/libv4l2_plugin.so' (libzvbi.so.0: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/access/libnfs_plugin.so' (libnfs.so.13: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/access/liblinsys_sdi_plugin.so' (libzvbi.so.0: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/demux/libgme_plugin.so' (libgme.so.0: cannot open shared object file: No such file or directory)
[0000557098ae3670] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00007fa1b0d16c10] faad decoder warning: decoded zero sample
[00007fa1a409c7b0] vaapi_filters filter warning: Using SW chroma filter for 1920x1088 VAOP -> I420
fish: “VDPAU_DRIVER=nvidia LIBVA_DRIVE…” terminated by signal SIGSEGV (Address boundary error)

However, if I set VLC "Codecs" preferences to "Automatic" or "VDPAU video decoder", it works fine and I have the following output:

VLC media player 3.0.11 Vetinari (revision 3.0.11-0-gdc0c5ced72)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libzvbi_plugin.so' (libzvbi.so.0: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libsdl_image_plugin.so' (libSDL_image-1.2.so.0: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libmpg123_plugin.so' (libmpg123.so.0: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libkate_plugin.so' (libtiger.so.5: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/codec/libtwolame_plugin.so' (libtwolame.so.0: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/video_output/libaa_plugin.so' (libaa.so.1: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/control/liblirc_plugin.so' (liblirc_client.so.0: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/access_output/libaccess_output_shout_plugin.so' (libshout.so.3: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/visualization/libgoom_plugin.so' (libgoom2.so.0: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/visualization/libprojectm_plugin.so' (libprojectM.so.3: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/services_discovery/libmicrodns_plugin.so' (libmicrodns.so.0: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/stream_out/libstream_out_chromaprint_plugin.so' (libchromaprint.so.1: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/access/libv4l2_plugin.so' (libzvbi.so.0: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/access/libnfs_plugin.so' (libnfs.so.13: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/access/liblinsys_sdi_plugin.so' (libzvbi.so.0: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/demux/libgme_plugin.so' (libgme.so.0: cannot open shared object file: No such file or directory)
[0000559494da2670] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00007f5b40d16c10] faad decoder warning: decoded zero sample
[00007f5b2009c7b0] vaapi_filters filter warning: Using SW chroma filter for 1920x1088 VAOP -> I420
[00007f5b40c31fa0] avcodec decoder: Using NVIDIA VDPAU Driver Shared Library  440.82  Wed Apr  1 19:39:06 UTC 2020 for hardware decoding
[0000559494e760b0] pulse audio output warning: starting late (-13509 us)
[00007f5b24061840] main video output warning: picture is too late to be displayed (missing 26 ms)

Also here is the output of vainfo:

$ VDPAU_DRIVER=nvidia LIBVA_DRIVER_NAME=vdpau vainfo
vainfo: VA-API version: 1.7 (libva 2.7.1)
vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA-API - 0.7.4
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG4Simple            : VAEntrypointVLD
      VAProfileMPEG4AdvancedSimple    : VAEntrypointVLD
      <unknown profile>               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD

I have been searching the Arch Wiki for hours, but now I do not not where to look to find a solution.

Offline

#2 2020-06-19 11:14:06

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 8,197

Re: VA-API SIGSEGV with nvidia

Those outputs suggest you're missing many files that vlc needs.

please post the output of pacman -Qkk vlc .


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#3 2020-06-19 11:22:39

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 9,983

Re: VA-API SIGSEGV with nvidia

Those look like optional packages and they should be irrelevant to the question at hand.

What I'm wondering as why you want to do this in the first place. From a quick googler chiaki should support VDPAU natively, as does VLC. Just use VDPAU instead of the VAAPI-over-VDPAU bridge that often runs into issues like this.

Offline

#4 2020-06-19 11:30:57

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 8,197

Re: VA-API SIGSEGV with nvidia

Some may be optional, but atleast two of them are owned by the vlc package so should be present and appear to be missing.

$ pacman -Qo /usr/lib/vlc/plugins/codec/libmpg123_plugin.so
/usr/lib/vlc/plugins/codec/libmpg123_plugin.so is owned by vlc 3.0.11-1
$ pacman -Qo /usr/lib/vlc/plugins/codec/libkate_plugin.so
/usr/lib/vlc/plugins/codec/libkate_plugin.so is owned by vlc 3.0.11-1
$ 

Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#5 2020-06-19 13:09:07

gehngis
Member
From: France
Registered: 2020-06-18
Posts: 3

Re: VA-API SIGSEGV with nvidia

Lone_Wolf wrote:

Some may be optional, but atleast two of them are owned by the vlc package so should be present and appear to be missing.

libmpg123_plugin.so is owned by VLC, but I do have this file.
VLC does not complain that libmpg123_plugin.so does not exist, but complains that it cannot load libmpg123_plugin.so because libmpg123.so.0 (which is not owned by VLC) does not exist.

These are optional plugins and should not be an issue.

Anyway to satisfy your curiosity:

$ pacman -Qkk vlc
warning: vlc: /usr/lib/vlc/plugins/plugins.dat (Modification time mismatch)
warning: vlc: /usr/lib/vlc/plugins/plugins.dat (Size mismatch)
vlc: 1056 total files, 1 altered file
V1del wrote:

What I'm wondering as why you want to do this in the first place. From a quick googler chiaki should support VDPAU natively, as does VLC. Just use VDPAU instead of the VAAPI-over-VDPAU bridge that often runs into issues like this.

Yes VLC can use VDPAU directly, and has not issue unless I force VA-API. And the only reason I am doing that is to check whether it is a VA-API issue or a Chiaki issue.

To my knowledge Chiaki only supports VA-API.
Chiaki Settings dialog, the "Hardware decode method" can be set not "none" or "vaapi".
Looking into issues about HW acceleration, it seems only VA-API is done at this time and VDPAU might be done in the future.
https://github.com/thestr4ng3r/chiaki/i … -639521041

Offline

#6 2020-06-20 09:53:40

gehngis
Member
From: France
Registered: 2020-06-18
Posts: 3

Re: VA-API SIGSEGV with nvidia

I've continue to explore the issue.

Building libva-vdpau-driver in debug I was able to see that the issue is at the following line of code:

const char * const x11_dpy_name = XDisplayString(driver_data->x11_dpy);

The issue is that x11_dpy is NULL.
x11_dpy is a copy of the value set in ctx->native_dpy provided by libva to the driver.

So I built a debug version on libva, however with this new compiled version I had the following error when starting chiaki:

chiaki: symbol lookup error: /usr/lib/libavutil.so.56: undefined symbol: vaSetErrorCallback

libavutil.so.56 being owned by ffmeg, I rebuilt ffmpeg.

And now Chiaki does not crash anymore, but it still does not work.
Before it was crashing inside the call to av_hwdevice_ctx_create().
Now it fails at avcodec_get_hw_config() which is called before av_hwdevice_ctx_create(), i.e. av_hwdevice_ctx_create() is not even called now.

Offline

Board footer

Powered by FluxBB