intel / libva

Libva is an implementation for VA-API (Video Acceleration API)

Home Page:http://intel.github.io/libva/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ubuntu22 / linux kernel 5.19.0-35-generic - wrong driver directories

Consti10 opened this issue · comments

I am trying to simply use libva on ubuntu22, linux kernel 5.19.0-35-generic by installing the appropriate packages.

However, I cannot even get vainfo to "do anything".

Output:

libva info: VA-API version 1.16.0
libva info: Trying to open /usr/local/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/local/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

After investigating a bit, it looks as if libva looks for the drivers in the wrong directory -
iHD_drv_video.so and i965_drv_video.so are in
/usr/lib/x86_64-linux-gnu/dri
not in
/usr/local/lib/x86_64-linux-gnu/dri

Any ideas ?

Manually copying the .so files seems to work:

libva info: VA-API version 1.16.0
libva info: Trying to open /usr/local/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.16 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.3.1 ()
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD

But I don't think that's a good practice

export LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri

Thanks for reporting this question. You could get more detail from libva build and installation guideline https://github.com/intel/libva#build-with-autogen-and-meson.

When you install the libva from OSV package repositories, different OSV distro use different default location for libva. Basically, Debian/Ubuntu family install libva to /usr/lib/x86_64-linux-gnu and rpm family like Fedora/CentOS/SUSE/RHEL install libva to /usr/lib64. For Other media component default location, you could refer to Install from OSV package)

Without prefix setting, libva will be install to /usr/local/lib as default. If you use other path as installation target folder or no prefix, you have to add the folder to your environment variable or use LD_LIBRARY_PATH to specify the location, like LD_LIBRARY_PATH=/usr/local/lib if no prefix.

If you intent to overwrite system default libva, you could use same OSV distro prefix, then system libva will be replaced and also your new installed libva version will be overwrited when you upgrade it from OSV distro package repository.