protonscr

Hardware video acceleration doesn't work when streaming with Intel graphics on Ubuntu 18.04

steamclosed runtimeStreaming
ValveSoftware/steam-for-linux#5339 · opened 2018-01-13 by mmolch · updated 2020-01-24 · 57 comments · github
Mmmolch 2018-01-13 github

Your system information

  • Steam client version (build number or date): 1513870789
  • Distribution (e.g. Ubuntu): Ubuntu
  • Opted into Steam client beta?: Yes
  • Have you checked for system updates?: Yes

Please describe your issue in as much detail as possible:

I only get software decoding when I stream games on Ubuntu 18.04. Apparently 18.04 only has libva2 which isn't ABI compatible with previous versions so also making symlinks doesn't work.

Kkisak-valve maintainer 2018-01-27 github

Hello @hoehermann, the issue in this report is about a dependency issue with Ubuntu 18.04 and may be an issue with rolling releases. Please open a new issue report as your issue is unrelated to libva.so.1 vs. libva.so.2.

Bbrokkr 2018-09-14 github

I'm also affected after moving to Ubuntu 18.04 (as are a number of other users). I am, howver, unable to find any new/replacement issue. Was any ever created?

Kkisak-valve maintainer 2018-09-14 github

Hello @brokkr, my memory seems to recall my previous comment was in regards to a now removed comment about hardware accelerated encoding, while this is on the decode side. This issue is currently marked open as indicated directly below the issue title at the top of the page.

Hhoehermann 2018-09-14 github

@kisak-valve @brokkr Apparently, my comment was deleted. I never created a separate issue.

Bbrokkr 2018-09-17 github

This issue is currently marked open as indicated directly below the issue title at the top of the page.

So it is. Apologies.

Jjjardon 2018-10-25 github

Are any of you aware of any workaround to solve this problem?

Mmaxice8 2018-10-26 github

@jjardon Distros can work around by shipping old libva as libva1 and libva1-intel-driver and libva-2 as libva, like arch does.

Users can take their luck downloading old libva packages and trying them out.

Ddrzee99 2018-10-26 github

@maxice8 - I'm using arch and it has the exact same error despite the packages you mention. The issue is deeper. Steam will use ffmpeg for the decoding and the latest version of ffmpeg on Arch is set to use libva2.

The error is:
ffmpeg verbose: Opened VA display via X11 display :0.
ffmpeg error: Failed to initialise VAAPI connection: -1 (unknown libva error).
CVAAPIAccel: av_hwdevice_ctx_create() failed

As a lot of packages depend on ffmpeg, and as a result a lot of packages will have to be downgraded if you would want to downgrade ffmpeg.

Best option is to get steam-native to use libva2 ......

Mmirh 2018-10-28 github

Those packages are 64-bit.
Check for all: lib32-libva, lib32-libva1, lib32-libva1-intel-driver and lib32-libva-intel-driver (just to be on the safe side of the issue)

Nnonchip 2018-10-28 github

Those packages are 64-bit.

which ones? nobody mentioned packages as far as i can see

Check for all: lib32-libva, lib32-libva1, lib32-libva1-intel-driver and lib32-libva-intel-driver (just to be on the safe side of the issue)

as already established above, just getting downgraded libva doesn't help, since steam also requires an antiquated ffmpeg.

Ddreamawakening 2018-11-20 github

How can I install the old libva packages? I'm using Ubuntu 18.04. I tried using apt but they're not available, and I don't know how to install them from the Arch repo.

Nnonchip 2018-11-20 github

How can I install the old libva packages?

that's exactly the issue: on most distros you just can't because just too much stuff depends on it and would have to be downgraded.

you can kinda work around it using a flatpak'd steam but that's ugly as hell (the core concept is essentially "hey let's put OSX's .app files on linux and spit at every notion of a package manager by ignoring it, security by installing lots of old vulnerable stuff, and usability by trying to fix the security issue with android-style sandboxing"; what could possibly go wrong) and you have to breach the sandbox to continue using your steam library. and don't even get me started on interoperability with e.g. pulseaudio (took me a day to make the "seamless sound integration" of flatpak actually produce any sound) or game controllers. since you're on ubuntu and that's what everyone optimizes for your mileage may vary usability wise, but it's still ugly by design :P

Ddreamawakening 2018-11-20 github

@nonchip thanks for the response. Steam requires those libraries and I haven't found any way to install them... So how can I install it?

Nnonchip 2018-11-20 github

@nonchip thanks for the response. Steam requires those libraries and I haven't found any way to install them... So how can I install it?

um what exactly was not clear about "you can not do it" that you still ask how you can do it even though you can not? -_-
why do you think we reported this issue with valve if it wasn't an issue...

Eevilynux 2019-02-06 github

I wish this issue would gain more traction, there are a lot of laptops with integrated Intel graphics that would benefit from an upgrade to libva2.

MMaghin 2019-02-19 github

ffmpeg verbose: Opened VA display via X11 display :0.
ffmpeg error: Failed to initialise VAAPI connection: -1 (unknown libva error).
CVAAPIAccel: av_hwdevice_ctx_create() failed

Same error on Fedora 28, there is still no workaround ? It just broke with a system update ?

MMaghin 2019-02-21 github

It seem's to be resolved on my Fedora 28 worstation.
I try to install MoonLight with flatpak, and I did a flatpak update command then.
I don't know if it's what i've done or the yersterday steam update on the windows host but the now the streaming with the linux steam client works too.

Ttoojays 2019-03-02 github

I got hardware decoding working on my Skylake / Iris Graphics 540 laptop running Ubuntu 18.04 with the following steps:

  1. Manually download the xenial or xenial-updates versions of the following packages via packages.ubuntu.com: i965-va-driver:i386, libva-drm1:i386, libva-x11-1:i386, libva1:i386.

  2. Install these packages manually via dpkg. I passed --force-all in some instances to squelch complaints about overwriting shared documentation files, and in response to errors like package i965-va-driver:i386 1.7.0-1 cannot be configured because i965-va-driver:amd64 is at a different version (2.1.0-0ubuntu1). In hindsight I'm not sure any --force option makes a difference for the latter error - the files get installed, perhaps it doesn't matter that dpkg-configure failured.

After that the i386 va packages on my system are:

toojays@nugget:~$ dpkg -l *va[-1]*:i386 
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                      Version                   Architecture              Description
+++-=========================================-=========================-=========================-========================================================================================
iU  i965-va-driver:i386                       1.7.0-1                   i386                      VAAPI driver for Intel G45 & HD Graphics family
ii  libva-drm1:i386                           1.7.0-1ubuntu0.1          i386                      Video Acceleration (VA) API for Linux -- DRM runtime
ii  libva-glx2:i386                           2.1.0-3                   i386                      Video Acceleration (VA) API for Linux -- GLX runtime
ii  libva-x11-1:i386                          1.7.0-1ubuntu0.1          i386                      Video Acceleration (VA) API for Linux -- X11 runtime
ii  libva-x11-2:i386                          2.1.0-3                   i386                      Video Acceleration (VA) API for Linux -- X11 runtime
ii  libva1:i386                               1.7.0-1ubuntu0.1          i386                      Video Acceleration (VA) API for Linux -- runtime
  1. Delete steam's internal copies of the va libraries using rm -f ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva*.

I think that's it, anyway. Apologies if I missed something.

Ttoojays 2019-03-04 github

Okay, my previous solution for Ubuntu 18.04 has a major flaw. It breaks apt. E.g.:

toojays@nugget:~$ sudo apt-get install wakeonlan 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 i965-va-driver : Breaks: i965-va-driver:i386 (!= 2.1.0-0ubuntu1) but 1.7.0-1 is to be installed
 i965-va-driver:i386 : Breaks: i965-va-driver (!= 1.7.0-1) but 2.1.0-0ubuntu1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

There may be a better way to do this, by installing the necessary older libraries under $HOME/.local/share/Steam/ubuntu12_32/steam-runtime/pinned_libs_32, and setting the LIBVA_DRIVERS_PATH environment variable to tell libva to look in there.

Ttoojays 2019-03-04 github

Yep, this seems to do the trick. AFACT Steam will delete & recreate the pin directories in response to OS updates and Steam updates. That will break what this script is trying to do. If I use this script to launch Steam, I should just be able to restart Steam (via this script) to recreate my workaround.

Hopefully its short enough that anyone else needing to use it can follow it. You'll need to manually download the i965-va-driver package and make sure this script can find it.

#!/bin/bash
#
# Setup a driver for hardware streaming support with Intel graphics compatible
# with Steam, and launch Stream with an environment variable set to use it.
# This is a workaround for
# https://github.com/ValveSoftware/steam-for-linux/issues/5339

# This version of the i965 VA driver supports at least Skylake's Iris Graphics 540.
# I tried i965-va-driver_1.8.3-1ubuntu1_i386.deb, but that fails to load with
#   libva error: /home/toojays/.local/share/Steam/ubuntu12_32/steam-runtime/i386/../pinned_libs_32/i965_drv_video.so has no function __vaDriverInit_0_32
# Get it from any Ubuntu mirror, e.g. http://mirror.internode.on.net/pub/ubuntu/pool/universe/i/intel-vaapi-driver/i965-va-driver_1.7.0-1_i386.deb
DRIVER_PACKAGE=i965-va-driver_1.7.0-1_i386.deb

# Download the above package to this directory.
PACKAGE_DIR=$HOME

# You probably don't need to change these two.
TARGET_ROOT=$HOME/.local/share/Steam/ubuntu12_32/steam-runtime/i386
PIN_DIR=$TARGET_ROOT/../pinned_libs_32

# Unpack the i965 VAAPI drivers.
dpkg --vextract $PACKAGE_DIR/$DRIVER_PACKAGE $TARGET_ROOT

# "Pin" the old versions of VAAPI bundled with Steam. This tells Steam to prefer
# these libraries over any which are in the system's default library search
# path.
ln -sf --target-directory $PIN_DIR $TARGET_ROOT/usr/lib/i386-linux-gnu/{libva.so.1,libva-x11.so.1}

# Tell libva how to find to i965_drv_video.so when we run steam.
LIBVA_DRIVERS_PATH=$TARGET_ROOT/usr/lib/i386-linux-gnu/dri steam
Eevilynux 2019-03-08 github

Thanks for the suggestions/procedure @toojays! Once adapted to Debian unstable, works fine for me and makes a whole lot of a difference on my poor old laptop.

FWIW, it translates to downloading i965-va-driver_1.8.3-1_i386.deb, libva1_1.8.3-2_i386.deb, libva-drm1_1.8.3-2_i386.deb, and libva-x11-1_1.8.3-2_i386.deb from https://snapshot.debian.org/. Followed by changing the paths in your proposed bash script to match what I have. And I confirm that it wasn't necessary to use --force to install the last three.

Ssa318 2019-03-26 github

@toojays I played around with your fix, swapping higher and higher drivers in and out. FWIW, the highest working version I found was 1.7.3-1. Steam would not recognized anything at or above 1.8.0 as a valid hardware driver. Thanks for the workaround, it's pretty clean.

Iikogan 2019-04-23 github

This is now making streaming unplayable in 19.04. I'm not sure what changed between 18.04 and 19.04 but I now get stutters and lag with the same setup as I had a few days ago on 18.10.

Mmikew 2019-04-23 github

I'm not able to get @toojays script to work on Ubuntu 18.04. I've downloaded i965-va-driver from https://packages.ubuntu.com/xenial/i965-va-driver, adjusted PACKAGE_DIR in the script, but whenever I stream a game it's still using software decoding.

I do see this in the stdout:

libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /home/mike/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva error: /home/mike/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/dri/i965_drv_video.so init failed
libva info: va_openDriver() returns -1
Eevilynux 2019-04-24 github

@mikew Is the DRIVE_PACKAGE path correct? Is the TARGET_ROOT correct?

Mmikew 2019-04-24 github

The DRIVER_PACKAGE path is correct, I can see the output from dpkg --vextract as it does its thing. And I'm new to steam-for-linux, but I'm guessing TARGET_ROOT is correct. It's definitely a place Steam has dumped a whole lot of stuff. The resulting links in pinned_libs_32 are all valid.

This is on a strange stick PC though, I wouldn't be suprised if it's just an odd chipset. FWIW the software decoder performs real decent, was just hoping to take some of the load off.

EDIT Even after trying a few things:

  • i965.alpha_support=1
  • editing ~/.drirc. This boosted my FPS in glxgears
  • trying the flatpak variant

... nothing got passed that strange va_openDriver() returns -1.

Moonlight, however, worked fine with hardware acceleration (using half the CPU of Steam), can boot with just startx (kb/controller input on Steam doesn't work when launched that way), and can go right into streaming Big Picture (Big Picture runs sluggish on this device when running locally). That's 99% of what I'm after.

Eevilynux 2019-04-26 github

@mikew Have you managed to get hardware video decoding to work with anything else, e.g., ffmpeg+libva2? Perhaps the support for that chipset is too recent for the 1.7.x series?

Mmikew 2019-04-26 github

I haven't verified using ffmpeg or VLC, I'm just going off the fact that glxinfo / xdpyinfo / glxgears / Moonlight all seem to work / report it working. I'll try a better test this weekend.

Mmikew 2019-04-28 github

Looks like things work fine in VLC:

mike@mike-Access3:~$ cvlc -v ~/Downloads/sintel-2048-surround.mp4 
VLC media player 3.0.4 Vetinari (revision 3.0.4-0-gf615db6332)
[000055ed63310460] dummy interface: using the dummy interface module...
[00007feca8c183c0] mp4 demux warning: elst box found
[00007feca8c183c0] mp4 demux warning: STTS table of 1 entries
[00007feca8c183c0] mp4 demux warning: CTTS table of 11429 entries
[00007feca8c183c0] mp4 demux warning: STTS table of 1 entries
[00007feca99425e0] faad decoder warning: decoded zero sample
libva info: VA-API version 1.1.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_1
libva info: va_openDriver() returns 0
[00007feca9881e20] avcodec decoder: Using Intel i965 driver for Intel(R) Gemini Lake - 2.1.0 for hardware decoding
Sshoober420 2019-05-07 github

Although some Linux Steam games may require older versions of libraries, like OpenSSL for example, the Steam client itself requiring older libraries is completely unacceptable and dangerous for the client, security and performance wise.

Kkhanson679 2019-06-04 github

I'm on Ubuntu 18.10, and I absolutely cannot get @toojay's workaround to function. I can get Steam to load the libva.so.1 and etc. (not sure why this part is needed, since the Steam runtime already has those), but it will not load the older i965_drv_video.so no matter what.

What's even more baffling to me is that Steam happily loads the system driver (named i965_dri.so for me), but doesn't give any errors about any mismatch between that and the runtime libva in the first place.

DDiablo-D3 2019-06-06 github

Can someone from Valve officially comment on this issue? This is essentially a release blocker for Steam for any currently shipping distro. libva2 started shipping about 1.5 years ago, major distros included it about a year ago, so I don't understand why this has taken so long to fix.

Ddylanetaft 2019-06-10 github

Same issue here. HW Decoding no longer works after upgrade to Ubuntu 18.04
Installing breakpad exception handler for appid(streaming_client)/version(1.0)
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/i386-linux-gnu/dri/r600_drv_video.so
libva error: /usr/lib/i386-linux-gnu/dri/r600_drv_video.so has no function __vaDriverInit_0_32
libva info: va_openDriver() returns -1

Rrichardacre 2019-06-13 github

@Plagman - any chance of an update on this? It's been open for a year and a half! I recently setup a new Ubuntu 18.10 box for Steam, Kodi and Emulation on my main TV and this is a major problem.

Jjdobes 2019-07-02 github

Is this ever going to be fixed? I think this is a blocker for large number of low-power HTPCs.

JJalle19 2019-07-03 github

This is ridiculous. In-home streaming is perfect for gaming on a laptop, and the lack of hardware decoding is a serious bug. I just updated from Ubuntu 16.04 where it worked to Ubuntu 18.04 where it no longer works, and then I come here and see that it's been broken forever just because you can't be bothered to use modern libraries? What the hell?

GGarreat 2019-09-05 github

I've got an AMD APU with Radeon R5E onboard. Generally the GPU is 2nd gen GCN with UVD4.2 (Unified Video Decoder), it handles H264 decoding.
I can get VDPAU/VA-API working with apps like mplayer, VLC. Outputs from vainfo/vdpauinfo are ok (VAProfileH264 etc). CPU does get offloaded indeed.

Of course I have the same problem: no hardware decoding with Steam Remote Play.
Tried @toojays solution to no success. Bionic 18.04 here. Here's what I've done:

  • manually installed libva1:i386, libva-drm1:i386, libva-x11-1:i386 grabbed from xenial repo
  • grabbed mesa-va-drivers:i386 from xenial repo to use as DRIVER_PACKAGE in the script -- because I'm looking for radeonsi, not i965
  • set TARGET_ROOT=$HOME/.steam/ubuntu12_32/steam-runtime/i386 (thats the default, at least on bionic)
  • run the script

Links are created fine, Steam starts, blah blah, remote play...
ffmpeg error: Failed to initialise VAAPI connection: -1 (unknown libva error).

It falls back to software libavcodec.
Very frustrating. I cannot even force VDPAU as requested in https://github.com/ValveSoftware/steam-for-linux/issues/5236 . Fallback to 16.04 seems like the only option really. That, or some heavyweight Docker struggle.
Dear Steam guys, would you please fix this?
Any suggestions warmly welcome.

TThomasCr 2019-10-12 github

@Garreat - I also get the same -1 (unknown libva error) error with vdpau-va drivers extracted from xenial
I also modified
DRIVER_PACKAGE=vdpau-va-driver_0.7.4-5_i386.deb
So, the drivers get also extracted in the right place

vdr@vdr:~$ ls -lah $HOME/.steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/dri/
insgesamt 152K
drwxr-xr-x  2 vdr vdr 4,0K Okt 13 01:40 .
drwxr-xr-x 20 vdr vdr  20K Apr  7  2016 ..
-rw-r--r--  1 vdr vdr  18K Apr  3  2019 dummy_drv_video.so
lrwxrwxrwx  1 vdr vdr   18 Apr  7  2016 nvidia_drv_video.so -> vdpau_drv_video.so
lrwxrwxrwx  1 vdr vdr   18 Apr  7  2016 s3g_drv_video.so -> vdpau_drv_video.so
-rw-r--r--  1 vdr vdr 106K Apr  7  2016 vdpau_drv_video.so

UPDATE: After debugging, I found, that I missed the package libnvidia-decode-435:i386

To debug, I also downloaded the vainfo from xenial and extracted the binary to a seperate location
Then I was able to run it with

TARGET_ROOT=$HOME/.steam/ubuntu12_32/steam-runtime/i386
LIBVA_DRIVER_NAME=vdpau LIBVA_DRIVERS_PATH=$TARGET_ROOT/usr/lib/i386-linux-gnu/dri LD_LIBRARY_PATH=$TARGET_ROOT/usr/lib/i386-linux-gnu:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu va1info
LIBVA_DRIVER_NAME=vdpau LIBVA_DRIVERS_PATH=$TARGET_ROOT/usr/lib/i386-linux-gnu/dri LD_LIBRARY_PATH=/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:$TARGET_ROOT/usr/lib/i386-linux-gnu va1info

at least I have installed:

$ LANG=C dpkg -l | grep -E '(va|vdpau)[-12i]'
ii  i965-va-driver:amd64                         2.1.0-0ubuntu1                               amd64        VAAPI driver for Intel G45 & HD Graphics family
ii  i965-va-driver:i386                          2.1.0-0ubuntu1                               i386         VAAPI driver for Intel G45 & HD Graphics family
ii  libva-drm1:i386                              1.7.0-1ubuntu0.1                             i386         Video Acceleration (VA) API for Linux -- DRM runtime
ii  libva-drm2:amd64                             2.1.0-3                                      amd64        Video Acceleration (VA) API for Linux -- DRM runtime
ii  libva-drm2:i386                              2.1.0-3                                      i386         Video Acceleration (VA) API for Linux -- DRM runtime
ii  libva-glx1:i386                              1.7.0-1ubuntu0.1                             i386         Video Acceleration (VA) API for Linux -- GLX runtime
ii  libva-glx2:amd64                             2.1.0-3                                      amd64        Video Acceleration (VA) API for Linux -- GLX runtime
ii  libva-glx2:i386                              2.1.0-3                                      i386         Video Acceleration (VA) API for Linux -- GLX runtime
ii  libva-wayland1:i386                          1.7.0-1ubuntu0.1                             i386         Video Acceleration (VA) API for Linux -- Wayland runtime
ii  libva-wayland2:amd64                         2.1.0-3                                      amd64        Video Acceleration (VA) API for Linux -- Wayland runtime
ii  libva-wayland2:i386                          2.1.0-3                                      i386         Video Acceleration (VA) API for Linux -- Wayland runtime
ii  libva-x11-1:i386                             1.7.0-1ubuntu0.1                             i386         Video Acceleration (VA) API for Linux -- X11 runtime
ii  libva-x11-2:amd64                            2.1.0-3                                      amd64        Video Acceleration (VA) API for Linux -- X11 runtime
ii  libva-x11-2:i386                             2.1.0-3                                      i386         Video Acceleration (VA) API for Linux -- X11 runtime
ii  libva1:i386                                  1.7.0-1ubuntu0.1                             i386         Video Acceleration (VA) API for Linux -- runtime
ii  libva2:amd64                                 2.1.0-3                                      amd64        Video Acceleration (VA) API for Linux -- runtime
ii  libva2:i386                                  2.1.0-3                                      i386         Video Acceleration (VA) API for Linux -- runtime
ii  libvdpau-va-gl1:amd64                        0.4.2-1build1                                amd64        VDPAU driver with OpenGL/VAAPI backend
ii  libvdpau-va-gl1:i386                         0.4.2-1build1                                i386         VDPAU driver with OpenGL/VAAPI backend
ii  libvdpau1:amd64                              1.3-0ubuntu0~gpu18.04.2                      amd64        Video Decode and Presentation API for Unix (libraries)
ii  libvdpau1:i386                               1.3-0ubuntu0~gpu18.04.2                      i386         Video Decode and Presentation API for Unix (libraries)
ii  mesa-va-drivers:amd64                        19.0.8-0ubuntu0~18.04.3                      amd64        Mesa VA-API video acceleration drivers
ii  mesa-va-drivers:i386                         19.0.8-0ubuntu0~18.04.3                      i386         Mesa VA-API video acceleration drivers
ii  mesa-vdpau-drivers:amd64                     19.0.8-0ubuntu0~18.04.3                      amd64        Mesa VDPAU video acceleration drivers
ii  mesa-vdpau-drivers:i386                      19.0.8-0ubuntu0~18.04.3                      i386         Mesa VDPAU video acceleration drivers
ii  va-driver-all:amd64                          2.1.0-3                                      amd64        Video Acceleration (VA) API -- driver metapackage
ii  va-driver-all:i386                           2.1.0-3                                      i386         Video Acceleration (VA) API -- driver metapackage
ii  vainfo:i386                                  2.1.0+ds1-1                                  i386         Video Acceleration (VA) API for Linux -- info program
ii  vdpau-driver-all:amd64                       1.3-0ubuntu0~gpu18.04.2                      amd64        Video Decode and Presentation API for Unix (driver metapackage)
ii  vdpau-driver-all:i386                        1.3-0ubuntu0~gpu18.04.2                      i386         Video Decode and Presentation API for Unix (driver metapackage)
ii  vdpau-va-driver:amd64                        0.7.4-6ubuntu1                               amd64        VDPAU-based backend for VA API
ii  vdpau-va-driver:i386                         0.7.4-6ubuntu1                               i386         VDPAU-based backend for VA API
ii  vdpauinfo                                    1.0-3                                        amd64        Video Decode and Presentation API for Unix (vdpauinfo utility)

Hope it helps also others to fix it....

Bbaryluk 2019-10-15 github

As of now, Steam Client does work with its own provided libva1, which is great. I use Debian testing and Debian sid, and there is no libva1 provided anymore, only libva2. It would be nice if Steam Client could migrate to libva2 tho (and possibly provide libva1 for some native games that require it?). I am just afraid that if I migrate to some newer GPU hardware or maybe there are some important changes in Wayland protocol, the old libva1 will simply not support my hardware / software stack.

So, it is not world breaking yet, but definitively it should be updated one day...

MMadh93 2019-10-20 github

@mikew

[00007feca9881e20] avcodec decoder: Using Intel i965 driver for Intel(R) Gemini Lake - 2.1.0 for hardware decoding

Gemini Lake support was added in 1.8.3 version (more info here). Gemini Lake processors:

Model Family Launched GPU Name
J4005 Celeron Q4'17 UHD Graphics 600
J4105 Celeron Q4'17 UHD Graphics 600
J5005 Pentium Silver Q4'17 UHD Graphics 605
N4000 Celeron Q4'17 UHD Graphics 600
N4100 Celeron Q4'17 UHD Graphics 600
N5000 Pentium Silver Q4'17 UHD Graphics 605

https://ark.intel.com/content/www/us/en/ark/products/codename/83915/gemini-lake.html
https://en.wikichip.org/wiki/intel/cores/gemini_lake

So, Xenial packages don't have support (libva=1.7.0). For Gemini Lake it's necessary to download:

Install the previous packages:

sudo dpkg -i libva-drm1_1.8.3-2_i386.deb
sudo dpkg -i libva1_1.8.3-2_i386.deb
sudo dpkg -i libva-x11-1_1.8.3-2_i386.deb

Download:

And update the script with:

  • DRIVER_PACKAGE=i965-va-driver_1.8.3-1ubuntu1_i386.deb
  • TARGET_ROOT=$HOME/.steam/ubuntu12_32/steam-runtime/i386

However, after doing the previous steps I have not been successful under Intel NUC NUC7CJY (J4005 CPU) on Ubuntu 18.04. I'm investigating this issue because @toojays solution works perfect using Xenial packages for a notebook with i7-5500U (Broadwell).

UPDATE

After enabling Steam Client beta option hardware decoding is working like a charm on Intel NUC NUC7CJY (J4005) + Ubuntu 18.04 using libva=1.8.3 :+1:

Thank you very much @toojays and @evilynux :smile:

Ffallenguru 2019-10-28 github

As of now, Steam Client does work with its own provided libva1

Care to elaborate? I have an Intel Core i3-2100T in my HTPC running Ubuntu 18.04 that used to be able to do hardware decoding just fine (though not necessarily on 18.04), it hasn't in ages. (Sadly, its nNvidia GeForce GT 520 won't do hardware encoding any more, either, so I'm down to software.) I've been under the impression that it's just broken until Valve fixes it. Am I missing something?

Bbaryluk 2019-10-28 github

@fallenguru Core i3-2100T is a bit dated, but it should have hardware decoding for H.264 and VC-1. It probably does support 1920x1080, but not more than that for decode. Maybe a little more (2048x2048).

Steam does provide libva itself:

user@debian:~/.local/share/Steam$ find -name 'libva*.so.*'
./ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva.so.1.3900.0
./ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva.so.1
./ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva-x11.so.1.3900.0
./ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva-x11.so.1
./ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva-glx.so.1.3900.0
./ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva-glx.so.1
./ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libva.so.1.3900.0
./ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libva.so.1
./ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libva-x11.so.1.3900.0
./ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libva-x11.so.1
./ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libva-glx.so.1.3900.0
./ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libva-glx.so.1
user@debian:~/.local/share/Steam$ 

And does load it automatically:

$ for p in $(pidof steam); do grep -H libva /proc/$p/maps; done
/proc/68249/maps:eca58000-eca5c000 r-xp 00000000 00:17 2687049                            /home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva-x11.so.1.3900.0
/proc/68249/maps:eca5c000-eca5d000 r--p 00003000 00:17 2687049                            /home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva-x11.so.1.3900.0
/proc/68249/maps:eca5d000-eca5e000 rw-p 00004000 00:17 2687049                            /home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva-x11.so.1.3900.0
/proc/68249/maps:eca77000-eca92000 r-xp 00000000 00:17 2687055                            /home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva.so.1.3900.0
/proc/68249/maps:eca92000-eca93000 r--p 0001a000 00:17 2687055                            /home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva.so.1.3900.0
/proc/68249/maps:eca93000-eca94000 rw-p 0001b000 00:17 2687055                            /home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva.so.1.3900.0
/proc/68130/maps:eca58000-eca5c000 r-xp 00000000 00:17 2687049                            /home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva-x11.so.1.3900.0
/proc/68130/maps:eca5c000-eca5d000 r--p 00003000 00:17 2687049                            /home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva-x11.so.1.3900.0
/proc/68130/maps:eca5d000-eca5e000 rw-p 00004000 00:17 2687049                            /home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva-x11.so.1.3900.0
/proc/68130/maps:eca77000-eca92000 r-xp 00000000 00:17 2687055                            /home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva.so.1.3900.0
/proc/68130/maps:eca92000-eca93000 r--p 0001a000 00:17 2687055                            /home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva.so.1.3900.0
/proc/68130/maps:eca93000-eca94000 rw-p 0001b000 00:17 2687055                            /home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libva.so.1.3900.0
$

However, I don't think steam is using hardware decoding on my machine actually.

I didn't see any hardware specific libraries loaded in /proc/pid/maps, or when looking at gdb and strace. Also when watching small video in steam store the CPU usage is about 15%, which I think means it is not using hardware acceleration to do that.

It looks like steam is including libva and libva1-x11, which are just loaders and presentation engines, but it still tries to load actual acceleration libraries for specific hardware dynamically at runtime (which make sense, it wouldn't make that much sense to include it in steam runtime, as they might become quickly outdated), but fails and fallbacks to software decoding. Running sudo perf top --sort comm,dso shows that majority of CPU usage is in Media thread of steamwebhelper, inside libcef.so library. The libcef is library from chromium for embedding it in other processes. It contains basically entirety of chromium and is massive, 139MB in size (32-bit one). Unfortunately I wasn't able to figure out how to dig deeper into libcef tracing, for some reasons perf doesn't demangle symbols nor doesn't break down usage by stack traces for me It only tells me that majority of CPU usage is in crashpad::CaptureContext function/class.

If I make /etc/libva.conf to have LIBVA_TRACE=/tmp/libva.trace.log and LIBVA_MESSAGING_LEVEL=2, then running vainfo (with libva 2.5.0), does show (on standard error output) and in the trace file, that it is trying (and succeeding) opening radeonsi_drv_video.so on my computer (aka gallium-va from Mesa): libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so

However, when I run steam, there are no output from libva and no trace files generated. I even did various tricks with breaking point on dlopen with gdb, to no availa.

I think this is because libva provided by steam runtime appears to be version 1.7.0 (from 2016-03-13), but the tracing and verbosity was introduced in 1.8.3 (2017-06-28), which is by the way the last 1.x version of libva available.

So, well, libva1 itself loads, but is useless on current distros indeed due to lack of hardware drivers using this old ABI and API. You might be able to run it on some hardware by compiling old libva or finding old .so files and plugging them where needed, but it will be tedious. You might also be able to maybe create a library to use libva2 on top of libva1 , but again that would be a bit tedious.

Ffallenguru 2019-11-07 github

Thank you, @toojays and @baryluk, that was enough info to hack something together. I now have working hardware decoding on Ubuntu 18.04 (using the nVidia card, making this technically OT, but I don't see why it shouldn't work with the Intel driver).

Very short version:

  1. Bootstrap a bionic i386 chroot, install ubuntu-minimal. build-essential, git, and the build-deps for libva and your VA-API driver.
  2. Compile a suitably old libva in there, 1.7.3 works. [Using a prefix under $HOME is fine, i.e. something like NOCONFIGURE=yes ./autogen.sh && configure --prefix=$HOME/local && make && make install.
  3. Stil in the chroot, compile a suitable VA-API driver against that. I used vdpau-va-driver; intel-vaapi-driver compiled just the same, just checkout the version matching libva to be safe (untested). NOCONFIGURE=yes ./autogen.sh && PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig ./configure --prefix=$HOME/local && make && make install. The neat thing is that the generated libraries and tools will automatically use this driver.
  4. Force Steam to use the new toys. By that point I got impatient and just deleted ~/.steam/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu/libva* and dumped symlinks to all the *.so* files in there, as well as ~/.steam/ubuntu12_32/steam-runtime/pinned_libs_32/. Probably overkill, definitely ugly.
  5. ...
  6. Profit! (As in, my system load is down to 0.5 from ~4.)

So, yes, hardware accelerated decoding is definitely still possible in 18.04.

Kkisak-valve maintainer 2019-11-08 github

Hello, per "Updated vaapi decoding to libva2 compatibility" in the 2019-11-07 Steam client beta update, please opt into Steam's beta client if you haven't already and retest this issue.

Sshoober420 2019-11-08 github

I just downloaded the new Steam client beta, and it works great! There is no longer a hard dependency for “libva1” and “lib32-libva1”. Steam only needs VA2 (libva and lib32-va) packages now. Sweeeeet!

This is in terms of Arch Linux, I’m sure other distros have similar packaging and same behavior.

Ssandy-8925 2019-11-08 github

I just downloaded the new Steam client beta, and it works great! There is no longer a hard dependency for “libva1” and “lib32-libva1”. Steam only needs VA2 (libva and lib32-va) packages now. Sweeeeet!

This is in terms of Arch Linux, I’m sure other distros have similar packaging and same behavior.

Hey, I also tried it out on Arch Linux, Intel GPU but it doesn't work for me. Fails to initialize VAAPI.
Here's the relevant error output:

[1108/140519.847151:ERROR:frame_sink_video_capturer_impl.cc(197)] Invalid resolutions constraints: 0x0 must not be greater than 0x0; and also within media::limits.
libva error: /usr/lib32/dri/i965_drv_video.so init failed
Server available at address:
ffmpeg verbose: Opened VA display via X11 display :0.
ffmpeg error: Failed to initialise VAAPI connection: -1 (unknown libva error).
CVAAPIAccel: av_hwdevice_ctx_create() failed

Can you please share the libva* package versions you're using? Looks like lib32-libva and lib32-libva-intel-driver are out of date, so I'm wondering if that's the main reason.

Ssandy-8925 2019-11-08 github

Ok, I got it working on GNOME on X11. Looks like it doesn't work on Wayland for now.

I'd really rather have it working on Wayland desktops, X11 desktops are VERY Insecure.

Also to clarify, I was streaming from another computer, this is about video decoding. So please don't start arguments with me about X11 window capture vs Wayland window capture.

Ffallenguru 2019-11-08 github

"Updated vaapi decoding to libva2 compatibility" in the 2019-11-07 Steam client beta update, please [...] retest this issue.

4 hours!?! Really? I finally get off my arse and hack around a regression that's been bugging me for months and reported for over a year, and 4 hours later you fix it properly? :-P

For the record:

  • hardware decode now WORKING out of the box on Ubuntu 18.04.03 with a nVidia GeForce GT 520.
  • NOT also working out of the box on Ubuntu 19.04 with a nVidia GeForce GT 620M. still gives "unknown libva error" Just take care to install all the necessary libva* and VA-API drivers packages in amd64 and i386
Sshoober420 2019-11-08 github

@sandy-8925 I know X11 has some security issues compared to Wayland, but since XWayland is required for any situation where GLX is involved, how is it Wayland is more secure?

TTurboK234 2019-11-09 github

For me HW decoding didn't start to work when I installed the latest Steam beta version, it still gives the following output when launching remote play.

"ffmpeg error: Failed to initialise VAAPI connection: -1 (unknown libva error).
CVAAPIAccel: av_hwdevice_ctx_create() failed"

I'm on Ubuntu 18.04 with latest updates, my GPU is Intel HD Graphics 505 (Pentium J4205), with the following vainfo

"vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Broxton - 2.1.0"

Ffallenguru 2019-11-09 github

[Sorry for spamming the bug, I can't find a way to pm @TurboK234.]

For me HW decoding didn't start to work [...] Ubuntu 18.04 with latest updates, my GPU is Intel HD Graphics 505 (Pentium J4205), with the following vainfo [...]

vainfo is a red herring, since you probably have the regular (64-bit) package installed and Steam only uses 32-bit libva and drivers. (Temporarily uninstalling vainfo and installing vainfo:i386 might give more useful info.)

What libva & va-driver packages do you have installed? libva2 libva2:i386 libva-drm2 libva-drm2:i386 libva-glx2 libva-glx2:i386 libva-wayland2 libva-wayland2:i386 libva-x11-2 libva-x11-2:i386 va-driver-all va-driver-all:i386 i965-va-driver-shaders i965-va-driver-shaders:i386 -- that's everything but the kitchen sink, but you can prune it back once it works.

TTurboK234 2019-11-09 github

Yes, thank you, -it worked-!!!
Some comments:

  • I'm grateful for the list of all of the packages possibly involved :) , everyone on Ubuntu should check them first, since they are not installed by default.
  • The obvious reason seemed to be that I did not have the libva2:i386 package installed. Don't know how I had missed it. I did install all of the packages recommended above by @fallenguru .
  • After installing the packages and updating to Steam beta, the VAAPI still refused to work, BUT the error was now something about ffmpeg not supporting h264 profile 66. This was fixed when I disabled hardware encoding (with Intel QuickSync) on the server side.

I can (finally) confirm that the new Steam beta does fix the Intel HW decoding problem on Ubuntu 18.04.

Ffallenguru 2019-11-09 github

the VAAPI still refused to work, BUT the error was now something about ffmpeg not supporting h264 profile [...].

It might also be worthwhile to play with the Remote Play client options. IIRC, hardware decoding didn't like the Fast preset here (similar error message), but Beautiful it likes fine, so I'm not complaining. If that doesn't work, maybe QuickSync can be tweaked.

Bbunf 2019-12-12 github

I was able to get hardware decoding running on Ubuntu 18.04, by just manually installing libva2:i386. Also looks like you don't need Steam client beta any more. Thanks.

Bbrokkr 2019-12-16 github

I succesfully got hardware decoding (confirmed by debug overlay) on a Broadwell i3 NUC running Ubuntu 19.10 yesterday after installing the entire list from the above post by @fallenguru. So yay and thanks for fixing!

Incidentally, one of those packages (i965-va-driver-shaders:i386) are not currently in Ubuntu 20.04's repository - either because it part of the purge or just because they haven't added it yet. Going by the Debian package details page it sounds kind of important to the whole thing, no? https://packages.debian.org/sid/i965-va-driver-shaders

Mmirh 2019-12-18 github

https://packages.ubuntu.com/focal/i965-va-driver-shaders
The package is still there in a sense, but in all their wisdom ubuntu probably decided it wasn't one of those "mindblowing" 32 bit libraries worth pursuing.

Kkisak-valve maintainer 2020-01-24 github

Closing as fixed in the 2019-11-14 Steam client update. Distro packaging issues should be reported to their package maintainers.