Repository navigation
[BUG] Nvidia HW Transcoding Issues #432
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
I'm having issues with HW transcoding after updating all the packages on my Arch Linux host. This included the nvidia container runtime and updating the nvidia driver to version 580.xx.xx. Originally the Plex container failed to even start with the following error
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running prestart hook #0: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy'
I found this post on the Arch Linux forum about this exact issue which led me to switch to using CDI instead of legacy by running the following commands.
sudo nvidia-ctk runtime configure --runtime=docker
sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
sudo nvidia-ctk config --in-place --set nvidia-container-runtime.mode=cdi && sudo systemctl restart dockerThis fixed the issue for my frigate, jellyfin, and faster-whisper containers but for some reason the Plex container exhibits the same behavior as #403 where the, failed to load libcuda.so errors come up when Plex attempts to transcode. I am able to run nvidia-smi in the plex container and I receive the proper output.
I was finally able to get Plex to use HW transcoding by using the solution in #403 (comment) which was to run for i in /usr/lib/lib*.so.1; do ln -s $i /usr/lib/plexmediaserver/lib/; done in the container.
That obviously isn't a super ideal solution so I wanted to bring the issue to your attention to see if there is something else that could be done to mitigate this issue. I'm really not sure where this is falling down whether it be the nvidia 580.xx driver, the nvidia container runtime, a docker update, upstream of this container in plex itself, or the linux server container itself.
Expected Behavior
The Plex container starts and hardware transcoding remains functional as it did before.
Steps To Reproduce
- Update Arch Linux with
sudo pacman -Syyu - Try to run the Plex container
Environment
- OS: Arch Linux
- How docker service was installed: sudo pacman -S dockerCPU architecture
x86-64
Docker creation
I used the following compose file:
services:
plex:
image: lscr.io/linuxserver/plex:latest
container_name: plex
runtime: nvidia
network_mode: host
environment:
- PUID=1001
- PGID=985
- VERSION=docker
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
volumes:
- /tank/appdata/plex:/config
- /tank/media:/media
restart: unless-stopped
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]Container logs
[migrations] started
[migrations] no migrations found
───────────────────────────────────────
██╗ ███████╗██╗ ██████╗
██║ ██╔════╝██║██╔═══██╗
██║ ███████╗██║██║ ██║
██║ ╚════██║██║██║ ██║
███████╗███████║██║╚██████╔╝
╚══════╝╚══════╝╚═╝ ╚═════╝
Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID: 1001
User GID: 985
───────────────────────────────────────
Linuxserver.io version: 1.42.1.10060-4e8b05daf-ls278
Build-date: 2025-08-11T17:39:21+00:00
───────────────────────────────────────
**** Server already claimed ****
**** adding /dev/dri/renderD128 to video group root with id 0 ****
**** permissions for /dev/dri/card1 are good ****
Docker is used for versioning skip update check
[custom-init] No custom files found, skipping...
Starting Plex Media Server. . . (you can ignore the libusb_init error)
Connection to localhost (::1) 32400 port [tcp/*] succeeded!
[ls.io-init] done.
Critical: libusb_init failed
Dolby, Dolby Digital, Dolby Digital Plus, Dolby TrueHD and the double D symbol are trademarks of Dolby Laboratories.
Connection to 45.56.108.77 closed by remote host.Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIssues
Activity
github-actions commentedon Sep 4, 2025
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.
LinuxServer-CI commentedon Oct 5, 2025
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
iurab commentedon Oct 16, 2025
I encounter the same problem.
tr4cks commentedon Oct 27, 2025
I’ve run into a similar problem since updating the NVIDIA Container Toolkit v1.18.0.
libcuda.so.1library, even thoughffmpegworks fine in the same container — I’ve tested this.I tried switching back to legacy mode by editing
/etc/nvidia-container-runtime/config.toml:As a temporary workaround, I added the NVIDIA library path directly in my Docker Compose environment:
libcuda.so.1and enables GPU acceleration again.I’m not entirely sure who should take responsibility for this issue — NVIDIA, Docker, or the container images themselves — since NVIDIA introduced a new way of exposing libraries and devices that older containers like Plex weren’t designed to handle.
Just wanted to share my findings in case it helps others facing the same issue.
Sorry to repeat myself a bit from the original message, but it's to explain the whole process I went through.
TheSpaceGod commentedon Nov 14, 2025
I am having a similar issue on nvidia container toolkit 1.17.9 . It looks like my card is mostly working, its just plex cant find the nvidia decoder (hevc_nvdec) but it can find the nvidia encoder (hevc_nvenc).
tr4cks commentedon Nov 14, 2025
@TheSpaceGod Was it working before that? Are you in
CDImode or not?Because in version
1.17.*,CDImode is not enabled by default. But you may have forced it.Is Plex unable to find the CUDA library? You can check the logs.
TheSpaceGod commentedon Nov 14, 2025
@tr4cks I am using nixOS so this all is more... complicated than normal Linux. Yes it was working before this.
From what I can tell, my nvidia container runtime is in mode "auto". The following shows all my nvidia LD libraries look to be available in the container:
tr4cks commentedon Nov 14, 2025
@TheSpaceGod When I run
ldconfig, the library is also referenced correctly, yet during transcoding, Plex cannot find the library. I believe Plex expects to find the library in a specific location. If I understand correctly, the problem is that beforeCDImode, theNVIDIA Container Toolkitcopied the library to a standard location, but since the update, it copies it to the same location as the host system. This location is not necessarily standard, so Plex cannot find the library. I think this is where the problem lies, but I'm not entirely sure yet.However, you told me you were in
automode and using version1.17, so not inCDImode butlegacymode. So I don't know if that's where your problem lies. Can you start a stream and thengrepthrough the logs (/config/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log) to try to finderrororcuda. See if, like me, Plex can't find the library at runtime.If it cannot find the library, try adding this environment variable when starting the container and let me know if it works for you:
TheSpaceGod commentedon Nov 14, 2025
@tr4cks in an older working configuration, I had this env variable before I thought I didnt need it anymore. I tried adding it back in, but still no luck for me. I can go find those logs, but I dont remember seeing error messages like that in my most recent look at them.
LD_LIBRARY_PATH = "/usr/local/nvidia/lib:/usr/local/nvidia/lib64"I am gussing this is how my nixOS NCT configuration is mounting in the nvidia libraries
TheSpaceGod commentedon Nov 14, 2025
Also, AI seems to think that the nixOS NCT configuration I am using is defaulting to CDI mode. I also no longer need to include
--runtime=nvidia(which actually breaks now for me).tr4cks commentedon Nov 14, 2025
I think the first thing to do is find out what's wrong with Plex in the logs. Find out why it won't start transcoding on the graphic card.
Apparently you also have two locations where the cuda library is present, which is strange, isn't it?
Have you tried this path instead:
I'm not familiar with the operating system, so I don't know if it could be related or not.
5 remaining items
pgporada commentedon Jan 16, 2026
Not stale
tr4cks commentedon Jan 16, 2026
@pgporada In fact, after posting an issue on the NVIDIA repository, it seems that the problem comes from NVIDIA and not from any setting in this container.
Check here, it's in progress. Try updating your graphics card driver to the latest version or add
LD_LIBRARY_PATHotherwise.You can leave the issue open until it is resolved so that people in the community can refer to it, but I don't think there's anything to be done here.
MikeVensel commentedon Jan 16, 2026
@tr4cks Glad it's being worked on but I'm not sure if their fix is going to help me. I'm running a gtx 1080 for transcoding and it dropped out of driver support recently so if the fix is in the driver I'm probably out of luck.
pgporada commentedon Jan 16, 2026
I've used the
LD_LIBRARY_PATHwith nvidia cdi1.18.1, nvidia driver550.163.01-2, a Quadro M2000, and it's working great on Debian Trixie. I can see my rootless podman container performing hardware transcoding tasks. Without theLD_LIBRARY_PATHenv var specifically, hardware transcoding does NOT work.Here's my podman script for posterity.
tr4cks commentedon Jan 16, 2026
@MikeVensel I just checked and your graphics card is based on Pascal architecture, so I think it should support the latest drivers.
@pgporada
LD_LIBRARY_PATHor latest driver on Trixie?MikeVensel commentedon Jan 16, 2026
@tr4cks Oh at least on Arch I think turing and newer get the new driver while mine is on the legacy branch at least according to the wiki. I was pretty sure that meant rtx 20 series and newer.
pgporada commentedon Jan 16, 2026
@tr4cks I edited my comment above to be clearer.
tr4cks commentedon Jan 16, 2026
@MikeVensel No, your card is compatible. I just checked, and you can use the latest driver. However, you may have to install the NVIDIA drivers manually, depending on your distribution.
For AMD64 check here: https://www.nvidia.com/fr-fr/drivers/details/261751/
@pgporada Glad to see that this technique works. I have exactly the same configuration as you because I preferred to install the nvidia packages recommended by Debian Trixie.
It is also possible to install the latest version of the driver via nvidia, and apparently it works without the environment variable. I haven't tried it, but someone else has confirmed it with version
580of the driver.hgfi commentedon Mar 9, 2026
Ran into this and had some trouble fixing it so here is how my compose is now set up:
Note
LD_LIBRARY_PATH-> without this plex fails to findlibcuda.so.1. I don't now who should fix it (plex or this repo) but this works for now and should keep working even when it's fixed properly.I use
nvidia.com/gpu=allbecause this uses the CDI which is the new default, but the old deploy block still works too.My environment:
Debian 13 (
6.12.73+deb13-amd64)Docker 29.3.0
Nvidia driver: 550.163.01
NVIDIA Container Runtime: 1.18.2
tr4cks commentedon Mar 9, 2026
@hgfi Yes, this solution and who is responsible for it (nvidia) is already indicated in this issue. I opened an issue on the nvidia repository (see above) a while ago.
NASANAUT commentedon Mar 21, 2026
I can confirm a very similar result on Arch Linux, but in my case fixing the missing
libcuda.so.1error only gets me one step further.At first I also had the same
Cannot load libcuda.so.1problem. After adding only these 4 NVIDIA library links inside/usr/lib/plexmediaserver/lib/:libcuda.so.1libnvidia-encode.so.1libnvcuvid.so.1libnvidia-ml.so.1Plex no longer complains about the missing library, and the GPU is clearly visible inside the container.
However, hardware transcoding still does not work. The new failure mode is:
CUDA_ERROR_UNKNOWNRelevant log output:
Important detail:
nvidia-smiworks fine inside the container, so the GPU is visible there.I also tested the official Plex image, not only
linuxserver/plex, and I get the same end result there as well.This makes me think there may be two separate layers to this problem on Arch:
libcuda.so.1not being found in the expected Plex library pathCUDA_ERROR_UNKNOWNFor reference, this is the command I am using with LinuxServer Plex:
I also tested
lscr.io/linuxserver/plex:latestwith the same result.And then I add the 4 library links like this:
So in my case, the workaround fixes the missing
libcuda.so.1part, but not the actual CUDA initialization failure afterwards.tr4cks commentedon Mar 21, 2026
Maybe copying the library directly from the host to the container is causing a problem.
Have you tried finding where
NVIDIA Container Toolkitmounted your library within your Plex container and then specifying that path in theLD_LIBRARY_PATHvariable?On Debian, it’s located here:
/usr/lib/x86_64-linux-gnu/nvidia/current, but on Arch, the mount point is likely somewhere else.If they are indeed in
/usr/libas specified in your Docker Compose file, then there might be another issue.I've opened an issue here; maybe you can describe your problem there or open a new issue in this repository because that's where the issue needs to be solved, and for now, not much is happening.
NASANAUT commentedon Mar 21, 2026
Thanks, I tested that theory as well.
You were right that manually copying/linking host libraries into
/usr/lib/plexmediaserver/libmight not be the right long-term solution.I checked where the NVIDIA libraries are available inside the container, and they are already present under
/usr/libwithout any extra host bind mount:This gives:
So I removed the extra host library bind mount and also stopped creating manual symlinks into
/usr/lib/plexmediaserver/lib.I then started the container like this:
And verified inside the container:
Output shows:
LD_LIBRARY_PATH=/usr/libnvidia-smiworks fine inside the containerSo the GPU is visible, and Plex also loads
libcuda.so.1successfully now.But hardware transcoding still fails with:
and more specifically:
So at this point, it no longer looks like a library path issue on my system.
It seems more like:
libcuda.so.1I also see the same end result with the official Plex image, not only
linuxserver/plex.fix(plex): set LD_LIBRARY_PATH for CDI-injected GPU libs (NVENC)