libva
libva copied to clipboard
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
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?
I havent tried VM before, we need more information, could you help to enable LIBVA_TRACE and attach the report?
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
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.
of course, it also depend on which kind of VM @lucaszanella are using. just support several , such as KVM
@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
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
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
Any updates on this? I'm experiencing this issue on wayland.
hi @pavel-the-best not sure whether my understanding correct. there are two issue
- driver name issue, it should already been fixed with latest libva, such as 2.7.1
- driver init issue. it is driver issue. or permission issue... it is not a libva issue
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 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.
Same issue here running OpenShot on Debian Unstable. Trying to export using the VA-API and it can't find the hardware device.
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.
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.
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
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
How to disable LIBVA_TRACE ?? LIBVA_TRACE=0 did not stop generating the logs
how about unset LIBVA_TRACE?
@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
@gauravguptabits , could you help to share more information, what's your gpu? seems it is nvidia, how about your kmd , it is also nouveau?
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?!
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
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.
could you help to try this command line? xdpyinfo|grep DRI and paste the result
@XinfengZhang
pranav@fedora ~> xdpyinfo | grep DRI
DRI3
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 I'm using Wayland.
pranav@fedora ~> echo $XDG_SESSION_TYPE
wayland
Will there be a Libva update/patch supporting Wayland and DRI3?
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 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.
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
Thank you so much. I think it worked. I no longer see the issue as you can see:
Problem is: I need to export everytime I restart the distro. How do I make it permanent? I use fish shell.