Hardware transcoding

Server Version#: 1.30.0.6486
Player Version#: Plex web 4.87.2

I’m running Debian 11 (5.10.0-18-amd64) with an Nvidia Quadro K600.

I’ve installed the appropriate nvidia-driver (470.141.03), I have the nvidia-container-toolkit (1.11.0), nvidia-docker2 (2.11.0) and the nvidia-container-runtime (3.11.0) installed, too.

nvidia-smi is installed on my system, which shows correct temp, model and memory, etc.

I have NVIDIA_VISIBLE_DEVICES=all and NVIDIA_DRIVER_CAPABILITIES=compute,video,utility in my Env and my runtime is runc.

When I exec into Plex (docker exec -it plex /bin/bash) and run nvidia-smi, I see the same GPU info.

This, to me, suggests that the Plex container indeed has access to the GPU, which begs the question why it’s never used for transcoding.

I’ve had a lifetime pass for, I believe, more than a year now and transcoding is enabled in the settings. I don’t have any permissions issues either, and Plex has been running stable for as long as I’ve had it.

I would be very grateful if anyone might cure what ails my Plex?

When playing back a file what does the dashboard show?

Output of >ls -l /dev/dri

Is the id for the docker part of the video/render groups?

A K600 won’t do h.265 or HDR.

Hi, thanks for the reply.
ls -l /dev/dri:

me@my_box:~$ ls -l /dev/dri
total 0
drwxr-xr-x 2 root root         80 Dec 22 06:49 by-path
crw-rw---- 1 root video  226,   0 Dec 22 06:49 card0
crw-rw---- 1 root render 226, 128 Dec 22 06:49 renderD128

The user that runs the container is part of video and render. Plex never hw-transcodes, regardless of the format. The dashboard shows either direct play or sw-transcoding.

I just tried Jellyfin, and it does use my GPU…

Please post the contents of your docker run/compose file.

version: '2'
services:
  plex:
    container_name: plex
    image: plexinc/pms-docker
    restart: unless-stopped
    environment:
      - TZ=Europe/Brussels
      - PUID=1000
      - PGID=1001
      - ADVERTISE_IP=http://192.168.1.9:32400/
      - VERSION=docker
      - PLEX_CLAIM=claim-MyToken
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=compute,utility
    network_mode: host
    volumes:
      - /path/to/plexdata:/config
      - /path/to/transcode:/transcode
      - /path/to/media:/data

The Plex container created in Portainer, then recreated to change the runtime to nvidia.

It is usually easier to get this going from a compose.yml file and then monitor/maintain with portainer.

I would add to your compose file:

--runtime=nvidia
--device=/dev/dri:/dev/dri

You may have to switch the image to lscr.io/linuxserver/plex:latest

I kinda did that, by creating a stack in Portainer (which uses docker-compose anyway). I just hadn’t added the runtime and /dev/dri parts in the yaml file.

I’ll give it a try, though, and spin it up with those two added, and from a terminal.

Two additional questions, if I may:

  • Isn’t /dev/dri for Intel QuickSync and unrelated to Nvidia, Plex-configuration-wise?
  • Don’t I need exactly this (Plex pass) image, seeing that transcoding is a Plex pass feature?

Thanks for your responses and help so far, by the way, I really appreciate it.

For your second question, the linuxserver Plex image is 99% interchangeable with Plex’s official image (only thing that changes are environment variables primarily for user/group file access) and transcoding will work on either. I personally have always used linuxserver’s image.

I don’t use /dev/dri mounting for NVIDIA GPUs (I do for Intel), but I have this in my docker-compose.yml:

        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [compute,utility]

I also have runtime: nvidia like @pl_5309 suggested

Plex Pass features are activated by your login not the image file, unless you like to beta test new releases complete with crash inducing bugs the Plex Pass should be avoided.

/dev/dri isn’t just for Intel, it may work without it for Nvidia but Plex does change things without giving details.

For me, another problem is that there are several guides / how-to’s out there that say different things - this is only the second time that I see the suggestion to add the GPU with this notation.

Is this in any way different from using runtime: nvidia and, if so, how? I know how to add all GPUs or a specific GPU by ID in other notations, but how would you do that in this notation?

I’ll try later (after work) with this (corrections / suggestions are welcome):

version: '2'
services:
	plex:
		runtime: nvidia
		devices:
			- /dev/dri:/dev/dri
		container_name: plex
		image: lscr.io/linuxserver/plex:latest
		restart: unless-stopped
		environment:
			- TZ=Europe/Brussels
			- PUID=1000
			- PGID=1001
			- ADVERTISE_IP=http://192.168.1.9:32400/
			- VERSION=docker
			- PLEX_CLAIM=claim-[MyToken]
			- NVIDIA_VISIBLE_DEVICES=all
			- NVIDIA_DRIVER_CAPABILITIES=compute,utility
		network_mode: host
		volumes:
			- /my/path/plexdata:/config
			- /my/path/Transcode_Temp:/transcode
			- /my/path/data:/data

No luck: I get an error due to runtime: nvidia:

ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.plex: 'runtime'

I can spin it up without the runtime and device, and add those later in Portainer.
Doing so still results in software transcoding (it’s transcoding, but without the (hw) there).

Now, too, running nividia-smi inside the container shows my GPU just fine.

Runtime was added in v2.3: Compose file version 2 reference | Docker Docs
Maybe you have to specify “2.3” at the top of your file instead of “2”, but I’ve got no clue on this one - it works for me

By the way, I might be missing something context related because I’m unaware of what Portainer is.

Updated to version 3, no difference… :confused:

plex no hw trnscd

Ah, according to these docs, your GPU doesn’t support NVENC:

If this is not true, can you post a pic of your Console logs with the Error level filter when you play a video? It may show FFMpeg errors

:confused:

Thanks!

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