VAAPI not working on Radeon GPU

Hi.

I created a bug report here: Issues · OpenMandrivaAssociation/distribution · GitHub

I write on the forum because the forum is visited by more people than a bugtrack and I need feedback froum people.

What is going on?

VAAPI does not work on OpenMandriva LX3.03 x64. My GPU is Radeon HD5850. More details in bugtrack in file bug-report.

When I use vainfo command I have this issue:

[x@x-OpenMandriva ~]$ vainfo
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/r600_drv_video.so
libva error: /usr/lib64/dri/r600_drv_video.so has no function __vaDriverInit_0_32
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

Worth do add, on this same PC but on other Linux distro, VAAPI working fine. Here details from Mageia 6 and Ubuntu 17.10.

Mageia 6:

[x@localhost ~]$ vainfo
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/r600_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3)
vainfo: Driver version: mesa gallium vaapi
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc

and this from Ubuntu 17.10

x@x:~$ vainfo
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so
libva info: Found init function __vaDriverInit_0_40
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.40 (libva )
vainfo: Driver version: mesa gallium vaapi
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc

Also any player like vlc or mpv or chromium-vaapi not want to work with vaapi enabled - so looks like something is broken.

What I found also?

On Mageia 6 and Ubuntu 17.10 the version of vaapi version and vaDriverInit is correct but in the case of OpenMandriva, we have different version.

See.

OpenManddriva: VA-API version 0.40.0 vs __vaDriverInit_0_32 - wrong?
Mageia 6 : VA-API version 0.39.4 vs __vaDriverInit_0_39 - match?
Ubuntu 17.10 : VA-API version 0.40.0 vs __vaDriverInit_0_40 - match?

Second case. I noticed that in OpenMandriva versions of vaapi packages do not match with versions. They fit in Mageia but not in OpenMandriva.
Look:

OpenMandriva LX3:
lib64va1-1.7.1-1-omv2015.0.x86_64.rpm
libva-intel-driver-1.7.3-1-omv2015.0.x86_64.rpm

So quick summary 1.7.1 vs 1.7.3 - wrong?

For example in Mageia6 this look:
lib64va1-1.7.3-3.mga6.x86_64.rpm
vaapi-driver-intel-1.7.3-1.mga6.x86_64.rpm

So 1.7.3 vs 1.7.3 - match?

have just noticed that we also have the latest version of libva2 installed by default, which can cause compatibility problems. Interestingly, libva2 is in the system despite the presence of the old version of libva.

So we have:

lib64va1-1.7.1-1-omv2015.0.x86_64.rpm
libva-intel-driver-1.7.3-1-omv2015.0.x86_64.rpm

and

lib64va2-2.0.0-1-omv2015.0.x86_64.rpm

Maybe this two library at once is causing this issue? I checked what the libraries in the cooker and I see that there is no old version - only libva2.
So?

Worth to add, Im trying remove lib64va1 and libva2 but both have alot of dependencies and remove it is not a good option…

So guys, anyone can test vaapi on LX 3? Maybe this issue is not only on my machine.

This is kind of partly an answer to that. Not one any of us prefer.

There are a lot of things in multi-media that will depend on these libraries. And something got broken when a new libva package was introduced. That is at least partly because introducing libva by itself isn’t enough, all the packages that depend on it need to be rebuilt. That is in progress as described here.

Thanks for reply.

Just added both testing repo x86_64 and i586. Update process install only one new package - libva-utils-2.0.0-1-omv2015.0.x86_64.rpm

After this vainfo command start working fine but only this is fixed now.

[x@x-OpenMandriva ~]$ vainfo
libva info: VA-API version 1.0.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/r600_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.0 (libva 2.0.0)
vainfo: Driver version: mesa gallium vaapi
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc

When I launch VLC I still see in terminal error:

libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/r600_drv_video.so
libva error: /usr/lib64/dri/r600_drv_video.so has no function __vaDriverInit_0_32
libva info: va_openDriver() returns -1
[00007fd3e008b658] vaapi_x11 generic error: Failed to initialize the VAAPI device

and this with chromium patched for vaapi

libva error: /usr/lib64/dri/r600_drv_video.so has no function __vaDriverInit_0_32
[10123:10123:0208/164324.546817:ERROR:vaapi_wrapper.cc(276)] vaInitialize failed: unknown libva error

So apps like VLC, MPV or smplayer/mplayer need to be rebuild now… for VLC is good opportunity, because today or tomorrow should out stable edition of VLC 3.0

This rebuilding of multimedia packages is in progress but will take some time.

Do be aware and careful with testing repos. You can break things using testing repo including breaking your system. That is the nature of testing. If you or anyone does have problems that appear to be caused by something in testing repo please report in Taster (development testing) category and we will do our best to help you sort things out. OR if warranted please file a bug report.

Also I need to mention that @TPG and @Colin are working on some automatic testing protocols that will make this breakage much more rare in the future. When they deploy everything problems will be dramatically fewer. And patience, they are both part time volunteers (as we all are) with other responsibilities in life.

Aside: I keep testing repos disabled normally and only enable them at specific times either when need for testing is urgent or I have time to test. I also keep i586 repos disabled unless I have a need for them. These are good habits to develop.

New libva is avaialabe in testing. mpv, ffmpeg and other should be available soon.

What is vaapi? What can it do for me on a desktop or notebook computer? How do I set it up? How do I test it?

I’m both asking questions here but also Google-ing to find answers and maybe learn something.

This is a chance for the user/users to train the old curmudgeon.

Oh poop. :poop: This is my Intel graphic hardware on my desktop (ASUS H97M-E/CSM motherboard)

Graphic
Integrated Graphics Processor- Intel® HD Graphics support
Multi-VGA output support : HDMI/DVI-D/RGB ports

  • Supports HDMI with max. resolution 4096 x 2160 @ 24 Hz / 2560 x 1600 @ 60 Hz
  • Supports DVI-D with max. resolution 1920 x 1200 @ 60 Hz
  • Supports RGB with max. resolution 1920 x 1200 @ 60 Hz
    Maximum shared memory of 512 MB
    Supports Intel® InTru™ 3D, Quick Sync Video, Clear Video HD Technology, Insider™
    Supports up to 3 displays simultaneously

Don’t see support for vaapi there. Am I wrong? If this one does not support then my notebooks certainly won’t.

And this is actual graphichs from CPU Intel® Core™ i5-4590 Processor

Processor Graphics

Processor Graphics ‡ Intel® HD Graphics 4600
Graphics Base Frequency 350 MHz
Graphics Max Dynamic Frequency 1.15 GHz
Graphics Video Max Memory 2 GB
Graphics Output eDP/DP/HDMI/VGA
Max Resolution (HDMI 1.4)‡ 4096x2304@24Hz
Max Resolution (DP)‡ 3840x2160@60Hz
Max Resolution (eDP - Integrated Flat Panel)‡ 3840x2160@60Hz
Max Resolution (VGA)‡ 1920x1200@60Hz
DirectX* Support 11.2/12
OpenGL* Support 4.3
Intel® Quick Sync Video Yes
Intel® InTru™ 3D Technology Yes
Intel® Flexible Display Interface (Intel® FDI) Yes
Intel® Clear Video HD Technology Yes
# of Displays Supported ‡ 3
Device ID 0x412

Not sure if I even have Video Acceleration API available. :confounded:

Actually on an ASUS notebook at the moment with:

Intel® Core™ i5-3337U Processor

Processor Graphics

Processor Graphics ‡ Intel® HD Graphics 4000
Graphics Base Frequency 350 MHz
Graphics Max Dynamic Frequency 1.10 GHz
Graphics Output eDP/DP/HDMI/SDVO/CRT
Intel® Quick Sync Video Yes
Intel® InTru™ 3D Technology Yes
Intel® Flexible Display Interface (Intel® FDI) Yes
Intel® Clear Video HD Technology Yes
# of Displays Supported ‡ 3
Device ID 0x166

Now for some code. These are packages installed:

$ rpm -qa | grep lib64va
lib64va2-2.0.0-2-omv2015.0.x86_64

$ rpm -qa | grep libva
libva-intel-driver-2.0.0-1-omv2015.0.x86_64
libva-utils-2.0.0-2-omv2015.0.x86_64

Verifying VA-API:

$ vainfo
libva info: VA-API version 1.0.0
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_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.0 (libva 2.0.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Ivybridge Mobile - 2.0.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD

So, changed my mind now, looks like I do have VAAPI installed and functioning on this ASUS X550C notebook with Intel i965 driver.

Now my understanding is that if I have this it will “just work” where it is supposed to. So back to my original question how do I test this? What are some good tests?

Hardware video acceleration makes it possible for the video card to decode/encode video, thus offloading the CPU and saving power.
About Hardware acceleration video and VAAPI/VDPAU/Other, you can read more here: Hardware video acceleration - ArchWiki

So how to test it?
Open VLC or MPV and try watch video in h264 and check if vaapi is used. Run it in terminal and see if vaapi is loaded and working.

We can also use vaapi for decoding videos in browser like chromium but default chromium is still not patched for this. In works is official patch for this here: https://chromium-review.googlesource.com/c/chromium/src/+/532294
it waiting for merge, when they marge it all future chromium releases should work with vaapi. But for now vaapi for chromium is disabled. To make it work, we need compile chromium with this patch or use unofficial builds for example we have one for arch called chromium-vaapi or ppa for ubuntu with chromium-beta and chromium-dev with vaapi enabled. This ppa for ubuntu use this patch: https://github.com/saiarcot895/chromium-ubuntu-build/blob/master/debian/patches/enable_vaapi_on_linux_2.diff
and packages we can download here: Chromium Dev branch : Saikrishna Arcot

For my case, without vaapi, decoding video is software, so my CPU usage in movies 720p or 1080p is about 50-80%. Also my video playing stutters.

But when enable video hardware acceleration for example via VAAPI my GPU is used to decode video. Thanks to this I can watch without any issue videos like 1080p even on old hardware without stutters and with cpu usage at 10-20%. This also allows for longer battery life in notebooks.

1 Like

Thanks @AngryPenguin , that’s what I needed. And also I have a better understanding for why vaapi is used and is useful.

What is VAAPI?

How to test yoyur hardware does support it:
run as root urpmi libva-utils
then execute vainfo

How to use it?
Install VLC or SMplayer or mpv and adjust theirs video output setting to use VAAPI.

1 Like

Here is a test with intel i965 driver:

$ vainfo
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
libva error: /usr/lib64/dri/i965_drv_video.so has no function __vaDriverInit_0_32
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

Here are installed packages:

$ rpm -qa | grep libva
libva2-2.0.0-2-omv2015.0.i586
libva-intel-driver-2.0.0-1-omv2015.0.x86_64
libva-utils-1.7.1-1-omv2015.0.x86_64

$ rpm -qa | grep intel
lib64drm_intel1-2.4.89-1-omv2015.0.x86_64
microcode-intel-20180108-1-omv2015.0.noarch
libdrm_intel1-2.4.89-1-omv2015.0.i586
x11-driver-video-intel-2.99.917-6.20161122.1-omv2015.0.x86_64
libva-intel-driver-2.0.0-1-omv2015.0.x86_64
lib64dri-drivers-intel-17.3.3-1-omv2015.0.x86_64
libdri-drivers-intel-17.3.3-1-omv2015.0.i586

To make it work correct, you need update libva-utilis to version 2.0.0 from testing repo.

1 Like

Please get rid off this package out of your system.

1 Like

BTW. Few days ago, intel team released libva 2.1 Releases · intel/libva · GitHub

The result is slightly different:

$ vainfo
libva info: VA-API version 1.0.0
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_0
libva error: /usr/lib64/dri/i965_drv_video.so init failed
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

$ rpm -qa | grep intel
lib64drm_intel1-2.4.89-1-omv2015.0.x86_64
microcode-intel-20180108-1-omv2015.0.noarch
libdrm_intel1-2.4.89-1-omv2015.0.i586
libva-intel-driver-2.0.0-1-omv2015.0.x86_64
lib64dri-drivers-intel-17.3.3-1-omv2015.0.x86_64
libdri-drivers-intel-17.3.3-1-omv2015.0.i586

$ rpm -qa | grep libva
libva2-2.0.0-2-omv2015.0.i586
libva-intel-driver-2.0.0-1-omv2015.0.x86_64
libva-utils-2.0.0-2-omv2015.0.x86_64

$ rpm -qa | grep lib64va
lib64vamp-plugin-sdk2-2.4-9-omv2015.0.x86_64
lib64va1-1.8.3-2-omv2015.0.x86_64
lib64va2-2.0.0-2-omv2015.0.x86_64

Feel free to prepare pull request :slight_smile: to our github.com repository.

Done. Pull for intel-vaapi-driver and libva ready.

Tested if libva build in my personal repo and with enabled utilis - build fine: https://abf.openmandriva.org/build_lists/152787

2 Likes