Optimize transcoding stop after doing one file after updating to latest windows server live build

That setting was set to 1 for me, I just set it to 20 to see if there’s a difference.

Is there a way to restart the optimize job without deleting the queue? I don’t mind deleting the queue, just wondering if I’m missing something.

Limited to 3 background transcodes, a few started and then failed with a message in the UI, “Converted files cannot be written to the server’s disk”

In the logs I’m seeing this

Sep 04, 2025 18:02:06.531 [140673540229944] Error — [Req#356a2] Versions: unable to make a media decision for metadata item 57614
Sep 04, 2025 18:02:06.876 [140673444154168] Warning — [Req#357a2] SLOW QUERY: It took 1130.000000 ms to retrieve 21 items.
Sep 04, 2025 18:02:08.859 [140673540229944] Error — [Req#356a2] [FFMPEG] - cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags, hwctx->internal->cuda_device) failed
Sep 04, 2025 18:02:08.859 [140673540229944] Error — [Req#356a2] [FFMPEG] -  -> CUDA_ERROR_NOT_PERMITTED: operation not permitted
Sep 04, 2025 18:02:08.859 [140673540229944] Error — [Req#356a2] [FFMPEG] - 

Sep 04, 2025 18:02:08.873 [140673540229944] Error — [Req#356a2] [FFMPEG] - cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags, hwctx->internal->cuda_device) failed
Sep 04, 2025 18:02:08.873 [140673540229944] Error — [Req#356a2] [FFMPEG] -  -> CUDA_ERROR_NOT_PERMITTED: operation not permitted
Sep 04, 2025 18:02:08.873 [140673540229944] Error — [Req#356a2] [FFMPEG] - 

Sep 04, 2025 18:02:08.889 [140673540229944] Error — [Req#356a2] [FFMPEG] - cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags, hwctx->internal->cuda_device) failed
Sep 04, 2025 18:02:08.889 [140673540229944] Error — [Req#356a2] [FFMPEG] -  -> CUDA_ERROR_NOT_PERMITTED: operation not permitted
Sep 04, 2025 18:02:08.889 [140673540229944] Error — [Req#356a2] [FFMPEG] - 

Sep 04, 2025 18:02:08.921 [140673540229944] Error — [Req#356a2] [FFMPEG] - cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags, hwctx->internal->cuda_device) failed
Sep 04, 2025 18:02:08.921 [140673540229944] Error — [Req#356a2] [FFMPEG] -  -> CUDA_ERROR_NOT_PERMITTED: operation not permitted
Sep 04, 2025 18:02:08.921 [140673540229944] Error — [Req#356a2] [FFMPEG] - 

Is your card capable of that many transcodes? Your error looks like the card hit its limit and Plex couldn’t callback to software.

@gravee could you please share the entire zip of your PMS logs? Snippets are rarely helpful.

what do you have your GPU slots set to? NVIDIA artificially limits the number of simultaneous transcodes on a lot of its consumer devices, its possible we don’t handle this case very well in the optimizer queue. I would set the GPU slots to whatever that limit is for your device, restart PMS, and see what happens

I think the Nvidia limit might’ve been the problem. I completely forgot about that when I set the number of transcodes. I usually apply the nvidia-patch to bypass that limit, but I also know Nvidia increased that limit to 8 at some point.

So this morning I updated the driver to 580.76.05 and then applied the patch for that version. I also updated the OS and restarted, that included switching to a new kernel too. It’s been a while since I rebooted this VM.

Then I remade the optimize queue.

As of right now, I have 3 optimize transcodes going on at the same time: Imgur: The magic of the Internet

I see all of them on nvidia-smi:

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.76.05              Driver Version: 580.76.05      CUDA Version: 13.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  NVIDIA GeForce GTX 1660        Off |   00000000:01:00.0 Off |                  N/A |
| 48%   62C    P0             44W /  130W |    1925MiB /   6144MiB |     20%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A           21470      C   ...mediaserver/Plex Media Server         32MiB |
|    0   N/A  N/A           24881      C   ...exmediaserver/Plex Transcoder        618MiB |
|    0   N/A  N/A           24962      C   ...exmediaserver/Plex Transcoder        618MiB |
|    0   N/A  N/A           25139      C   ...exmediaserver/Plex Transcoder        652MiB |
+-----------------------------------------------------------------------------------------+

I’ll let this run for a while and let y’all know if I run into issues again.

To note, the previous test was limited to 3 background transcodes, that should’ve been below the conversion limit on nvidia GPUs. Afaik the limit is 8 on consumer GPUs now. I have a GTX 1060. Correct me if I’m wrong there, please.

@Atomatth understood, if I run into issues again I’ll post the full log zip.

@chris_decker08 this is my transcoder settings in Plex, I haven’t changed anything here since yesterday: Imgur: The magic of the Internet

1 Like

Thanks everyone, seems like the problem is resolved for me. Not sure if it was the nvidia-patch, restart, or driver reinstall that fixed it.

I also saw that a bunch of items had old optimized versions that weren’t being deleted. Not sure if that was due to permissions change, but I went through manually and removed all the files using the command below

find . -type d -name “Plex Versions” -print -exec rm -rv {} ;

I ran that from within my movies directory, to delete any old remnants because I wanted to recreate all my optimized versions anyway.

So far about 6 or 7 have completed without issues.

1 Like

Is there a way to re-try a bunch of optimize tasks if they failed?

At some point last night, something messed up, and the docker container lost access to the GPU.

About 300 items in the optimize queue failed to run.

I restarted the container and now everything is okay, but I have 300 something items that need to be re-put into the queue. I was hoping there was some sort of one click method to do that.

Are these 300 items individual optimization jobs or 1 job with 300 items? I would assume that navigating to the Optimized Versions page would show you the jobs with an option to restart them. What are you seeing there?

1 job with 300 items. I usually see a circle/refresh icon when there are issues on a whole job, but I don’t see it here.

Imgur

Imgur

Hitting the refresh button on the specific item puts it back on the queue and runs it fine.

Transcoding fails every time a new series or episode is selected, until the Plex server is rebooted. Then multiple episodes and/or series can be added and transcoding works. The following day the Plex server has to be rebooted again for transcoding to work. This has been going on for months.

What could the cause be?

Host: Raspberry Pi 4 with all Raspberry Pi OS and Plex Server updates applied automagically. One external USB disk with ample free space.

  • Transcoder quality: Prefer high speed encoding

  • Transcoder temporary directory: /tmp (RAM disk on Pi)

  • Downloads temporary directory: /tmp

  • Background transcoding x264 preset: Very fast

  • Maximum simultaneous video transcode: 1

  • Maximum simultaneous background video transcode: 1

Thanks

Hey back again, I was able to slowly go through and add all the remaining items one by one. Unfortunately now it’s stuck again, it did about 90% of the items, but the remaining are stuck with the status ‘waiting’.

I’ve tried rebooting the container and the host VM with no change in status.

Anything else I should try? New items being added aren’t being optimized either.

I have the background transcode limit set to 3, GPU is visible inside the container and Plex is able to use it.

@gravee Can you grab PMS logs while these jobs are stuck?

@PiBloke logs too please.

This seems like it might be problematic. Could you change these settings to their default directories (remove the location from these settings) and test again?

Sure, here are two logs. I restarted the Plex Server container so you can see what happens or doesn’t happen during start up. I haven’t reviewed anything on the logs, unfortunately.

Plex Media Server.1.log (31.8 KB)

Plex Media Server.2.log (5.5 MB)

1 Like