Hardware Transcoding not working on ubuntu server 18.04

Server Version#: 1.19.3.2793
Player Version#: Web Version 4.33.1
Plex Media Server.log (687.7 KB)
Plex Media Server Logs_2020-05-14_15-50-28.zip (844.1 KB)

I’m running a fresh Ubuntu 18.04 server on an OVH dedicated server with an i7-7700k and from what I understand this processor supports quick sync.

In my (attached) logs, I see the following:

May 14, 2020 15:43:44.912 [0x7f37d97fa700] DEBUG - TPU: hardware transcoding: enabled, but no hardware decode accelerator found

An ls -la /dev/dri shows the following:

drwxr-xr-x  3 root root       120 May 14 15:40 .
drwxr-xr-x 19 root root      4280 May 14 15:40 ..
drwxr-xr-x  2 root root       100 May 14 15:40 by-path
crw-rw----  1 root video 226,   0 May 14 15:40 card0
crw-rw----  1 root video 226,   1 May 14 15:40 card1
crw-rw----  1 root video 226, 128 May 14 15:40 renderD128

groups plex shows:

plex : plex video

uname -a

Linux ns530642 4.15.0-99-generic #100-Ubuntu SMP Wed Apr 22 20:32:56 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

vainfo:

error: can't connect to X server!
libva info: VA-API version 1.1.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_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) Kaby Lake - 2.1.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointEncSliceLP
      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
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointEncSlice
      VAProfileVP9Profile2            :	VAEntrypointVLD

Anyone able to offer any insight on what I can do to enable hardware transcoding?

You are gonna need @ChuckPa to reply.
Do you have a dummy plug, when I run vainfo… I don’t get the x server error. I have a dummy plug in the HDMI port of my headless server.

vainfo
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
.
.
.

edit: pretty sure a dummy plug is necessary:

This is a rented remote server and I unfortunately don’t have physical access to it

:eyes:

What do you see when accessing /dev/dri

Also, is this a native host installation or in a VM / container?

Well, I think hardware transcoding is actually working. I kept using the same test file which was an older 4k file and for whatever reason the HW transcoder does not work for that, but works for all my other 1080p and other 4k movies. Odd.

But to answer your question, in /dev/dri I see:

drwxr-xr-x  3 root root       120 May 14 15:40 .
drwxr-xr-x 19 root root      4280 May 14 15:40 ..
drwxr-xr-x  2 root root       100 May 14 15:40 by-path
crw-rw----  1 root video 226,   0 May 14 15:40 card0
crw-rw----  1 root video 226,   1 May 14 15:40 card1
crw-rw----  1 root video 226, 128 May 14 15:40 renderD128

seeing two card entries and only one render tells me that one of them is not recognized by the kernel / libva.

Experimentation will be required.

I would venture to guess that your dri render renderD128 is associated to card1 and not card0 and it look like Plex is only looking for /dev/dri/card0 with /dev/dri/renderD128.

You can confirm it via lsgpu(pci domain.bus.slot.func will be different):

sys:/sys/devices/pci0000:00/0000:00:04.0
    subsystem       : pci
    drm card        : /dev/dri/card1
    drm render      : /dev/dri/renderD128

or via ls -lah /dev/dri/by-path/

pci-0000:00:04.0-card -> ../card1
pci-0000:00:04.0-render -> ../renderD128
pci-0000:02:00.0-card -> ../card0

I’m currently facing the same issue with a system with a BMC with an integrated graphic card.

I couldn’t find a way to specify the dri card and render path to use in Plex. Nor there is any mention of dri configuration in the Advanced, Hidden Server Settings document.

As a workaround you can setup a docker instance that will remap card1 to card0 and pass through renderD128 via the devices option.

There’s a feature suggestions to enable custom dri path, but it date from 2018:
https://forums.plex.tv/t/requesting-option-to-select-dri-hardware-decoding-device/231808

To specify the device, add the following to Preferences.xml

HardwareDevicePath="/dev/dri/device"

Remember to add user plex to the group of that device if not already a member.

1 Like

check you dev dir

example

ls /dev/nvidia*
you need to see folder like
/dev/nvidia0
/dev/nvidia-modeset
/dev/nvidia-uvm
/dev/nvidia-uvm toolkit

if you are missing nvidia-uvm or toolkit run this command
nvidia-modprobe -c0 -u
nvidia-smi then try again

1 Like

Thank you for this!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.