Plex No Longer using Nvidia HW transcoding

Server Version#: 1.30.1.6562 - Ubuntu 22.04.1
Player Version#: 4.98.2 (Web)

I recently noticed plex is no longer doing hardware transcoding (nvidia decoding and encoding). I assume this was due to a recent package upgrade since nvidia-smi was not loading. I have since reinstalled nvidia drivers and updated ubuntu from 20.04 to 22.04.

nvidia-smi now loads and even shows plex transcoding process but is very low utilization (54MB)

±----------------------------------------------------------------------------+
| NVIDIA-SMI 525.60.11 Driver Version: 525.60.11 CUDA Version: 12.0 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Quadro P2000 Off | 00000000:0B:00.0 Off | N/A |
| 54% 50C P0 17W / 75W | 58MiB / 5120MiB | 0% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 2093 C …diaserver/Plex Transcoder 54MiB |
±----------------------------------------------------------------------------+

htop shows plexmedia transcoder h264 using 100% cpu as well as the dashboard confirming no hw acceleration:
image

I’ve set the appropriate HardwareDevicePath=“/dev/dri/renderD129” in Preferences.xml and the Plex debug logs show the following:

[Req#317f8/Transcode] TPU: hardware transcoding: final decoder: nvdec, final encoder: nvenc
TPU: hardware transcoding: enabled, but no hardware decode accelerator found
TPU: hardware transcoding: final decoder: , final encoder:

Any help would be appreciated.

Change your Nvidia driver.

We known 515.86.01 works with PMS inclusive of AV1 HW decode
and there are issues with the new CUDA V 12.0 SDK that we’re working on now.

Be certain to change all modules as well as update initramfs and reboot the host (to flush the old libs from ram)

If it doesn’t engage after this, Download the DEBUG logs from PMS and attach the ZIP file here.

I downgraded to 515.86.01 (removed nvidia driver, rebooted, installed nvidia-driver-515). Part of the install process was to update initramfs. Once installed I again rebooted the host however still having the same issue.

Wed Jan 18 11:42:14 2023
±----------------------------------------------------------------------------+
| NVIDIA-SMI 515.86.01 Driver Version: 515.86.01 CUDA Version: 11.7 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Quadro P2000 Off | 00000000:0B:00.0 Off | N/A |
| 55% 52C P8 4W / 75W | 57MiB / 5120MiB | 0% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1499 C …diaserver/Plex Transcoder 53MiB |
±----------------------------------------------------------------------------+

Attached is the log file.
Plex Media Server Logs_2023-01-18_11-42-53.zip (2.9 MB)

Would you mind trying this video in an OtherVideos section?

Download the Logs ZIP again please when done

Looks to be working on this video. Attached are the zip logs.
Plex Media Server Logs_2023-01-18_15-28-22.zip (3.0 MB)

— Was totally messed up – REMOVED

This video is HEVC HDR.

AV1 sample below.

I think this one is working too.

Plex Media Server Logs_2023-01-18_16-47-23.zip (3.3 MB)

Yep. it’s working indeed.

an 18, 2023 16:46:44.681 [0x7f8cb5777b38] DEBUG - [Req#39f4f/Transcode] Starting a transcode session sbcpctggek13bz4dnrgpioj6 at offset -1.0 (state=3)
Jan 18, 2023 16:46:44.681 [0x7f8cb5777b38] DEBUG - [Req#39f4f/Transcode] TPU: hardware transcoding: using hardware decode accelerator nvdec
Jan 18, 2023 16:46:44.681 [0x7f8cb5777b38] DEBUG - [Req#39f4f/Transcode] TPU: hardware transcoding: zero-copy support present
Jan 18, 2023 16:46:44.681 [0x7f8cb5777b38] DEBUG - [Req#39f4f/Transcode] TPU: hardware transcoding: using zero-copy transcoding
Jan 18, 2023 16:46:44.681 [0x7f8cb5777b38] DEBUG - [Req#39f4f/Transcode] [Universal] Using local file path instead of URL: /media/UJ_Storage_Pool/Media/OtherVideos/The World in HDR.mp4
Jan 18, 2023 16:46:44.681 [0x7f8cb5777b38] DEBUG - [Req#39f4f/Transcode] TPU: hardware transcoding: final decoder: nvdec, final encoder: nvenc
Jan 18, 2023 16:46:44.682 [0x7f8cb5777b38] DEBUG - [Req#39f4f/Transcode/JobRunner] Job running: CUDA_CACHE_PATH="/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Shaders/CUDA" FFMPEG_EXTERNAL_LIBS='/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Codecs/acf6c67-4446-linux-x86_64/' X_PLEX_TOKEN=xxxxxxxxxxxxxxxxxxxx46bf-969b-25c27a65d4eb "/usr/lib/plexmediaserver/Plex Transcoder" "-codec:#0x01" vp9 "-hwaccel:#0x01" nvdec "-hwaccel_fallback_threshold:#0x01" 10 "-threads:#0x01" 1 "-hwaccel_output_format:#0x01" cuda "-hwaccel_device:#0x01" cuda "-codec:#0x02" vorbis -analyzeduration 20000000 -probesize 20000000 -i "/media/UJ_Storage_Pool/Media/OtherVideos/The World in HDR.mp4" -filter_complex "[0:#0x01]hwupload[0];[0]scale_cuda=w=2276:h=1280:format=p010[1];[1]tonemap_cuda=mobius:nv12[2]" -map "[2]" -metadata:s:0 language=eng -codec:0 h264_nvenc -b:0 7017k -maxrate:0 9357k -bufsize:0 18714k -forced-idr:0 1 -r:0 59.939999999999998 -force_key_frames:0 "expr:gte(t,n_forced*1)" -filter_complex "[0:#0x02] aresample=async=1:ochl='stereo':rematrix_maxval=0.000000dB:osr=44100[3]" -map "[3]" -metadata:s:1 language=eng -codec:1 aac -b:1 101k -f dash -seg_duration 1 -dash_segment_type mp4 -init_seg_name 'init-stream$RepresentationID$.m4s' -media_seg_name 'chunk-stream$RepresentationID$-$Number%05d$.m4s' -window_size 5 -delete_removed false -skip_to_segment 1 -time_delta 0.0625 -manifest_name "http://127.0.0.1:32400/video/:/transcode/session/sbcpctggek13bz4dnrgpioj6/956651ea-df21-4274-af09-4bee9197590f/manifest?X-Plex-Http-Pipeline=infinite" -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 dash -start_at_zero -copyts -vsync cfr -init_hw_device cuda=cuda: -filter_hw_device cuda -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://127.0.0.1:32400/video/:/transcode/session/sbcpctggek13bz4dnrgpioj6/956651ea-df21-4274-af09-4bee9197590f/progress
Jan 18, 2023 16:46:44.682 [0x7f8cb5777b38] DEBUG - [Req#39f4f/Transcode/JobRunner] In directory: "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-sbcpctggek13bz4dnrgpioj6-956651ea-df21-4274-af09-4bee9197590f"
Jan 18, 2023 16:46:44.682 [0x7f8cb5777b38] DEBUG - [Req#39f4f/Transcode/JobRunner] Jobs: Starting child process with pid 3774

You have HEVC HDR and AV1 fully operational now. Those are the two hardest to decode.

H.264 is working because it’s encoding to H.264 output.

I see success here. do you agree?

I agree with the 2 video files you provided however none of my content I have in the library is HEVC or AV1; they’re all H264 with mkv container (instead of mp4). None of those videos in my library are using hw transcoding, they used to.

I’ve tested so far with 5 different files.

@jusama14

YEP… Egg on my face. :man_facepalming:

They were labeled AV1 and weren’t. They are AVC. Total fubar.

I did grab AV1

[chuck@lizum Downloads.2024]$ mediainfo spbtv_sample_bipbop_av1_960x540_25fps.mp4 
General
Complete name                            : spbtv_sample_bipbop_av1_960x540_25fps.mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (avc1/isom/mp42/avc1)
File size                                : 240 KiB
Duration                                 : 15 s 40 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 131 kb/s
Encoded date                             : UTC 2018-10-05 14:40:45
Tagged date                              : UTC 2018-10-05 14:40:45

Video
ID                                       : 2
Format                                   : AV1
Format/Info                              : AOMedia Video 1
Format profile                           : Main@L3.0
Codec ID                                 : av01
Duration                                 : 15 s 0 ms
Bit rate                                 : 117 kb/s
Width                                    : 960 pixels
Height                                   : 540 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 0.009
Stream size                              : 214 KiB (89%)
Title                                    : vid
Color range                              : Limited
Codec configuration box                  : av1C

Audio
ID                                       : 1
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 15 s 40 ms
Bit rate mode                            : Variable
Bit rate                                 : 8 887 b/s
Nominal bit rate                         : 96.0 kb/s
Maximum bit rate                         : 192 kb/s
Channel(s)                               : 1 channel
Channel layout                           : C
Sampling rate                            : 32.0 kHz
Frame rate                               : 31.250 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 16.3 KiB (7%)
Title                                    : snd

ALL:

Engineering has asked me to confirm:

PMS 1.29.x is compatible with the 525.60.11 (current) Nvidia drivers ??

Can any speak to the contrary or is this indeed a global API 12.0 problem ?

To all following here:

  1. We have identified the issue with Nvidia 525+ drivers and now have a candidate change to PMS.

  2. We identified the issue with certain 1080p input files failing to HW transcode.

I have both DEB and RPM files (Engineering development – No QA) for testing.

There will be another update before we complete this work

I would appreciate feedback at your earliest convenience.

Thanks.

Thank you for the update. I will try this release and report back.

ALL:

We have another build which allows setting the size of ExtraFrames array needed in SDK 12.0.

Please let me know if 6617 works or you need to experiment with setting the value

To add to this discussion, I am currently experiencing the issue with all of my 1080p video files (VC1, H.264, MPEG2, but did not test HEVC 1080p) refusing to hardware transcode.

On Windows Server 2022 with an RTX A2000 and 515 U6 driver, hardware transcoding only works up to the 720p 4mbps preset; anything transcoded to the 4K 25-40mbps range hardware transcodes as well. If any 1080p preset is selected, the video will software transcode, with Plex logging that it cannot find a hardware accelerator for that video stream.

The kicker here is that this happens on all Plex Media Server releases after 1.30.0.6486-629d58034. Upgrading to 1.30.1.6562-915986d62 or later causes this issue to occur on the 525 branch OR 515 branch (specifically the 515 U6 517.88 release).

Thanks for looking into this, as it could potentially cause some serious issues for servers that rely on hardware transcoding.

Windows is not applicable here.

Hardware transcoding is done completely differently.
IIRC, DirectX is the gatekeeper of how it all works which is a Windows-only feature.

The latest update ( 1.31.2.6810) appears to have solved the hw transcoding issue for me.

Thank you

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