Ubuntu 18.04 issue with hardware transcoding

Server Version# Ubuntu 18.04.3 LTS
Player Version#: Version 1.15.3.835
CPU : AMD® Ryzen 5 3600x 6-core processor × 12
GPU: GeForce GTX 1070/PCIe/SSE2

I’m getting an issue trying to use hardware transcoding in my desktop pc. I was able to get it working on the Windows 10 side and wanted to change over to Linux. I’m thinking its an issue with the vainfo since its getting an error when doing a search. Can someone tell me how I can resolve this issue?

vainfo:
error: XDG_RUNTIME_DIR not set in the environment.
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/nvidia_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

Nvida-smi output:

-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26 Driver Version: 430.26 CUDA Version: 10.2 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1070 Off | 00000000:08:00.0 On | N/A |
| 0% 36C P8 7W / 151W | 215MiB / 8111MiB | 0% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1164 G /usr/lib/xorg/Xorg 121MiB |
| 0 1536 G /usr/bin/gnome-shell 84MiB |
| 0 4464 G /usr/lib/firefox/firefox 3MiB |
| 0 4680 G gnome-control-center 3MiB |
±----------------------------------------------------------------------------+

ls -la /dev/dri
total 0
drwxr-xr-x 3 root root 100 Sep 29 15:13 .
drwxr-xr-x 20 root root 4520 Sep 29 15:13 …
drwxr-xr-x 2 root root 80 Sep 29 15:13 by-path
crw-rw----+ 1 root video 226, 0 Sep 29 15:13 card0
crw-rw----+ 1 root video 226, 128 Sep 29 15:13 renderD128

groups plex
plex : plex sudo video

what do your PMS logs show?

I suspect your nVidia driver version is too low. I believe the lowest is 430.38 as of PMS 1.17.0

Current nVidia is 431.36

Logs attached, let me know if you need anything else to look this over. I’ll change out the driver and see if that works.

Plex Media Server Logs_2019-09-29_17-21-19.zip (500.4 KB)

I was able to upgrade to 430.50 and still can’t hw transcode.

Which board is this? Judging by the logs, the nVidia drivers are not liking what they see.

DId you install the graphics driver or the computational drivers?

Sep 29, 2019 17:14:42.472 [0x7efbeeffd700] DEBUG - Completed: [127.0.0.1:51032] 200 GET /playQueues/12?repeat=0&own=1&includeChapters=1&includeGeolocation=1&includeExternalMedia=1 (6 live) GZIP 7ms 1264 bytes (pipelined: 8)
Sep 29, 2019 17:14:42.499 [0x7efbd57fa700] DEBUG - Codecs: hardware transcoding: testing API vaapi
Sep 29, 2019 17:14:42.500 [0x7efbd57fa700] ERROR - [FFMPEG] - libva: va_getDriverName() failed with unknown libva error,driver_name=(null)
Sep 29, 2019 17:14:42.500 [0x7efbd57fa700] ERROR - [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Sep 29, 2019 17:14:42.500 [0x7efbd57fa700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Sep 29, 2019 17:14:42.500 [0x7efbd57fa700] DEBUG - Codecs: testing h264_nvenc (encoder)
Sep 29, 2019 17:14:42.500 [0x7efbd57fa700] DEBUG - Codecs: hardware transcoding: testing API nvenc
Sep 29, 2019 17:14:42.501 [0x7efbd57fa700] ERROR - [FFMPEG] - Cannot load libcuda.so.1
Sep 29, 2019 17:14:42.501 [0x7efbd57fa700] ERROR - [FFMPEG] - Could not dynamically load CUDA
Sep 29, 2019 17:14:42.501 [0x7efbd57fa700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Unknown error occurred
Sep 29, 2019 17:14:42.518 [0x7efbd57fa700] DEBUG - Codecs: hardware transcoding: testing API vaapi
Sep 29, 2019 17:14:42.518 [0x7efbd57fa700] ERROR - [FFMPEG] - libva: va_getDriverName() failed with unknown libva error,driver_name=(null)
Sep 29, 2019 17:14:42.518 [0x7efbd57fa700] ERROR - [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Sep 29, 2019 17:14:42.518 [0x7efbd57fa700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Sep 29, 2019 17:14:42.518 [0x7efbd57fa700] DEBUG - Codecs: hardware transcoding: testing API nvdec
Sep 29, 2019 17:14:42.518 [0x7efbd57fa700] ERROR - [FFMPEG] - Cannot load libcuda.so.1
Sep 29, 2019 17:14:42.518 [0x7efbd57fa700] ERROR - [FFMPEG] - Could not dynamically load CUDA
Sep 29, 2019 17:14:42.518 [0x7efbd57fa700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Unknown error occurred
Sep 29, 2019 17:14:42.518 [0x7efbd57fa700] DEBUG - Scaled up video bitrate to 68364Kbps based on 4.500000x fudge factor.

It hones in on

Sep 29, 2019 17:14:42.519 [0x7efbd57fa700] ERROR - [FFMPEG] - Cannot load libcuda.so.1
Sep 29, 2019 17:14:42.519 [0x7efbd57fa700] ERROR - [FFMPEG] - Could not dynamically load CUDA
Sep 29, 2019 17:14:42.519 [0x7efbd57fa700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Unknown error occurred
Sep 29, 2019 17:14:42.519 [0x7efbd57fa700] DEBUG - MDE: Cannot direct stream video stream due to profile or setting limitations
Sep 29, 2019 17:14:42.519 [0x7efbd57fa700] DEBUG - Codecs: hardware transcoding: testing API vaapi

Can you find that and make certain it’s in the LD_LIBRARY_PATH where PMS can find it -OR- in /lib or /lib64 ?

So I was able to fix the issue. I had installed Plex through Ubuntu Software center and removed it. Manually installed it through CLI and hardware transcoding works now. thanks for your support in trying to figure out the issue.

1 Like

THANK YOU

I hadn’t taken SNAP packaging into consideration when seeing this but it makes complete sense.

it’s a container just like Docker and needs manual manipulation to gain access to any hardware.

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