Trying out hardware support on Debian 9 and I can only get the encode side to work with the GTX 770. I get these errors repeated a few times for the encode in the log:
DEBUG - Codecs: hardware transcoding: testing API vaapi
ERROR - [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
DEBUG - Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Input/output error
Then:
DEBUG - TPU: hardware transcoding: enabled, but no hardware decode accelerator found
DEBUG - TPU: hardware transcoding: zero-copy support not present
DEBUG - TPU: hardware transcoding: final decoder: , final encoder: nvenc
So I wind up with Transcode h264 to h264 (hw) in the Now Playing status window.
I have the latest stable nvidia-driver packages installed, and the output from nvidia-smi is:
But you guys enabled nvenc in the latest 9.3 release? It works for me. On my GeForce GTX 650 Ti. I get this in the transcoder log, and it’s noticeably faster, and my GPU heats up :P.
I’ve read that link several times but it does not give the granularity I asked about. It lists NVIDIA as supported under Linux but does not say encode (but no decode). What might I need to install to support decode, if supported? I’m happy with it being “YMMV” and encode only right now, but just curious and I’m sure others have the same question.
NVidia and AMD are freebee sweep ups for those who have taken the time to install it on their systems but it’s not guaranteed. The holdup for video on Linux has always been Intels libvaapi library. After 2.0.0 is formally released (it’s 2.0.0 pre-release now), we will know more .
This, plus the status of the i915 driver is what gates HAS (Hardware Accelerated Streaming) for us.
For what it’s worth, I CAN confirm the encode working (the majority of the CPU intensity in a transcode operation)… however, yes I’m getting the same error as you in the Plex Media Server log for what I assume is the decode operation.
I think the issue is that Plex is (attempting) to use VAAPI to decode the video. VAAPI is not supported by NVIDIA cards. VDPAU must be used. As long as it is trying to use VAAPI it will fail.
@zabby39103 said:
I think the issue is that Plex is (attempting) to use VAAPI to decode the video. VAAPI is not supported by NVIDIA cards. VDPAU must be used. As long as it is trying to use VAAPI it will fail.
Did you try the package vdpau-va-driver and the included va api to vdpau wrapper?
@uglymagoo Hey thanks. I checked that out. I have the latest installed version of vdpau-va-driver, set LIBVA_DRIVER_NAME=vdpau in /etc/environment, and ran vainfo successfully (so it should work…).
However, “Failed to initialise VAAPI connection” still occurs. Perhaps Plex is using it’s own driver instead of the system provided one… I’m not sure.
(I know that any functionality would not be officially supported but it was fun to try)
Plex tries, vaapi, nvenc, etc. to see if they’re supported. Then it uses whatever works (not sure about what priority but my guess is vaapi/qsv would be the first pick since it is officially supported). If all fail, it uses sw
The problem with nvidia decoding is that plex built their ffmpeg with support for the nvenc encoder, but not the cuvid decoder. That’s why it does hw encode, but sw decode
EDIT: what I wrote above applies to Linux. On windows, plex uses dxva to hw decode on nvidia, so it doesn’t need to use cuvid. But dxva is windows only.
@aptalca thanks for the interesting details… if it is something as simple as the build options on Plex’s ffmpeg, hopefully it can be fixed in a future release!
Not that it’s probably needed, but +1 to $any_cpu+NVIDIA card.
Oct 20, 2017 10:42:29.897 [0x7f4e08bfe700] ERROR - [FFMPEG] - No VA display found for device: .
Oct 20, 2017 10:42:29.898 [0x7f4e08bfe700] ERROR - [FFMPEG] - No VA display found for device: /dev/dri/renderD128.
Oct 20, 2017 10:42:29.933 [0x7f4e08bfe700] ERROR - [FFMPEG] - Cannot init CUDA
Oct 20, 2017 10:42:29.934 [0x7f4e08bfe700] WARN - avcodec_open2 returned -1313558101 for encoder 'h264_nvenc'
I just checked out this thread. It seems like libva 2.0 is released. Hopefully we can see the implementation soon.
I read that Nvidia GPU does not support decoding. Is it still the case after libva 2.0? I don’t have Intel QSV because I am running a server CPU. Am I still able to use hardware acceleration?