libva icon indicating copy to clipboard operation
libva copied to clipboard

libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)

Open lattice0 opened this issue 6 years ago • 55 comments

I'm doing a QT program and I'm getting this error on my Ubuntu (it's a VM):

libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)

I tried all possible solutions on web and they didn't work.

I found that export LIBVA_DRIVER_NAME=i965 could work, but with it, I have the following errors:

libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed
libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed

What can be done?

lattice0 avatar Feb 14 '19 04:02 lattice0

I havent tried VM before, we need more information, could you help to enable LIBVA_TRACE and attach the report?

XinfengZhang avatar Feb 17 '19 13:02 XinfengZhang

I don't think that any libva's driver was designed to work virtualized.

Perhaps somebody should try to develop a libva's driver that proxies to the call to the host libva's and composite with the virtualized video driver... but it sounds hard

ceyusa avatar Feb 17 '19 15:02 ceyusa

if the HW is exposed, and can be access, work with i915, I think UMD driver can work with VM. it is transparent for UMD driver. from https://github.com/intel/media-driver/issues/520 some one tried VM with virtual mediated pass-through GPU (Intel GVT-g). it works with i965.

XinfengZhang avatar Feb 19 '19 01:02 XinfengZhang

of course, it also depend on which kind of VM @lucaszanella are using. just support several , such as KVM

XinfengZhang avatar Feb 19 '19 01:02 XinfengZhang

@XinfengZhang

I am experiencing this issue also, and I'm NOT using a VM!

I experience it using VLC both 3.0.x and 4.0-dev

VLC has three plugins for connecting to vaapi: wayland, x11 and drm; wayland and x11 have higher priority and so are tried first before falling back to drm. On my system, the wayland one ends early because the VLC window is not wayland (I don't think wayland support is complete yet); then the x11 one is tried, which experiences the issue reported here and thus fails; it then tries the drm one which works.

the following is the relevant portion of output from VLC trying the x11 one (with LIBVA_TRACE=1):

libva info: Open new log file 1.011659.thd-0x0000028f for the thread 0x0000028f
libva info: LIBVA_TRACE is on, save log into 1.011659.thd-0x0000028f
libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns -1
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)

since when VLC tries the drm one it overwrites the trace file, I modified VLC 4.0-dev to deliberately break the drm one to stop it doing so thus I could see what it contained (as you asked for one); unfortunately it only contains this:

[58891.570032][ctx       none]==========va_TraceInitialize
[58891.570073][ctx       none]==========va_TraceTerminate

if I try using LIBVA_DRIVER_NAME=i965 in addition, I get:

libva info: Open new log file 1.012657.thd-0x0000030b for the thread 0x0000030b
libva info: LIBVA_TRACE is on, save log into 1.012657.thd-0x0000030b
libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns -1
libva info: User requested driver 'i965'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed
libva info: va_openDriver() returns -1

with the same useless trace

contrastingly the output from the drm based attempt gave the following and works successfully (with just LIBVA_TRACE=1):

libva info: Open new log file 1.013329.thd-0x000007b1 for the thread 0x000007b1
libva info: LIBVA_TRACE is on, save log into 1.013329.thd-0x000007b1
libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva info: va_openDriver() returns 0

and this with LIBVA_DRIVER_NAME=i965 LIBVA_TRACE=1:

libva info: Open new log file 1.013515.thd-0x000007e8 for the thread 0x000007e8
libva info: LIBVA_TRACE is on, save log into 1.013515.thd-0x000007e8
libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'i965'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva info: va_openDriver() returns 0

jnqnfe avatar Mar 24 '19 19:03 jnqnfe

I've simliar issue (chromium won't start) same error and I'm not on the Virtual machine, btw where can find the info about driver - i.e to specify driver name? I've intel UHD 620

roberto68 avatar Jun 20 '19 12:06 roberto68

here's my output does anything here seem to be wrong? vainfo libva info: VA-API version 1.4.1 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib64/dri/i965_drv_video.so libva info: Found init function __vaDriverInit_1_4 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.4 (libva 2.4.0) vainfo: Driver version: Intel i965 driver for Intel(R) Kaby Lake - 2.3.0 vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Simple : VAEntrypointEncSlice VAProfileMPEG2Main : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointEncSlice VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264Main : VAEntrypointEncSliceLP VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileH264High : VAEntrypointEncSliceLP VAProfileH264MultiviewHigh : VAEntrypointVLD VAProfileH264MultiviewHigh : VAEntrypointEncSlice VAProfileH264StereoHigh : VAEntrypointVLD VAProfileH264StereoHigh : VAEntrypointEncSlice VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileNone : VAEntrypointVideoProc VAProfileJPEGBaseline : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointEncPicture VAProfileVP8Version0_3 : VAEntrypointVLD VAProfileVP8Version0_3 : VAEntrypointEncSlice VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointEncSlice VAProfileHEVCMain10 : VAEntrypointVLD VAProfileHEVCMain10 : VAEntrypointEncSlice VAProfileVP9Profile0 : VAEntrypointVLD VAProfileVP9Profile0 : VAEntrypointEncSlice VAProfileVP9Profile2 : VAEntrypointVLD

roberto68 avatar Jun 21 '19 10:06 roberto68

Any updates on this? I'm experiencing this issue on wayland.

p4vook avatar Apr 25 '20 06:04 p4vook

hi @pavel-the-best not sure whether my understanding correct. there are two issue

  1. driver name issue, it should already been fixed with latest libva, such as 2.7.1
  2. driver init issue. it is driver issue. or permission issue... it is not a libva issue

XinfengZhang avatar Apr 25 '20 13:04 XinfengZhang

I am getting: libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)

This is with kernel 5.8-rc2+, Debian Bullseye, Mesa 20.1.1, gcc 9.3.0 and amdgpu driver.

Both Chromium and VLC have problems, Chromium won't show start page while VLC segfaults when playing video.

Edit: building and installing 2.8.0 fixes VLC but Chromium is still broken in 5.8-rc2+: it can't show even settings, just error.

ipr avatar Jun 28 '20 13:06 ipr

@ipr Just want to clarify it. Chromium will broken when use VLC plugin to playback. Right? IMHO, Google doesn't provide media HW acceleration directly in chromium and there is one non-official patch from community. So I guess you use VLC plugin in chromium.

wangyan-intel avatar Jun 29 '20 01:06 wangyan-intel

Same issue here running OpenShot on Debian Unstable. Trying to export using the VA-API and it can't find the hardware device.

grantcarthew avatar Nov 24 '20 23:11 grantcarthew

I have this issue with an amd card. I am using mpv's vaapi video output driver for testing. Manually exporting LIBVA_DRIVER_NAME=radeonsi lets libva find the driver, but otherwise it fails with this exact same error.

To reproduce I do

LIBVA_TRACE=1 mpv --no-config --vo=vaapi any_file.mkv

I get the following error message:

[   0.035][d][vo/vaapi/vaapi] libva: Open new log file 1.000219.thd-0x0003129c for the thread 0x0003129c
[   0.035][d][vo/vaapi/vaapi] libva: LIBVA_TRACE is on, save log into 1.000219.thd-0x0003129c
[   0.035][d][vo/vaapi/vaapi] libva: VA-API version 1.9.0
[   0.035][e][vo/vaapi/vaapi] libva: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[   0.035][e][vo/vaapi/vaapi] Failed to initialize VAAPI: unknown libva error

Trace file: https://0x0.st/i7c1.thd-0x0

Here is what does work:

LIBVA_DRIVER_NAME=radeonsi LIBVA_TRACE=1 mpv --no-config --vo=vaapi any_file.mkv
[   0.036][d][vo/vaapi/vaapi] libva: Open new log file 1.000815.thd-0x0003130f for the thread 0x0003130f
[   0.036][d][vo/vaapi/vaapi] libva: LIBVA_TRACE is on, save log into 1.000815.thd-0x0003130f
[   0.036][d][vo/vaapi/vaapi] libva: VA-API version 1.9.0
[   0.036][d][vo/vaapi/vaapi] libva: User environment variable requested driver 'radeonsi'
[   0.036][d][vo/vaapi/vaapi] libva: Trying to open /usr/lib/dri/radeonsi_drv_video.so
[   0.093][d][vo/vaapi/vaapi] libva: Found init function __vaDriverInit_1_9
[   0.098][d][vo/vaapi/vaapi] libva: va_openDriver() returns 0
[   0.098][v][vo/vaapi/vaapi] Initialized VAAPI: version 1.9

Trace file: https://0x0.st/i7cI.thd-0x0

This file is the output of LIBVA_TRACE=1 vainfo: https://0x0.st/i7Z2.txt Trace file: https://0x0.st/i7cl.thd-0x0

I can manually cause vainfo to fail, with a different error, by doing LIBVA_DRIVER_NAME= LIBVA_TRACE=1 vainfo

libva info: Open new log file 1.001222.thd-0x000314ab for the thread 0x000314ab
libva info: LIBVA_TRACE is on, save log into 1.001222.thd-0x000314ab
vaInitialize failed with error code -1 (unknown libva error),exit

Trace file: https://0x0.st/i7cU.thd-0x0

I'm using libva 2.9.1 and libva-utils 2.9.1

EDIT: On my laptop with an intel GPU, I do not get this issue. libva is properly detecting iHD and loading it.

LaserEyess avatar Nov 30 '20 00:11 LaserEyess

Some more information, vainfo --display x11 actually fails with the same error but vainfo --display (wayland|drm) do not fail. Additionally, using mpv --hwdec=vaapi --gpu-context=x11egl fails with the same error but mpv --hwdec=vaapi --gpu-context=wayland does not.

The issue here seems to be that, under Xwayland, libva cannot load radeonsi, whereas it loads fine in wayland or drm.

LaserEyess avatar Dec 07 '20 13:12 LaserEyess

Same error on Windows running WSL2 Ubuntu 20.04 using VcXSrv:

$ uname -a   | Linux machine 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Same error: $ npm start

electron
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)

Tried: $ export LIBVA_DRIVER_NAME=i965 LIBVA_TRACE=1 $ vainfo --display x11

libva info: Open new log file 1.081847.thd-0x000011ba for the thread 0x000011ba
libva info: LIBVA_TRACE is on, save log into 1.081847.thd-0x000011ba
libva info: VA-API version 1.7.0
libva info: User environment variable requested driver 'i965'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_6
libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

Same output at running Node/electron app:

electron
libva info: Open new log file 1.082046.thd-0x0000121c for the thread 0x0000121c
libva info: LIBVA_TRACE is on, save log into 1.082046.thd-0x0000121c
libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed

newcanopies avatar Apr 05 '21 08:04 newcanopies

Same error for Google chrome.

gaurav.gupta@ibs-lap-127:~$ google-chrome
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
[24038:24038:0411/155153.991304:ERROR:viz_main_impl.cc(150)] Exiting GPU process due to errors during initialization
nvc0_screen_create:1111 - Error allocating PGRAPH context for M2MF: -16
libva error: /usr/lib/x86_64-linux-gnu/dri/nouveau_drv_video.so init failed

gauravguptabits avatar Apr 11 '21 10:04 gauravguptabits

How to disable LIBVA_TRACE ?? LIBVA_TRACE=0 did not stop generating the logs

how about unset LIBVA_TRACE?

XinfengZhang avatar Apr 12 '21 10:04 XinfengZhang

@LaserEyess about AMD , it should because the AMD new driver name "radeonsi" if it is X11, we should get the name from https://github.com/intel/libva/blob/master/va/x11/dri2_util.c#L176 I suppose we have not received "radeonsi", maybe you could try to update mesa. they add this name at 2019-10-07 by commit 3b8aeb09069a

XinfengZhang avatar Apr 12 '21 10:04 XinfengZhang

@gauravguptabits , could you help to share more information, what's your gpu? seems it is nvidia, how about your kmd , it is also nouveau?

XinfengZhang avatar Apr 12 '21 13:04 XinfengZhang

Trying to run the Freezer from the terminal in Fedora 34 throws a similar error. It does open the app but throws a warning/error statement in the terminal. Is there related to this bug in any way?!

Alacritty terminal + Fish shell

PranavBhattarai avatar Jun 03 '21 04:06 PranavBhattarai

hi @PranavBhattarai , how about the system configuration, it looks like it could not find the compatible driver name against KMD. but you always could use LIBVA_DRIVER_NAME to specify the driver name.

XinfengZhang avatar Jun 03 '21 07:06 XinfengZhang

@XinfengZhang

pranav@fedora ~> journalctl | grep 'libva'
May 29 10:25:57 fedora code.desktop[4021]: libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
May 31 13:29:18 fedora chromium-browser.desktop[16431]: libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
Jun 03 09:08:31 fedora gsd-media-keys[3979]: libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
Jun 04 10:34:38 fedora nautilus[8156]: libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)

I don't think I will see more error logs from now onwards except when I launch Freezer from terminal which I think use Nautilus as u can see the last journal log. I have use sudo dnf autoremove which cleaned up a lot of things. But when I type the command which you can see below, I still see Libva as installed package.

pranav@fedora ~> dnf info Libva
Last metadata expiration check: 0:51:31 ago on Fri 04 Jun 2021 10:18:32 AM +0545.
Installed Packages
Name         : libva
Version      : 2.11.0
Release      : 1.fc34
Architecture : x86_64
Size         : 294 k
Source       : libva-2.11.0-1.fc34.src.rpm
Repository   : @System
From repo    : anaconda
Summary      : Video Acceleration (VA) API for Linux
URL          : https://github.com/intel/libva
License      : MIT
Description  : Libva is a library providing the VA API video acceleration API.

Intel Chips inside my Dell:

Intel® Core™ i5-5200U CPU @ 2.20GHz × 4 Mesa Intel® HD Graphics 5500 (BDW GT2)

Don't know how to use the LIBVA_DRIVER_NAME environment variable since I'm noob (let me know in simple steps).

If there is anything that I can help to solve this 2 YEAR old issue, do let me know.

PranavBhattarai avatar Jun 04 '21 05:06 PranavBhattarai

could you help to try this command line? xdpyinfo|grep DRI and paste the result

XinfengZhang avatar Jun 04 '21 14:06 XinfengZhang

@XinfengZhang

pranav@fedora ~> xdpyinfo | grep DRI
    DRI3

PranavBhattarai avatar Jun 04 '21 15:06 PranavBhattarai

so, now it is clear, libva just enable DRI2 support for X11. and we assume that X will has both DRI2 and DRI3 extension. actually official X has both of them by default. so suppose you are not using an official XOrg? are you using Xwayland?

XinfengZhang avatar Jun 05 '21 02:06 XinfengZhang

@XinfengZhang I'm using Wayland.

pranav@fedora ~> echo $XDG_SESSION_TYPE
wayland

Will there be a Libva update/patch supporting Wayland and DRI3?

PranavBhattarai avatar Jun 05 '21 05:06 PranavBhattarai

good suggestion, seems it already impact some users, because export LIBVA_DRIVER_NAME=iHD or i965 or nouveau refer to https://github.com/intel/libva/blob/master/va/drm/va_drm_utils.c#L40 , so looks not too urgent .

XinfengZhang avatar Jun 05 '21 11:06 XinfengZhang

@XinfengZhang So, if I somehow managed to use this export command, I will no longer see any error?

so looks not too urgent

Feb 14, 2019. Yeah right.

PranavBhattarai avatar Jun 05 '21 14:06 PranavBhattarai

yes, if you call vaSetDriverName explicitly or export environment variable LIBVA_DRIVER_NAME , there will no such issue anymore, because https://github.com/intel/libva/blob/master/va/va.c#L383.

XinfengZhang avatar Jun 07 '21 03:06 XinfengZhang

@XinfengZhang Thank you so much. I think it worked. I no longer see the issue as you can see: image

Problem is: I need to export everytime I restart the distro. How do I make it permanent? I use fish shell.

PranavBhattarai avatar Jun 07 '21 07:06 PranavBhattarai