# Hardware transcoding

**URL:** <https://forums.plex.tv/t/hardware-transcoding/824767>\
**Category:** Plex Media Server\
**Tags:** server-docker\
**Created:** [December 30, 2022, 1:42pm UTC](https://forums.plex.tv/t/hardware-transcoding/824767 "2022-12-30T13:42:18Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![JTMWi](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@JTMWi](https://forums.plex.tv/u/JTMWi)\
**Post date:** [December 30, 2022, 1:42pm UTC](https://forums.plex.tv/t/hardware-transcoding/824767/1 "2022-12-30T13:42:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pl\_5309](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@pl\_5309](https://forums.plex.tv/u/pl_5309)\
**Post date:** [December 30, 2022, 5:41pm UTC](https://forums.plex.tv/t/hardware-transcoding/824767/2 "2022-12-30T17:41:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JTMWi](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@JTMWi](https://forums.plex.tv/u/JTMWi)\
**Post date:** [January 2, 2023, 8:40am UTC](https://forums.plex.tv/t/hardware-transcoding/824767/3 "2023-01-02T08:40:57Z")

</div>

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

```auto
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…

---

<div class="post-metadata">

**Author:** ![pl\_5309](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@pl\_5309](https://forums.plex.tv/u/pl_5309)\
**Post date:** [January 2, 2023, 4:45pm UTC](https://forums.plex.tv/t/hardware-transcoding/824767/4 "2023-01-02T16:45:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JTMWi](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@JTMWi](https://forums.plex.tv/u/JTMWi)\
**Post date:** [January 3, 2023, 8:27am UTC](https://forums.plex.tv/t/hardware-transcoding/824767/5 "2023-01-03T08:27:48Z")

</div>

```auto
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.

---

<div class="post-metadata">

**Author:** ![pl\_5309](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@pl\_5309](https://forums.plex.tv/u/pl_5309)\
**Post date:** [January 3, 2023, 9:48am UTC](https://forums.plex.tv/t/hardware-transcoding/824767/6 "2023-01-03T09:48:02Z")

</div>

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:

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

```

You may have to switch the image to [lscr.io/linuxserver/plex:latest](http://lscr.io/linuxserver/plex:latest)

---

<div class="post-metadata">

**Author:** ![JTMWi](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@JTMWi](https://forums.plex.tv/u/JTMWi)\
**Post date:** [January 3, 2023, 10:14am UTC](https://forums.plex.tv/t/hardware-transcoding/824767/7 "2023-01-03T10:14:13Z")

</div>

> [@pl\_5309](#):
>
> It is usually easier to get this going from a compose.yml file and then monitor/maintain with portainer.

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.

---

<div class="post-metadata">

**Author:** ![KingFaris10](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/kingfaris10/32/278342_2.png) [@KingFaris10](https://forums.plex.tv/u/KingFaris10)\
**Post date:** [January 3, 2023, 10:46am UTC](https://forums.plex.tv/t/hardware-transcoding/824767/8 "2023-01-03T10:46:18Z")

</div>

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:

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

```

I also have `runtime: nvidia` like @pl_5309 suggested

---

<div class="post-metadata">

**Author:** ![pl\_5309](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@pl\_5309](https://forums.plex.tv/u/pl_5309)\
**Post date:** [January 3, 2023, 12:48pm UTC](https://forums.plex.tv/t/hardware-transcoding/824767/9 "2023-01-03T12:48:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JTMWi](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@JTMWi](https://forums.plex.tv/u/JTMWi)\
**Post date:** [January 3, 2023, 1:30pm UTC](https://forums.plex.tv/t/hardware-transcoding/824767/10 "2023-01-03T13:30:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![JTMWi](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@JTMWi](https://forums.plex.tv/u/JTMWi)\
**Post date:** [January 3, 2023, 1:32pm UTC](https://forums.plex.tv/t/hardware-transcoding/824767/11 "2023-01-03T13:32:54Z")

</div>

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

```auto
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

```

---

<div class="post-metadata">

**Author:** ![JTMWi](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@JTMWi](https://forums.plex.tv/u/JTMWi)\
**Post date:** [January 3, 2023, 1:48pm UTC](https://forums.plex.tv/t/hardware-transcoding/824767/12 "2023-01-03T13:48:26Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![KingFaris10](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/kingfaris10/32/278342_2.png) [@KingFaris10](https://forums.plex.tv/u/KingFaris10)\
**Post date:** [January 3, 2023, 3:01pm UTC](https://forums.plex.tv/t/hardware-transcoding/824767/14 "2023-01-03T15:01:45Z")

</div>

> [@JTMWi](#):
>
> `Unsupported config option`

Runtime was added in v2.3: [Compose file version 2 reference | Docker Docs](https://docs.docker.com/compose/compose-file/compose-file-v2/#runtime)  
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.

---

<div class="post-metadata">

**Author:** ![JTMWi](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@JTMWi](https://forums.plex.tv/u/JTMWi)\
**Post date:** [January 3, 2023, 4:06pm UTC](https://forums.plex.tv/t/hardware-transcoding/824767/15 "2023-01-03T16:06:22Z")

</div>

Updated to version 3, no difference… 😕

![plex no hw trnscd](https://global.discourse-cdn.com/plex/original/4X/e/3/b/e3b60a0a3a63ba10e2aac01b0675c8883eddb485.png)

---

<div class="post-metadata">

**Author:** ![KingFaris10](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/kingfaris10/32/278342_2.png) [@KingFaris10](https://forums.plex.tv/u/KingFaris10)\
**Post date:** [January 3, 2023, 5:01pm UTC](https://forums.plex.tv/t/hardware-transcoding/824767/17 "2023-01-03T17:01:52Z")

</div>

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

> **[Video Encode and Decode GPU Support Matrix](https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new#quadro)**
>
> Find the related video encoding and decoding support for all NVIDIA GPU products.

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

---

<div class="post-metadata">

**Author:** ![JTMWi](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@JTMWi](https://forums.plex.tv/u/JTMWi)\
**Post date:** [January 4, 2023, 7:49am UTC](https://forums.plex.tv/t/hardware-transcoding/824767/18 "2023-01-04T07:49:24Z")

</div>

😕

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [April 4, 2023, 7:49am UTC](https://forums.plex.tv/t/hardware-transcoding/824767/19 "2023-04-04T07:49:34Z")

</div>

Closed on April 4, 2023, 7:49am UTC

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