[FFMPEG] - Cannot load libcuda.so.1 | Hardware encoding in docker on a proxmox vm

Server Version#: 1.43.0.10492

This is my setup

  1. Computer with GTX 1060
  2. Installed on it is Proxmox
  3. Proxmox is running a VM (PCIe passthrough seemingly works no errors other than plex)
  4. Plex is running in docker on that VM

Here is my plex log file

Plex Media Server Logs_2026-02-26_20-02-45.zip (1.3 MB)

I saw [FFMPEG] - Cannot load libcuda.so.1 in the log and was able to find this guy on reddit in much the same situation as me, but i was unable to find an answer from that thread.

Here is my compose.yml:

I have the latest drivers installed with sudo ubuntu-drivers autoinstall
nvidia-smi returns this:

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.288.01             Driver Version: 535.288.01   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| 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 1060 6GB    Off | 00000000:00:10.0 Off |                  N/A |
|  0%   31C    P8               5W / 156W |      2MiB /  6144MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+

I know this might not be the right place to ask but i thought somebody might have experience with this exact setup.

Did you ever resolve this? I’m also getting this error and have made absolutely zero headway towards fixing it.

ERROR - [Req#397/Transcode] [FFMPEG] - Cannot load libcuda.so.1
ERROR - [Req#397/Transcode] [FFMPEG] - Could not dynamically load CUDA

Yes i did. My issue was that i did not fully understand all the steps needed to get an nvidia gpu to work inside a docker container

Just to repeat my setup:

  1. Proxmox on machine with nvidia GPU
  2. Ubuntu VM
  3. Docker running plex on that VM.

I first thought i had done something wrong in the passthrough of the device to the VM with IOMMU and driver blacklisting and so on, but running nvidia-smi worked.
My issue was with docker.

This is my new compose file: (some sections may be obsolete, but the moment it started working i stopped changing it)

services:
  plex:
    image: lscr.io/linuxserver/plex:latest
    container_name: plex
    restart: unless-stopped
    networks:
      - default
    runtime: nvidia
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu,video]
    ports:
      - "32400:32400/tcp"
      - "3005:3005/tcp"
      - "8324:8324/tcp"
      - "32469:32469/tcp"
      - "1900:1900/udp"
      - "32410:32410/udp"
      - "32412:32412/udp"
      - "32413:32413/udp"
      - "32414:32414/udp"
    volumes:
      - ./config:/config
      - /data:/data
      - ./transcode:/transcode
    environment:
      TZ: "My_TZ"
      PLEX_CLAIM: "My_Key"
      PLEX_UID: "1000"
      PLEX_GID: "1000"
      NVIDIA_VISIBLE_DEVICES: all
      NVIDIA_DRIVER_CAPABILITIES: compute,video,utility



I kept getting errors when i included this section, so i just didn’t include it originally.

    runtime: nvidia
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu,video]

Turns out that section is crucial, you just need the NVIDIA Container Toolkit for it to work.
I followed this official guide from NVIDIA.

This may not be the solution to your issue, so if you have further trouble go ahead and ask.

Thanks for replying! My issue turned out to be something different. I was able to resolve it using the workaround highlighted in this GitHub issue.