Hardware Transcoder stopped working? Ubuntu 16.04

Server Version#: 1.15.0.659
Player Version#: 3.83.1

Since two days my server won’t use hardware transcoding and I don’t understand why… I think it has something to do with the updates I ran (apt-get dist-upgrade?). I checked all my settings, (I’m on a hetzner server so I used this guide).

I see some errors but I don’t understand why it suddenly stopped working?

Log server:

Feb 17, 2019 14:45:54.405 [0x7fc020ff9700] DEBUG - Streaming Resource: Reducing playback quality for 1904kbps stream bitrate: video resolution to 720x406, audio channels to 2, quality to 41, disable video DS as 2147483647kbps is > the 1724kbps available, disable audio DS as 2147483647kbps is > the 162kbps available
Feb 17, 2019 14:45:54.405 [0x7fc020ff9700] DEBUG - Codecs: testing h264_nvenc (encoder)
Feb 17, 2019 14:45:54.405 [0x7fc020ff9700] ERROR - [FFMPEG] - Cannot load libcuda.so.1
Feb 17, 2019 14:45:54.406 [0x7fc020ff9700] WARN - avcodec_open2 returned -1313558101 for encoder ‘h264_nvenc’
Feb 17, 2019 14:45:54.406 [0x7fc020ff9700] DEBUG - Codecs: hardware transcoding: testing API vaapi
Feb 17, 2019 14:45:54.406 [0x7fc020ff9700] ERROR - [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Feb 17, 2019 14:45:54.406 [0x7fc020ff9700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Feb 17, 2019 14:45:54.406 [0x7fc020ff9700] DEBUG - Scaled up video bitrate to 10813Kbps based on 1.500000x fudge factor.
Feb 17, 2019 14:45:54.406 [0x7fc020ff9700] DEBUG - Scaled maximum bitrate for resolution reduction to 1524Kbps.
Feb 17, 2019 14:45:54.406 [0x7fc020ff9700] DEBUG - MDE: Selected protocol http; container: mkv
Feb 17, 2019 14:45:54.406 [0x7fc020ff9700] DEBUG - MDE: analyzing media item 104483
Feb 17, 2019 14:45:54.406 [0x7fc020ff9700] DEBUG - MDE: E1 - The Great War and Modern Memory: Direct Play is disabled
Feb 17, 2019 14:45:54.406 [0x7fc020ff9700] DEBUG - MDE: E1 - The Great War and Modern Memory: no direct play video profile exists for http/mkv/h264
Feb 17, 2019 14:45:54.406 [0x7fc020ff9700] DEBUG - MDE: E1 - The Great War and Modern Memory: no direct play video profile exists for http/mkv/h264/eac3
Feb 17, 2019 14:45:54.406 [0x7fc020ff9700] DEBUG - MDE: E1 - The Great War and Modern Memory: selected sidecar subtitle stream cannot be direct played
Feb 17, 2019 14:45:54.406 [0x7fc020ff9700] DEBUG - The Great War and Modern Memory - video.width limitation applies: 1920 > 720
Feb 17, 2019 14:45:54.407 [0x7fc020ff9700] DEBUG - The Great War and Modern Memory - audio.channels limitation applies: 6 > 2
Feb 17, 2019 14:45:54.407 [0x7fc020ff9700] DEBUG - MDE: E1 - The Great War and Modern Memory: Direct Streaming is disabled, so video stream will be transcoded
Feb 17, 2019 14:45:54.407 [0x7fc020ff9700] DEBUG - MDE: E1 - The Great War and Modern Memory: no remuxable profile found, so video stream will be transcoded
Feb 17, 2019 14:45:54.407 [0x7fc020ff9700] DEBUG - Codecs: testing h264_nvenc (encoder)
Feb 17, 2019 14:45:54.407 [0x7fc020ff9700] ERROR - [FFMPEG] - Cannot load libcuda.so.1
Feb 17, 2019 14:45:54.407 [0x7fc020ff9700] WARN - avcodec_open2 returned -1313558101 for encoder ‘h264_nvenc’
Feb 17, 2019 14:45:54.407 [0x7fc020ff9700] DEBUG - MDE: Cannot direct stream video stream due to profile or setting limitations
Feb 17, 2019 14:45:54.407 [0x7fc020ff9700] DEBUG - Codecs: hardware transcoding: testing API vaapi
Feb 17, 2019 14:45:54.407 [0x7fc020ff9700] ERROR - [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Feb 17, 2019 14:45:54.407 [0x7fc020ff9700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error

I will presume, based on your question, you have a CPU which support QSV and not the Xeon CPU listed in that guide. Seeing your full logs (ZIP) would provide that info. Excerpts are rarely sufficient (future reference)

Stop PMS
Remove the package binaries (do not purge)
Reboot
Install the package
Start PMS

Doing so verifies the udev rules needed for QSV to operate are again in their proper place.

I attached the logs.

So apt-get remove plexmediaserver (this is enough without loosing all my metadata etc…?)

Plex Media Server Logs_2019-02-17_14-48-49.zip (1.3 MB)

Yes… apt-get remove plexmediaserver will remove the package only.

apt-get purge plexmediaserver removes the package and purge’s Plex’s data.

Reading your logs now.

Thanks for the logs, Now I can see what’s happening.
The CPU doesn’t support QSV as per

Feb 17, 2019 12:49:11.400 [0x7fc0227fc700] DEBUG - Streaming Resource: Determining preferred transcode encoders through transcode only decision.
Feb 17, 2019 12:49:11.400 [0x7fc0227fc700] DEBUG - Codecs: testing h264_qsv (encoder)
Feb 17, 2019 12:49:11.400 [0x7fc0227fc700] WARN - Failed to find encoder 'h264_qsv'
Feb 17, 2019 12:49:11.400 [0x7fc0227fc700] DEBUG - Codecs: testing h264_vaapi (encoder)
Feb 17, 2019 12:49:11.400 [0x7fc0227fc700] DEBUG - Codecs: hardware transcoding: testing API vaapi
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] ERROR - [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] DEBUG - Codecs: testing h264_nvenc (encoder)
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] ERROR - [FFMPEG] - Cannot load libcuda.so.1
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] WARN - avcodec_open2 returned -1313558101 for encoder 'h264_nvenc'
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] DEBUG - Codecs: hardware transcoding: testing API vaapi
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] ERROR - [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] DEBUG - Scaled up video bitrate to 10813Kbps based on 1.500000x fudge factor.
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] DEBUG - Codecs: testing h264_nvenc (encoder)
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] ERROR - [FFMPEG] - Cannot load libcuda.so.1
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] WARN - avcodec_open2 returned -1313558101 for encoder 'h264_nvenc'
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] DEBUG - Codecs: hardware transcoding: testing API vaapi
Feb 17, 2019 12:49:11.401 [0x7fc0227fc700] ERROR - [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Feb 17, 2019 12:49:11.402 [0x7fc0227fc700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Feb 17, 2019 12:49:11.402 [0x7fc0227fc700] DEBUG - Scaled up video bitrate to 10813Kbps based on 1.500000x fudge factor.
Feb 17, 2019 12:49:11.402 [0x7fc0227fc700] DEBUG - Streaming Resource: Reducing playback quality for 2857kbps stream bitrate: video resolution to 720x406, audio channels to 2, quality to 84, disable video DS as 2147483647kbps is > the 2613kbps available, disable audio DS as 2147483647kbps is > the 232kbps available
Feb 17, 2019 12:49:11.402 [0x7fc0227fc700] DEBUG - Codecs: testing h264_nvenc (encoder)
Feb 17, 2019 12:49:11.402 [0x7fc0227fc700] ERROR - [FFMPEG] - Cannot load libcuda.so.1
Feb 17, 2019 12:49:11.402 [0x7fc0227fc700] WARN - avcodec_open2 returned -1313558101 for encoder 'h264_nvenc'
Feb 17, 2019 12:49:11.402 [0x7fc0227fc700] DEBUG - Codecs: hardware transcoding: testing API vaapi
Feb 17, 2019 12:49:11.402 [0x7fc0227fc700] ERROR - [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Feb 17, 2019 12:49:11.402 [0x7fc0227fc700] DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Feb 17, 2019 12:49:11.402 [0x7fc0227fc700] DEBUG - Scaled up video bitrate to 10813Kbps based on 1.500000x fudge factor.
Feb 17, 2019 12:49:11.402 [0x7fc0227fc700] DEBUG - Scaled maximum bitrate for resolution reduction to 1524Kbps.
Feb 17, 2019 12:49:11.402 [0x7fc0227fc700] DEBUG - MDE: Selected protocol http; container: mkv

Would you please open a SSH session to the machine and see what /dev/dri shows? (ls -la /dev/dri)

The other possible trigger here is an external GPU (reason for libva being installed). This will also cause the detection sweep to run. When nVidia GPU drivers are installed, it will cause PMS to attempt initialization. The initialization probe failures (no error) are normal when running nVidia drivers.

What is the actual hardware configuration ??

52

user@Ubuntu-1604-xenial-64-minimal:~$ ls -la /dev/dri
total 0
drwxr-xr-x 2 root root 80 Feb 17 11:30 .
drwxr-xr-x 19 root root 4000 Feb 17 11:30 …
crw-rw---- 1 root video 226, 0 Feb 17 11:30 card0
crw-rw---- 1 root video 226, 128 Feb 17 11:30 renderD128

I must and do apologize. It does have QSV… I inadvertently searched for “QSV” and not “Quick” … that’s on me.

For next step:

grep plex /etc/group
grep plex /etc/passwd

User plex should be listed in the video group

user@Ubuntu-1604-xenial-64-minimal:~$ grep plex /etc/group
video:x:44:plex
user:x:1000:www-data,plex
plex:x:121:user

user@Ubuntu-1604-xenial-64-minimal:~$ grep plex /etc/passwd
plex:x:114:121::/var/lib/plexmediaserver:/bin/bash
plexpy:x:115:65534::/home/plexpy:/bin/false

Thanks.

That tells me the the udev on your system is ready to upgrade to the next release.

This is because dist-upgrade prepares the system for upgrading to the next release,
Ref: https://help.ubuntu.com/lts/serverguide/installing-upgrading.html.en

At this point, I believe you have two choices.

  1. Restore from a backup of the root
  2. Continue upgrading to 17 or 18 (best path since 17 is no longer supported)

Thank you for the information. I’ll perform an upgrade.

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