conda-forge / libva-utils-feedstock

A conda-smithy repository for libva-utils.
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Does this package work? #36

Open hmaarrfk opened 2 weeks ago

hmaarrfk commented 2 weeks ago

Comment:

@ehfd I'm trying to check that this package even works.

On ubuntu 24.04 i install

sudo apt install vainfo --yes
mamba create --name vainfo libva-utils --yes
mamba activate vainfo
23:43 $ vainfo
Trying display: wayland
libva info: VA-API version 1.22.0
libva info: Trying to open /home/mark/miniforge3/envs/vainfo/lib/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /home/mark/miniforge3/envs/vainfo/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva error: /home/mark/miniforge3/envs/vainfo/lib/dri/i965_drv_video.so init failed
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit
(vainfo) ✘-3 ~
23:43 $ vainfo --display drm
Trying display: drm
libva info: VA-API version 1.22.0
libva info: Trying to open /home/mark/miniforge3/envs/vainfo/lib/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /home/mark/miniforge3/envs/vainfo/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva error: /home/mark/miniforge3/envs/vainfo/lib/dri/i965_drv_video.so init failed
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit
(vainfo) ✘-3 ~
23:43 $ /usr/bin/vainfo --display drm
libva info: VA-API version 1.20.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.1.0 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      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
      VAProfileHEVCMain               : VAEntrypointEncSliceLP
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSliceLP
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile1            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileVP9Profile3            : VAEntrypointVLD
      VAProfileHEVCMain12             : VAEntrypointVLD
      VAProfileHEVCMain422_10         : VAEntrypointVLD
      VAProfileHEVCMain422_12         : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10         : VAEntrypointVLD
      VAProfileHEVCMain444_10         : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_12         : VAEntrypointVLD
      VAProfileHEVCSccMain            : VAEntrypointVLD
      VAProfileHEVCSccMain            : VAEntrypointEncSliceLP
      VAProfileHEVCSccMain10          : VAEntrypointVLD
      VAProfileHEVCSccMain10          : VAEntrypointEncSliceLP
      VAProfileHEVCSccMain444         : VAEntrypointVLD
      VAProfileHEVCSccMain444         : VAEntrypointEncSliceLP
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileHEVCSccMain444_10      : VAEntrypointVLD
      VAProfileHEVCSccMain444_10      : VAEntrypointEncSliceLP

so ubuntu's versions works, but not ours.

hmaarrfk commented 2 weeks ago

Hmm it seems to need

ln -s /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so ${CONDA_PREFIX}/lib/dri/.

the it works...

hmaarrfk commented 2 weeks ago

seems like we might need https://github.com/intel/media-delivery

hmaarrfk commented 2 weeks ago

maybe it is https://github.com/intel/media-driver

ehfd commented 2 weeks ago

It's simply because there is no iHD_drv_video.so in the directory Conda's vainfo looks for. A patch similar to what @traversaro did in libglvnd is required.

ehfd commented 2 weeks ago

While adding the Intel media driver, sure, is a way to go, another more effective way is to expand the path of the VA drivers to the system ones.

hmaarrfk commented 2 weeks ago

hmm, ok, understood. thanks for the pointer!

btw, with the intel-media-driver (see staged recipe cross referenced)

I get even more codecs... I guess because it is newer???

 vainfo
Trying display: wayland
libva info: VA-API version 1.22.0
libva info: Trying to open /home/mark/miniforge3/envs/mcam_dev/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.2.5 (4343d697e0)
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI
      VAProfileHEVCMain               : VAEntrypointEncSliceLP
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointEncSliceLP
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile1            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileVP9Profile3            : VAEntrypointVLD
      VAProfileHEVCMain12             : VAEntrypointVLD
      VAProfileHEVCMain12             : VAEntrypointEncSlice
      VAProfileHEVCMain422_10         : VAEntrypointVLD
      VAProfileHEVCMain422_10         : VAEntrypointEncSlice
      VAProfileHEVCMain422_12         : VAEntrypointVLD
      VAProfileHEVCMain422_12         : VAEntrypointEncSlice
      VAProfileHEVCMain444            : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10         : VAEntrypointVLD
      VAProfileHEVCMain444_10         : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_12         : VAEntrypointVLD
      VAProfileHEVCSccMain            : VAEntrypointVLD
      VAProfileHEVCSccMain            : VAEntrypointEncSliceLP
      VAProfileHEVCSccMain10          : VAEntrypointVLD
      VAProfileHEVCSccMain10          : VAEntrypointEncSliceLP
      VAProfileHEVCSccMain444         : VAEntrypointVLD
      VAProfileHEVCSccMain444         : VAEntrypointEncSliceLP
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileHEVCSccMain444_10      : VAEntrypointVLD
      VAProfileHEVCSccMain444_10      : VAEntrypointEncSliceLP
hmaarrfk commented 2 weeks ago

Ok thanks for the pointer, we likely need to adjust libva

https://github.com/intel/libva/blob/master/meson.build#L78

in a similar way to: https://github.com/conda-forge/libglvnd-feedstock/blob/main/recipe/libglvnd_look_for_egl_icd_in_system_location.patch

hmaarrfk commented 2 weeks ago

On ubuntu the drivers are installed in:

/usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so

the fact that they are in this directory makes me feel like it is hard to point to, and we might as well build the "userland" driver ourselves no?

ehfd commented 2 weeks ago

I amend my previous answer. There should be enviroment variables for this situation such as LIBVA_DRIVERS_PATH and LIBVA_DRIVER_NAME. Then, it doesn't matter.

ehfd commented 2 weeks ago

https://wiki.archlinux.org/title/Hardware_video_acceleration#Configuring_VA-API