r600 and radeonsi (presumably also amdgpu in the future) also support video decoding through vaapi (in addition to vdpau and openmax). On Gentoo however, this is broken, as vainfo looks for (in the case of r600) r600_drv_video.so in /usr/lib/va/drivers. ln -s /usr/lib/dri/gallium_drv_video.so /usr/lib/va/drivers/r600_drv_video.so fixes it (on r600, ln -s /usr/lib/dri/gallium_drv_video.so /usr/lib/va/drivers/radeonsi_drv_video.so should work for radeonsi cards) Reproducible: Always Steps to Reproduce: 1.install mesa on a system with a radeon GPU (HD4000+) and vainfo 2. select mesa as provider of everything 3. run vainfo Actual Results: $ vainfo libva info: VA-API version 0.35.1 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib64/va/drivers/r600_drv_video.so libva info: va_openDriver() returns -1 vaInitialize failed with error code -1 (unknown libva error),exit Expected Results: $ vainfo libva info: VA-API version 0.35.1 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib64/va/drivers/r600_drv_video.so libva info: Found init function __vaDriverInit_0_35 libva info: va_openDriver() returns 0 vainfo: VA-API version: 0.35 (libva 1.3.1) vainfo: Driver version: mesa gallium vaapi vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD VAProfileMPEG4Simple : VAEntrypointVLD VAProfileMPEG4AdvancedSimple : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileH264Baseline : VAEntrypointVLD VAProfileH264Main : VAEntrypointVLD VAProfileH264High : VAEntrypointVLD a link should be made for every driver supporting vaapi, to make it work by default.
Confirmed run-time-only bug, here. I.e., this breaks media-libs/libbluray[java] for me (I have a multi-card radeonsi + r600 system in case that matters somehow). Making the symlink, manually, as described in original report fixes the crashes (or, more accurately, in my case, gets me past these crashes and on to the next ones, sigh...).
setting LIBVA_DRIVER_NAME=gallium also enables the use of vaapi through mesa on radeon. Actually now that I think about it, and having looked at archlinux libva-mesa package, I think this might be a candidate to report upstream. I'd like to know whether this course would be appropriate before doing so though.
Mesa ebuild should pass --with-va-libdir=/usr/lib/va/drivers to ./configure
Also it's not specific to radeon, probably should change bug title.
I don't have a radeon to test, so please attach an ebuild patch and I'll be happy to commit it.
(In reply to xpue from comment #3) > Mesa ebuild should pass --with-va-libdir=/usr/lib/va/drivers to ./configure It just change the location of gallium_drv_video.so: --with-va-libdir=/usr/$(get_libdir)/va/drivers $ qlist mesa | grep va /usr/lib64/va/drivers/gallium_drv_video.so /usr/lib/va/drivers/gallium_drv_video.so But it's not enough. libva is still looking for specific driver: r600_drv_video.so or radeonsi_drv_video.so for radeon and there should be the same problem with intel drivers. Environment variable LIBVA_DRIVER_NAME or symlinks are still needed.
I've corrected where the VAAPI drivers are installed, but the upstream build system is not creating the hardlinks (to radeonsi_drv_video for example) properly. commit f78f3042acf3ac4d2b88b58ea28c2cf41bcde47e Author: Matt Turner <mattst88@gentoo.org> Date: Sat Aug 29 15:37:51 2015 -0700 media-libs/mesa: Install VAAPI drivers to correct location.
>or symlinks are still needed Vaapi support is being integrated to nouveau, such symlinks would clash with symlinks being installed by x11-libs/libva-vdpau-driver.
(In reply to xpue from comment #8) IMHO native mesa's vaapi implementation should be preffered over vaapi support provided by libva-vdpau-driver. Otherwise eselect module should be implemented. There is also a conflicting proposal for radeon: bug 559912
this looks similar to this ubuntu report: https://bugs.launchpad.net/ubuntu/+source/vdpau-video/+bug/964040 if LIBVA_DRIVER_NAME=vdpau vainfo works maybe it's the same
I can confirm that "LIBVA_DRIVER_NAME=vdpau vainfo" works. My Graphic Card is a Radeon HD 7520G, so the driver is R600. If I run "vainfo" I get: libva info: VA-API version 0.38.0 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib64/va/drivers/r600_drv_video.so libva info: va_openDriver() returns -1 vaInitialize failed with error code -1 (unknown libva error),exit If I specify the driver via the ENV-Var I get: libva info: VA-API version 0.38.0 libva info: va_getDriverName() returns 0 libva info: User requested driver 'gallium' libva info: Trying to open /usr/lib64/va/drivers/gallium_drv_video.so libva info: Found init function __vaDriverInit_0_38 libva info: va_openDriver() returns 0 vainfo: VA-API version: 0.38 (libva 1.6.1) vainfo: Driver version: mesa gallium vaapi vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD If I first run into this bug, I debuged vainfo and I think this matter is a bit more complicated. - vainfo retrieves the name of the driver from the (display)-context (so mesa?!?) so, the component who tells vainfo the driver-name should place a va-driver in the right directory?! Right? - the driver name can be override via and ENV-var or maybe via a configuration-file. I haven't found time to search for the file. - specifying which driver (r600,radeonsi,gallium,vdpau) is complicated. If your graphics-driver directly support va-vapi than radeonsi,r600 might the best choice. If your hardware "only" supports vdpau than this would give the best of results. Gallium (the mesa fallback) should "always" work, but I'm not sure about the performance
Created attachment 415596 [details, diff] mesa-drivers.patch This is the patch they are using for x11-libs/libva-vdpau-driver, we have a similar one for nouveau but not for the others
(In reply to Pacho Ramos from comment #12) Err.. This bug is about native vaapi support via gallium. There is a bug #559912 for vaapi support via libva-vdpau-driver wrapper.
Related ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/1481832
Originally I would get this: # vainfo libva info: VA-API version 0.38.1 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib64/va/drivers/radeonsi_drv_video.so libva info: va_openDriver() returns -1 vaInitialize failed with error code -1 (unknown libva error),exit I have a Bonaire based AMD/ATI card. I had to go to: /usr/lib64/va/drivers/ and do: ln -s gallium_drv_video.so radeonsi_drv_video.so Now I have: # vainfo libva info: VA-API version 0.38.1 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib64/va/drivers/radeonsi_drv_video.so libva info: Found init function __vaDriverInit_0_38 libva info: va_openDriver() returns 0 vainfo: VA-API version: 0.38 (libva 1.6.2) vainfo: Driver version: mesa gallium vaapi vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileH264Baseline : VAEntrypointVLD VAProfileH264Main : VAEntrypointVLD VAProfileH264High : VAEntrypointVLD VAProfileNone : VAEntrypointVideoProc
Should be fixed by the following commit: https://cgit.freedesktop.org/mesa/mesa/commit/?id=0c0f841e5de27d01312f8857641668ca439b1ab1 And the fix probably will be included in mesa-12.0 release.
And please change the subject. libva-vdpau-driver is unrelated to this bug report.
I can confirm, that this bug was fixed in mesa-12.0.0-rc3. Now all gallium driver instances are hardlinks: $ ls -l /usr/lib64/va/drivers/ итого 7220 -rwxr-xr-x 1 root root 984 янв 16 04:51 i965_drv_video.la -rwxr-xr-x 1 root root 1818272 янв 16 04:52 i965_drv_video.so -rwxr-xr-x 2 root root 2781536 июн 17 05:00 r600_drv_video.so -rwxr-xr-x 2 root root 2781536 июн 17 05:00 radeonsi_drv_video.so $ vainfo libva info: VA-API version 0.38.1 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib64/va/drivers/radeonsi_drv_video.so libva info: Found init function __vaDriverInit_0_38 libva info: va_openDriver() returns 0 vainfo: VA-API version: 0.38 (libva 1.6.2) vainfo: Driver version: mesa gallium vaapi vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileH264Baseline : VAEntrypointVLD VAProfileH264Main : VAEntrypointVLD VAProfileH264High : VAEntrypointVLD VAProfileNone : VAEntrypointVideoProc
Marking as fixed since mesa-12.0.0.1 is in the tree.