You are not logged in.

#1 2018-05-01 19:34:39

GrimKriegor
Member
Registered: 2018-05-01
Posts: 2

[Solved] VA-API on a systemd-nspawn container for Steam Remote Play

Hello everyone.

For a while now I have had Steam inside an nspawn container and it has been working wonderfully.

However, recently I have wished to stream from a remote, more powerful machine using Steam's In-Home streaming, but have been having trouble getting hardware acceleration for decoding the incoming video stream.

These are the config files I have been successfully using for this container.

/etc/systemd/nspawn/arch.nspawn

[Exec]
Boot=1

[Files]
Bind=/tmp/.X11-unix
Bind=/dev/dri
Bind=/dev/shm
Bind=/dev/input
Bind=/run/user/1000/pulse:/run/user/host/pulse
Bind=/dev/snd

Bind=/media/Storage/Games

/etc/systemd/system/systemd-nspawn@arch.service.d/override.conf

[Service]
DeviceAllow=/dev/dri rw
DeviceAllow=/dev/shm rw
DeviceAllow=char-usb_device rwm
DeviceAllow=char-input rwm
DeviceAllow=char-alsa rwm
ExecStart=
ExecStart=/usr/bin/systemd-nspawn -D /media/Storage/Systems/Containers/%I --quiet --keep-unit --boot --link-journal=try-guest --machine=%I

The container runs on an I5-6600 machine and the hardware decoding is expected to work on its onboard Intel GPU with VA-API. Both host and guest are up to date Arch.

Software running on the container can access the host's Xorg server after I run

xhost +local

Although 3D applications run flawlessly, I get the following vainfo output on the guest:

libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns -1
libva info: User requested driver 'i965'
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva error: /usr/lib/dri/i965_drv_video.so init failed
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

As compared with the host:

libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Sandybridge Mobile - 2.1.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSlice
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointEncSlice
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointEncSlice
      VAProfileH264StereoHigh         :    VAEntrypointVLD
      VAProfileVC1Simple              :    VAEntrypointVLD
      VAProfileVC1Main                :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD
      VAProfileNone                   :    VAEntrypointVideoProc

Steam In-Home streaming also outputs something similar and falls back to software decoding.

I assume this might be a permissions problem, maybe I ought to give the container access to something else.

Posting here in hopes someone has come into contact with a similar issue.

Thank you for your time.

Last edited by GrimKriegor (2019-10-27 18:47:55)

Offline

#2 2018-09-12 15:58:08

skyfoosooc
Member
Registered: 2016-08-06
Posts: 3

Re: [Solved] VA-API on a systemd-nspawn container for Steam Remote Play

Did you ever find a solution to this problem?

I have been having a similar issue[1] with AMD and Intel graphics. I am also trying to get vulkan working and am hoping it's related to the VA-API trouble.

[1]: https://bbs.archlinux.org/viewtopic.php?id=239926

Offline

#3 2019-10-27 18:46:36

GrimKriegor
Member
Registered: 2018-05-01
Posts: 2

Re: [Solved] VA-API on a systemd-nspawn container for Steam Remote Play

@skyfoosooc sincerest apologies for the late response.

Happy to see you found a solution.

Yesterday I finally got around to trying a few more things and I am pleased to say, security issues aside, hardware video decoding now works as expected.

It was simply a matter of adding the following to /etc/systemd/system/systemd-nspawn@arch.service.d/override.conf

DeviceAllow=char-drm rwm

Which made vainfo output the same as the host, and then installing these packages on the guest:

libva1 lib32-libva1 libva1-intel-driver lib32-libva1-intel-driver

Which allowed Steam to access vaapi.

Hope someone finds this useful.

PS: In the meanwhile I have prepared a simple script to ease the bootstrapping and handling of setups like these.

Offline

Board footer

Powered by FluxBB