I have searched and searched, and I cannot figure out why my official Plex Docker compose is not using the GPU for transcoding. I’m using Dockge to manage. Here is the compose file:
services:
pms-docker:
container_name: plex
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
environment:
- ADVERTISE_IP=http://172.16.42.139:32400/
- ALLOWED_NETWORKS=192.168.0.0/16,172.16.0.0/12
- NVIDIA_VISIBLE_DEVICES=${GPU_DEVICE_ID}
- PLEX_CLAIM=claim...
- PLEX_UID=568
- PLEX_GID=568
- TZ=America/Chicago
hostname: rwithrow-plex
volumes:
- ${DOCKER_ROOT}/config/plex:/config
- /dev/shm:/transcode
- ${DOCKER_ROOT}/data/plex:/data
- ${POOL_ROOT}/tv:/mnt/tv
- ${POOL_ROOT}/movies:/mnt/movies
- ${POOL_ROOT}/audiobooks:/mnt/audiobooks
image: plexinc/pms-docker:plexpass
runtime: nvidia
restart: unless-stopped
networks: {}
And .env:
DOCKER_ROOT=/mnt/pool1/docker
GPU_DEVICE_ID=0000:02:00.0
POOL_ROOT=/mnt/pool1
The TrueNAS repo Plex was using the GPU successfully. Things I have tried:
Many variations in the compose file
Disabling and then enabling the GPU setting in TrueNAS Apps
Running nvidia-smi
in the container shows my Quadro P400. And Plex has “Use hardware-accelerated video encoding” enabled.
What am I missing? Does the official Plex Docker just not work with Docker compose? That would seem odd. I wish we could see the compose file used by TrueNAS apps. I have seen an example on this forum by Tyler_Shield, but he is using a third-party Docker image.
LarsR
February 17, 2025, 12:07am
2
for my jellyfin im using this in my compose
runtime: nvidia
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
instead of the env variables
Edit: you do have a Plex pass right? Just to make sure
Thanks for the idea! Unfortunately it didn’t make a difference for me. And yes, I do have a plexpass.
Updated compose file:
services:
pms-docker:
container_name: plex
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
environment:
- ADVERTISE_IP=http://172.16.42.139:32400/
- ALLOWED_NETWORKS=192.168.0.0/16,172.16.0.0/12
- NVIDIA_VISIBLE_DEVICES=${GPU_DEVICE_ID}
- PLEX_CLAIM=claim...
- PLEX_UID=568
- PLEX_GID=568
- TZ=America/Chicago
hostname: rwithrow-plex
volumes:
- ${DOCKER_ROOT}/config/plex:/config
- /dev/shm:/transcode
- ${DOCKER_ROOT}/data/plex:/data
- ${POOL_ROOT}/tv:/mnt/tv
- ${POOL_ROOT}/movies:/mnt/movies
- ${POOL_ROOT}/audiobooks:/mnt/audiobooks
image: plexinc/pms-docker:plexpass
runtime: nvidia
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
networks: {}
Just found this on a blog post:
The official image is missing NVIDIA packages that prevent transcoding from working correctly.
I guess TrueNAS is not using the official image, either!
Yessss, it is now working with a different image!!
This is the working compose file:
services:
pms-docker:
container_name: plex
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
environment:
- ADVERTISE_IP=http://172.16.42.139:32400/
- ALLOWED_NETWORKS=192.168.0.0/16,172.16.0.0/12
- NVIDIA_DRIVER_CAPABILITIES=compute,video,utility
- NVIDIA_VISIBLE_DEVICES=all
- PLEX_CLAIM=claim-...
- PUID=568
- PGID=568
- TZ=America/Chicago
- VERSION=docker
hostname: rwithrow-plex
volumes:
- ${DOCKER_ROOT}/config/plex:/config
- /dev/shm:/transcode
- ${DOCKER_ROOT}/data/plex:/data
- ${POOL_ROOT}/tv:/mnt/tv
- ${POOL_ROOT}/movies:/mnt/movies
- ${POOL_ROOT}/audiobooks:/mnt/audiobooks
image: lscr.io/linuxserver/plex:latest
runtime: nvidia
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
networks: {}