Cannot hardware transcode with my 1660S on Ubuntu 22.04. Error makes it quit

Server Version#: 1.29.2.6364
Player Version#: latestm but doesn’t matter
OS: Ubuntu 22.04 latest

I’ve recently installed my Nvidia 1660 Super video card, I have nvidia-driver-525-open installed. Nvidia-smi seems to work, and my card is not used at all since I’m using the built-in graphics adapter (Intel) for my operational needs.

Since turning on Hardware Transcoding in Plex, NO TRANSCODING ACTUALLY WORKS. It’s either Direct Play or nothing. I’d like to get my GPU to transcode. I’m guessing there are things I didn’t do. Most apps refering to the GPU seem to work, like nvidia-settings, or nvidia-smi. But as soon as I try to force a transcode from any player (LAN or WAN), it exits with an error.

I can provide any info required to analyze this problem.

Need DEBUG logs ZIP from PMS which captures the start of a playback session.

I also would like a dpkg -l | grep -i nvidia list of installed packages.

I will advise in advance, but do not yet implement until we determine what’s really happening… , start planning on downgrading the Nvidia drivers. (There have been some issues with the latest Nvidia drivers.

510.85.02 is a very stable driver for all but the very latest NVidia GPU cards

So here is the contents of dpkg -l | grep -i nvidia

ii  libnvidia-cfg1-525:amd64                   525.60.11-0ubuntu0.22.04.1              amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-525                       525.60.11-0ubuntu0.22.04.1              all          Shared files used by the NVIDIA libraries
ii  libnvidia-compute-525:amd64                525.60.11-0ubuntu0.22.04.1              amd64        NVIDIA libcompute package
ii  libnvidia-compute-525:i386                 525.60.11-0ubuntu0.22.04.1              i386         NVIDIA libcompute package
ii  libnvidia-decode-525:amd64                 525.60.11-0ubuntu0.22.04.1              amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-decode-525:i386                  525.60.11-0ubuntu0.22.04.1              i386         NVIDIA Video Decoding runtime libraries
ii  libnvidia-egl-wayland1:amd64               1:1.1.9-1.1                             amd64        Wayland EGL External Platform library -- shared library
ii  libnvidia-encode-525:amd64                 525.60.11-0ubuntu0.22.04.1              amd64        NVENC Video Encoding runtime library
ii  libnvidia-encode-525:i386                  525.60.11-0ubuntu0.22.04.1              i386         NVENC Video Encoding runtime library
ii  libnvidia-extra-525:amd64                  525.60.11-0ubuntu0.22.04.1              amd64        Extra libraries for the NVIDIA driver
ii  libnvidia-fbc1-525:amd64                   525.60.11-0ubuntu0.22.04.1              amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-fbc1-525:i386                    525.60.11-0ubuntu0.22.04.1              i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-525:amd64                     525.60.11-0ubuntu0.22.04.1              amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-gl-525:i386                      525.60.11-0ubuntu0.22.04.1              i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  linux-modules-nvidia-525-5.15.0-56-generic 5.15.0-56.62+1                          amd64        Linux kernel nvidia modules for version 5.15.0-56
ii  linux-modules-nvidia-525-generic-hwe-22.04 5.15.0-56.62+1                          amd64        Extra drivers for nvidia-525 for the generic-hwe-22.04 flavour
ii  linux-objects-nvidia-525-5.15.0-56-generic 5.15.0-56.62+1                          amd64        Linux kernel nvidia modules for version 5.15.0-56 (objects)
ii  linux-signatures-nvidia-5.15.0-56-generic  5.15.0-56.62+1                          amd64        Linux kernel signatures for nvidia modules for version 5.15.0-56-generic
ii  nvidia-compute-utils-525                   525.60.11-0ubuntu0.22.04.1              amd64        NVIDIA compute utilities
rc  nvidia-dkms-525-open                       525.60.11-0ubuntu0.22.04.1              amd64        NVIDIA DKMS package (open kernel module)
ii  nvidia-driver-525                          525.60.11-0ubuntu0.22.04.1              amd64        NVIDIA driver metapackage
ii  nvidia-kernel-common-525                   525.60.11-0ubuntu0.22.04.1              amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-525                   525.60.11-0ubuntu0.22.04.1              amd64        NVIDIA kernel source package
ii  nvidia-prime                               0.8.17.1                                all          Tools to enable NVIDIA's Prime
ii  nvidia-settings                            510.47.03-0ubuntu1                      amd64        Tool for configuring the NVIDIA graphics driver
ii  nvidia-utils-525                           525.60.11-0ubuntu0.22.04.1              amd64        NVIDIA driver support binaries
ii  screen-resolution-extra                    0.18.2                                  all          Extension for the nvidia-settings control panel
ii  xserver-xorg-video-nvidia-525              525.60.11-0ubuntu0.22.04.1              amd64        NVIDIA binary Xorg driver

Also put in an upload with the .zip file. Let me know if there’s any other info you need.
Plex log.log.zip (66.6 KB)

By editing the logs, you’re making me guess what’s happening because I don’t know which CPU and SKU you’re using.

The top three lines of every PMS log file contain this info.

Here is the only info I have:

Dec 10, 2022 00:28:00.065 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] Starting a transcode session hmfb96pf1rbz9u00bpit0pu1 at offset -1.0 (state=3)
Dec 10, 2022 00:28:00.066 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] TPU: hardware transcoding: using hardware decode accelerator vaapi
Dec 10, 2022 00:28:00.066 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] TPU: hardware transcoding: zero-copy support present
Dec 10, 2022 00:28:00.066 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] TPU: hardware transcoding: using zero-copy transcoding
Dec 10, 2022 00:28:00.066 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] [Universal] Using local file path instead of URL: /mnt/storage1/TV/Better Call Saul/Season 06/Better Call Saul - S06E08 - Point and Shoot.m4v
Dec 10, 2022 00:28:00.066 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] Codecs: hardware transcoding: testing API vaapi
Dec 10, 2022 00:28:00.066 [0x7ffa8b105b38] ERROR - [Req#57361/Transcode] [FFMPEG] - libva: /usr/lib/plexmediaserver/lib/dri/iHD_drv_video.so init failed
Dec 10, 2022 00:28:00.067 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] [FFMPEG] - Format 0x32315659 -> yuv420p.
Dec 10, 2022 00:28:00.067 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] [FFMPEG] - Format 0x30323449 -> yuv420p.
Dec 10, 2022 00:28:00.067 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] [FFMPEG] - Format 0x3231564e -> nv12.
Dec 10, 2022 00:28:00.067 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] [FFMPEG] - Format 0x32595559 -> yuyv422.
Dec 10, 2022 00:28:00.067 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] [FFMPEG] - Format 0x59565955 -> uyvy422.
Dec 10, 2022 00:28:00.067 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] [FFMPEG] - Format 0x48323234 -> yuv422p.
Dec 10, 2022 00:28:00.067 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] [FFMPEG] - Format 0x58424752 -> rgb0.
Dec 10, 2022 00:28:00.067 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] [FFMPEG] - Format 0x58524742 -> bgr0.
Dec 10, 2022 00:28:00.067 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] [FFMPEG] - Format 0x30313050 -> p010le.
Dec 10, 2022 00:28:00.067 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] [FFMPEG] - Created surface 0x4000000.
Dec 10, 2022 00:28:00.067 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] [FFMPEG] - Direct mapping possible.
Dec 10, 2022 00:28:00.070 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode] TPU: hardware transcoding: final decoder: vaapi, final encoder: vaapi
Dec 10, 2022 00:28:00.071 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode/JobRunner] Job running: FFMPEG_EXTERNAL_LIBS='/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Codecs/c4efa15-4387-linux-x86_64/' X_PLEX_TOKEN=xxxxxxxxxxxxxxxxxxxx405f-9280-b06e93312437 "/usr/lib/plexmediaserver/Plex Transcoder" "-codec:#0x01" h264 "-hwaccel:#0x01" vaapi "-hwaccel_fallback_threshold:#0x01" 10 "-hwaccel_output_format:#0x01" vaapi "-hwaccel_device:#0x01" vaapi "-codec:#0x02" aac_lc -ss 9 -analyzeduration 20000000 -probesize 20000000 -i "/mnt/storage1/TV/Better Call Saul/Season 06/Better Call Saul - S06E08 - Point and Shoot.m4v" -filter_complex "[0:#0x01]hwupload[0];[0]scale_vaapi=w=1238:h=720:format=nv12[1];[1]hwupload[2]" -map "[2]" -codec:0 h264_vaapi -b:0 2757k -maxrate:0 3676k -bufsize:0 7352k -r:0 23.975999999999999 -filter_complex "[0:#0x02] aresample=async=1:ocl='stereo':rematrix_maxval=0.000000dB:osr=48000[3]" -map "[3]" -metadata:s:1 language=eng -codec:1 libopus -b:1 119k -f segment -segment_format matroska -segment_format_options live=1 -segment_time 1 -segment_header_filename header -segment_start_number 0 -segment_list "http://127.0.0.1:32400/video/:/transcode/session/hmfb96pf1rbz9u00bpit0pu1/7bc11ff1-884a-4764-9d35-b6317c809ba0/manifest?X-Plex-Http-Pipeline=infinite" -segment_list_type csv -segment_list_unfinished 1 -segment_list_size 5 -segment_list_separate_stream_times 1 -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 "chunk-%05d" -start_at_zero -copyts -init_hw_device vaapi=vaapi:/dev/dri/renderD129 -filter_hw_device vaapi -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://127.0.0.1:32400/video/:/transcode/session/hmfb96pf1rbz9u00bpit0pu1/7bc11ff1-884a-4764-9d35-b6317c809ba0/progress
Dec 10, 2022 00:28:00.071 [0x7ffa8b105b38] DEBUG - [Req#57361/Transcode/JobRunner] Jobs: Starting child process with pid 35316
Dec 10, 2022 00:28:00.074 [0x7ffa8456ab38] DEBUG - Request: [127.0.0.1:54088 (Loopback)] PUT /video/:/transcode/session/hmfb96pf1rbz9u00bpit0pu1/7bc11ff1-884a-4764-9d35-b6317c809ba0/progress?status=startup (16 live) #57419 Signed-in Token (couzin2000) (range: bytes=0-) 
Dec 10, 2022 00:28:00.074 [0x7ffa97404b38] DEBUG - Completed: [127.0.0.1:54088] 204 PUT /video/:/transcode/session/hmfb96pf1rbz9u00bpit0pu1/7bc11ff1-884a-4764-9d35-b6317c809ba0/progress?status=startup (16 live) 0ms 203 bytes (pipelined: 1) (range: bytes=0-) 
Dec 10, 2022 00:28:00.076 [0x7ffa8a1f6b38] ERROR - [Req#57464/Transcode/hmfb96pf1rbz9u00bpit0pu1/7bc11ff1-884a-4764-9d35-b6317c809ba0] [AVHWDeviceContext @ 0x7fb687408780] Failed to initialise VAAPI connection: -1 (unknown libva error).
Dec 10, 2022 00:28:00.076 [0x7ffa8456ab38] ERROR - [Req#57467/Transcode/hmfb96pf1rbz9u00bpit0pu1/7bc11ff1-884a-4764-9d35-b6317c809ba0] Device creation failed: -5.
Dec 10, 2022 00:28:00.076 [0x7ffa8a1f6b38] ERROR - [Req#5746c/Transcode/hmfb96pf1rbz9u00bpit0pu1/7bc11ff1-884a-4764-9d35-b6317c809ba0] Failed to set value 'vaapi=vaapi:/dev/dri/renderD129' for option 'init_hw_device': I/O error
Dec 10, 2022 00:28:00.076 [0x7ffa8456ab38] ERROR - [Req#5746d/Transcode/hmfb96pf1rbz9u00bpit0pu1/7bc11ff1-884a-4764-9d35-b6317c809ba0] Error parsing global options: I/O error
Dec 10, 2022 00:28:00.077 [0x7ffa97647b38] DEBUG - Jobs: '/usr/lib/plexmediaserver/Plex Transcoder' exit code for process 35316 is 1 (failure)
Dec 10, 2022 00:28:10.026 [0x7ffa8a1f6b38] DEBUG - Request: [192.168.0.100:64521 (Subnet)] GET /:/timeline

From this, I conclude:

  1. It found something which looks like Intel.
  2. It can create a surface to transcode to work with
  3. It cannot transcode this h264 1920x1080p video Intel IHD_init fails
  4. It’s trying to use /dev/dri/renderD129 and failed because it can’t initialize it.

What is the CPU & SKU please?

Do you have both renderD128 and renderD129 ?
Is plex a member of the group which owns those devices ? (the installer should have added PMS to it)

In the future, please don’t edit logs. If you need them private, I’ll gladly send you a PM

I’m sorry for handing over edited logs… I saw you mentioned “DEBUG” logs, and since I couldn’t just isolate the DEBUG section I cut out just the part from yesterday when I logged in to try and test the transcode. Not even sure if I can cut out the debug part.

Both renderD128 and 129 are in /dev/dri/.

I am currently using the Intel built-in chip form video rendering on my server. The 1660S ins installed as well but has no connected cables or monitors.
Plex is a member of the group I believe, but how would I verify? I’m not very linux-savvy.

Let me know if there’s anything else I can send your way.
Thanks again for your help!

Which CPU chip are you using? That’s the most critical for me right now.

Linux, when it starts, will always find the QSV render device before it looks down the PCI bus for the GPU card.

I have machines here with both Intel and AMD GPUs in them (I7-8809G chip).
For me, I need be careful about telling PMS which one to use.

I’m wondering what’s happening on your end in how the CPU finds and subsequently enumerates the GPUs.

renderD128 is historically Intel and renderD129 is historically AMD in a twin-gpu machine.

On a Ryzen machine, renderD128 will be Radeon and then PMS would try to talk to it but fail.

I would like to ask about your HardwareDevicePath variable.

Do you have it written in Preferences.xml as HardwareDevicePath="/dev/dri/renderD129" ?

I’m currently using an Intel i5-3470. The graphcis card used to display on screen is the built-in MESA chip.
The separate graphics card is Nvidia TU116 (GTX 1660 Super).

If you’re referring to the Preferences.xml in /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/, it is not written. I have only 2 lines in there, detailing “oldestpreviousversion” and “machineidentifier”.
Not sure if there SHOULD be anything else there.

There most definitely should be other things in there.

When you only have basic ID strings, the server is running in an UNCLAIMED (free) state.

Hardware transcoding is a PlexPass-only feature (meaning the server must associated with your account)

I did look at Plex.tv (your machines)

I see the name of a server , starts with “SEB”, which has not been seen in 15 hours.

With you trying to make PMS work and the the known server having not been seen (in contact with Plex.tv) in 15 hours, I need to ask if you, at any point in the last 15 hours, completely erased PMS from the machine and started over ?

If you have, the next step is to claim the server again.
When that happens, PMS will allow and try to use HW transcoding.

Perhaps that’s a mistake.
I have been seeing the “Plex database is corrupted” message for a while, never knowing how this was happening. Because I DID claim the server, it DOES operate as mine. Perhaps this is left over from an old install?
If this is the case, how would I go about clearing out the old install and getting the new one to work properly? where would the DETAILED files be located at this point?

Maybe I read your question diagonally. I did not completely erase my database. It’s been there for quite some time. However, I HAVE been having the message that my database has been found to be corrupt - it IS the same name as the one I had started before, so I’M guessing there is a conflicting install that is left over in the system and THAT’s what’s causing the issue.
How can I possibly go about finding the files from the previous install and removing them? can I even do that at all?

I was not notified of your message until now. I apologize for that

Database corruptions come in two forms. Bad records and malformed indexes.

Do you have an example to show me ?

I have a tool, runs at the command line, which will do basic DB repair.
It corrects a lot of the things PMS can’t but some content-related record corruptions can’t be fixed by my tool (I don’t know the content).

If you’d like, here is the tool which will try to repair and reindex your databases for PMS.

Please let me know if you have any questions.

Documentation + examples are in the README.

For you, I recommend option sequence 1 - 4 - 3

With that completed, See if everything is working.

I expect the most you’ll need to do for full recovery is

  1. Scan Files
    -and/or-
  2. Refresh All Metadata

OK. One thing did work - using your script, very effective. The script detected a corruption in the main DB. I was able to repair, vacuum, and reindex the entire db. I get a message saying the db is fixed.
However, I am still left in the dark as far as the transcode goes. Trying to force a 1080p to 720p transcode resulted in an error again.
Currently the transcoder temporary directory is set to /tmp. Shouldn’t I change that? Isn’t this indicative of RAM transcoding on the CPU’s part?
I can bring logs if you want.
Plex Media Server.log.zip (158.9 KB)

It’s been so long since I’ve seen a -3xxx class machine I almost forgot.

Add the following to Preferences.xml (with PMS stopped)

VaapiDriver="i965"

Put it on the last line before the closing />

Yes, I would remove /tmp for now until we get the basics running

Also set the Hardware Device Path back to renderD128.

For this basic testing, play only H,264 videos

I am convinced the Nvidia drivers aren’t working correctly because PMS can’t see the card

error).
Dec 14, 2022 16:58:31.611 [0x7f580c5efb38] DEBUG - Completed: [[::1]:45722] 200 GET /status/sessions (12 live) GZIP 7ms 2918 bytes (pipelined: 3)
Dec 14, 2022 16:58:31.611 [0x7f58085c9b38] ERROR - [Req#4d6/Transcode/vrhulvj2rlfgil7c2t2yewd6/a0ee20f2-4152-4fb0-a6de-96e68302d3fc] Device creation failed: -5.
Dec 14, 2022 16:58:31.611 [0x7f5808fd8b38] ERROR - [Req#4d8/Transcode/vrhulvj2rlfgil7c2t2yewd6/a0ee20f2-4152-4fb0-a6de-96e68302d3fc] Failed to set value 'vaapi=vaapi:/dev/dri/renderD129' for option 'init_hw_device': I/O error
Dec 14, 2022 16:58:31.612 [0x7f58083c6b38] ERROR - [Req#4d9/Transcode/vrhulvj2rlfgil7c2t2yewd6/a0ee20f2-4152-4fb0-a6de-96e68302d3fc] Error parsing global options: I/O error
Dec 14, 2022 16:58:31.614 [0x7f580ca2fb38] DEBUG - Jobs: '/usr/lib/plexmediaserver/Plex Transcoder' exit code for process 86206 is 1 (failure)
Dec 14, 2022 16:58:31.614 [0x7f58087ccb38] DEBUG - Streaming Resource: Terminating session 0x7f580a4ca938:9prxfujzcskuc58lhjseg1g4 which is using transcoder slot.  Used slots is now 0
Dec 14, 2022 16:58:31.614 [0x7f58087ccb38] DEBUG - Streaming Resource: Terminated session 0x7f580a4ca938:9prxfujzcskuc58lhjseg1g4 with reason Conversion failed. The transcoder exited due to an error.
Dec 14, 2022 16:58:31.614 [0x7f58087ccb38] DEBUG - Killing job.
1 Like

I have no idea how you did it,

All my files are in h.264, everything is in 1080p with stereo sound.

It turns out my Preferences.xml file is all on one line - using nano to read it made it very much NOT reader-friendly. I had to scroll right to see what was there, I was missing the HardwareDevicePath setting in there, and adding the VaapiDriver line also was needed.
I haven’t switched to removing the /tmp folder yet, but it totally worked.

I will have to remember to keep this thread, as I’m planning to switch operating systems to unRaid pretty soon.

Before I tested, I ran nvidia-smi. The card was using only 9mb off the 6341mb of graphics RAM available. Then I ran nvidia-smi AS I was transcoding, and saw 199Mb were used. As soon as I stopped, it went back to 6Mb.

And for an even more incredible info, the image is effing flawless.
Thank you SO MUCH for your follow-through and all your help, it,s very much appreciated!

How did I do it? magic :smiling_imp:

lol

I can’t help with unraid. I’ve never been able to craft a boot USB from within a VM to place unraid in a VM.

1 Like

Well, I’ll figure it out somehow. At least now I kow how to address the situation in Ubuntu. Thanks again for everything!

The kicker was the IHD driver’s sensitivity to the -3xxx CPU.

I think there’s a bug in it. I saw transcoding fail IHD_init where it shouldn’t.

When I figure that out, I’ll send it off to the team to fix

1 Like

Not sure where you saw the fail. Mind you, I may have been using a video files encoded by NVENC which might (?) have an impact on that. Not sure if settings allow every GPU in existence to decode - some options are on which I don’t even know if they impact or not, but are there and meant for extra compatibility.

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