1080p (HEVC Main) not hardware transcoding

Server Version#: 1.30.1.6562 Ubuntu Server 22.04
GPU: Quadro P400
CPU: Ryzen 5 2600

Hi,
So since the last update (I think) my plex server dosnt seem to be using my gpu correctly anymore. When playing a media in 1080p (HEVC Main) I get a lot of error in the logs.

Jan 12, 2023 14:47:29.085 [0x7f866407eb38] Error — [Req#1b322/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).

Jan 12, 2023 14:47:29.335 [0x7f866407eb38] Error — [Req#1b322/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).

Jan 12, 2023 14:47:29.950 [0x7f866407eb38] Error — [Req#1b779/Transcode/tcanlso9gyoaadq630u8gd17/b333b6b8-0ecf-46d9-8633-e5564ee19d1c] [hevc @ 0x7fe62d443c80] No decoder surfaces left
Jan 12, 2023 14:47:29.950 [0x7f8669e23b38] Error — [Req#1b77c/Transcode/tcanlso9gyoaadq630u8gd17/b333b6b8-0ecf-46d9-8633-e5564ee19d1c] [hevc @ 0x7fe62d443c80] decoder->cvdl->cuvidDecodePicture(decoder->decoder, &ctx->pic_params) failed -> CUDA_ERROR_INVALID_VALUE: invalid argument
Jan 12, 2023 14:47:29.951 [0x7f8664281b38] Error — [Req#1b77f/Transcode/tcanlso9gyoaadq630u8gd17/b333b6b8-0ecf-46d9-8633-e5564ee19d1c] [hevc @ 0x7fe62d443c80] hardware accelerator failed to decode picture
Jan 12, 2023 14:47:29.951 [0x7f866407eb38] Error — [Req#1b782/Transcode/tcanlso9gyoaadq630u8gd17/b333b6b8-0ecf-46d9-8633-e5564ee19d1c] Error while decoding stream #0:0: Generic error in an external library
Jan 12, 2023 14:47:29.951 [0x7f8669e23b38] Error — [Req#1b784/Transcode/tcanlso9gyoaadq630u8gd17/b333b6b8-0ecf-46d9-8633-e5564ee19d1c] [hevc @ 0x7fe62d443c80] Could not find ref with POC 8
Jan 12, 2023 14:47:29.951 [0x7f8664281b38] Error — [Req#1b787/Transcode/tcanlso9gyoaadq630u8gd17/b333b6b8-0ecf-46d9-8633-e5564ee19d1c] [hevc @ 0x7fe62d443c80] No decoder surfaces left
Jan 12, 2023 14:47:29.952 [0x7f866407eb38] Error — [Req#1b789/Transcode/tcanlso9gyoaadq630u8gd17/b333b6b8-0ecf-46d9-8633-e5564ee19d1c] [hevc @ 0x7fe62d443c80] decoder->cvdl->cuvidDecodePicture(decoder->decoder, &ctx-

Now this does not happen with 1080p (H.264) or 1080p (HEVC Main 10). In the dashboard it usually says that its using (hw) but when playing a henvc main media it dosnt.

When trying to play the media nvidia-smi does show a process running but the error logs will repeat endlessly. My drivers are on the latest version.

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.78.01    Driver Version: 525.78.01    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 P400         Off  | 00000000:2C:00.0 Off |                  N/A |
| 34%   43C    P0    N/A /  30W |    157MiB /  2048MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A     49210      C   ...diaserver/Plex Transcoder      155MiB |
+-----------------------------------------------------------------------------+

The files wont play on any of my devices. I have tried chrome, firefox, android and roku and its the same situation on all of them.

Any idea would be greatly appreciated.
Thanks in advance

May I have the full DEBUG logs zip file please (as downloaded from PMS) which captures this?

It’s not possible to diagnose from a few snippet lines.

Your right lol my bad, here you go.
Plex Media Server Logs_2023-01-12_19-07-58.zip (3.0 MB)

@Jeremyy444

Is there any way I can get a cut of that file ? (Just enough to test / recreate here)

I have a P2200 with CUDA 11.7

I need to confirm if CUDA or PMS.

Sure, here’s a shared link from file.io. I didn’t trim it since I don’t want to have to render it, but it’s only a 1.7gb movie.
https://file.io/tKucvJN2y0zc

I have the file. I replicated the failure with PMS. This is a strange error

@Jeremyy444

I ran the file through FFMPEG to remux it (get the timing all lined up)

It plays just fine.

Before remux, it wouldn’t do anything.

This is a junked up file.

Even down to .7 mbps, image holds (after remux)

Players like VLC, Celluloid, etc are very forgiving. FFMPEG is not.

Hi,

I have the exact same issue as the OP, could you give me some more details on the command you ran for the remux? I have multiple files over multiple shows that are affected by this and I thought it was affecting every HEVC 8 bit video but it’s interesting that a simple remux is enough to get it working.

Idk if its the file, I have multiple movies and shows with the same problem. At first I tought that it might of been the fact that some of the file had been trancoded through tdarr but some newly downloaded files have the same problem. But even some series that worked before and that havnt gone through tdarr have the same problem. For exemple Lucifer which has 5 season in h264 and 1 in HEVC and thats the only one showing that problem. The season in hevc dosnt show in tdarr and it was last modified on the same date as the other seasons, so when I added them to my server. The file I sent sure dosnt seem to work but I just tried playing Lucifer S0301 in vlc and it works but not in PMS with the same problem.

Might be a stretch, but do you also use tdarr?

Okay, maybe it has something to do with tdarr. So tdarr did transcode some of the files that dosnt work. Problem is they are playable outside of pms. Now I have used tdarr to transcode a HEVC to H264 and it works so the files I testes are not junk. The thing is, I was able to play those file before. Now im not anymore so something clearly changed either from the update or something else.

I do but I don’t use it to transcode anything, mainly remux and remove unwanted audio and subtitle languages.

There is a reddit thread ( https://www.reddit.com/r/PleX/comments/109xs8o/hevc_h264_1080p_hw_transcoding_errors/ ) where a few people claim to have solved this issue by doing a rollback of the server.

Oh nice im going to try that now thanks! I’ll update when its done

Alright, verdict being downgrading to 1.30.0.6486-629d58034 fixed the problem for me.

Here is a git repo of older version if needed: GitHub - axlecrusher/plex_download_urls: Archive of Plex mediaserver download URLs

FFMPEG remux command:

ffmpeg -i filename.ext
-c:v copy -c:a copy -c:s copy output_filename.ext

@Jeremyy444

Downgrade to 1.30.0 resolved it?

It did yes. I am now able to play the files I wasnt able to before like lucifer season 3.

This is nuts.

1.30.0 has broken TrueHD audio → Fixed in 1.30.1

Now, 1.30.1 has broken video → :crazy_face:

Hahahahaha nice! No worries lol. Do you need a file that works in 1.30 and not in 1.30.1 to test?

Yes please. As small a ‘dd’ sample as possible (don’t forget to remux it after ‘dd’)
usually 100 MB is more than enough.