Jump to content

issues with Vaapi on ubuntu 16 lts.


tdiguy

Recommended Posts

I am trying to figure out how to get vaapi working on my system. I recently upgrade to: 

ASRock J3455B-ITX Intel Quad-Core Processor J3455 (up to 2.3 GHz) Mini ITX Motherboard/CPU Combo

Which has a Integrated Intel HD Graphics 500 video card / integrated video.

From what i figure there should be vaapi support for this under apollo lake.

 

I was running debian but i read a few places that ubuntu had better support for intel graphics. 

Thus far i have not done much with the system past saying yes to installing non free drivers during the install.

When i enable vaapi in emby i see the following in the transcode log:

[AVHWDeviceContext @ 0x1ade560] No VA display found for device: /dev/dri/renderD128.
[AVHWDeviceContext @ 0x1ade560] No VA display found for device: /dev/dri/renderD128.
  libswresample   2.  9.100 /  2.  9.100
Device creation failed: -22.
  libpostproc    54.  7.100 / 54.  7.100
[mpeg2video @ 0x20d2c40] Invalid frame dimensions 0x0.
Failed to set value '/dev/dri/renderD128' for option 'vaapi_device': Invalid argument
Error parsing global options: Invalid argument

So surely something isnt quite right.

 

Also perhaps of note, when i run lspci i get: 00:02.0 VGA compatible controller: Intel Corporation Device 5a85 (rev 0b)

Which to me would mean i am not using the right driver, i would expect this to list the actual card like with my network adapter which shows as: 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 11)
Edited by tdiguy
Link to comment
Share on other sites

Something i just noticed, which i suspect might be a problem is this: 

vainfo: Driver version: Intel i965 driver for Intel(R) Broxton - 1.7.0

Looking at the hardware chart from: https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units

I think my unit should be apollo lake.

Now the question is how do i correct this? Still sifting through google for this, man there are a lot of similar questions.

Link to comment
Share on other sites

Check and make sure that the vaapi device param is correct for your system

Sorry luke, but how do i do that?

is that the contents of: /dev/dri ?

If so that directory contains: card0  renderD128

 

Sorry i just realized the output of vainfo might be more useful.

error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_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.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Broxton - 1.7.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD

Edited by tdiguy
Link to comment
Share on other sites

I looked through the forums a bit more and found this: https://emby.media/community/index.php?/topic/31174-hardware-encoding-on-ubuntu-server/page-5&do=findComment&comment=369730

I added emby to the video group, rebooted and this is the ffmpeg:

Quality / fps wise i am having trouble telling if its using gpu acceleration. But that could easily be because my connection is not so good at work here.

I searched for CPU in the log and got no hits so i think its working. Correction, i just found: 

    Stream #0:0: Video: h264 (h264_vaapi) (High), vaapi_vld, 1280x720 [SAR 1:1 DAR 16:9], q=0-31, 15000 kb/s, 59.94 fps, 90k tbn, 59.94 tbc

So i am pretty sure the hardware acceleration is now working. I will have to test a bit when i get home and see how its going.

ffmpeg.txt

Edited by tdiguy
Link to comment
Share on other sites

  • 1 year later...
lateparty

For anyone wondering, this fixes it for CentOS 7.6 on Emby Server 3.5.3.

 

To enable Hardware Acceleration from a clean install (+ "yum install intel-gpu-tools" but I question their relevance), I simply had to issue the following command:

sudo usermod -aG video emby

and all of a sudden it works! holy moly.

 

@@Luke - If this is still relevant in 3.6 please consider making this something that happens automatically during the installation process.

 

Additionally: my system is a 2018 Intel NUC 8i5BEH and it does a stellar job of hwaccel through VAAPI.

 

Edit: updated the command to include the "a" flag

Edited by lateparty
Link to comment
Share on other sites

@@Luke - If this is still relevant in 3.6 please consider making this something that happens automatically during the installation process.

 

I'm pretty sure that we're doing this automatically with the 3.6 releases.

 

@@alucryd - Can you confirm?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...