Skip to content

Commit 5ad9879

Browse files
author
Patrick M
committed
quick fix
1 parent aaba325 commit 5ad9879

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

src/data/blog/2026/plex-lxc-hardware-transcoding.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ Every device is different, and the numbers matter. So I start by first enumerati
2222
ls -la /dev/dri
2323
```
2424

25-
/dev/dri stands for Direct Rendering Infrastructure. It's a directory in Linux that contains device files used for direct GPU access.
25+
The DRI in `/dev/dri` stands for Direct Rendering Infrastructure. It's a directory in Linux that contains device files used for direct GPU access.
2626

27-
Typically you'll find `/dev/dri/card0`, `card1`, etc. These respresent the GPU(s) you have installed in the maching.
27+
Typically you'll find `/dev/dri/card0`, `card1`, etc. These respresent the GPU(s) installed in the machine.
2828

29-
Alongside them, you'll have render nodes. `/dev/dri/renderD128`, `renderD129` These are also important for transcoding. They allow unprivileged GPU access for compute and rendering tasks (3D rendering, video encoding/decoding, GPU-accelerated computing) without requiring display out. Applications like Vulkan, OpenGL, VA-API, and CUDA can use these.
30-
31-
You'll note in my machine, there is no `card0`, but there is a `card1` even though I only have 1 GPU installed. Also note the numbers following both the card and render node, `226:1` and `226:128`. These are the device driver major and minor numbers, identify what driver to use.
29+
Alongside them are the render nodes. `/dev/dri/renderD128`, `renderD129` These are also important for transcoding. They allow unprivileged GPU access for compute and rendering tasks (3D rendering, video encoding/decoding, GPU-accelerated computing) without requiring display out. Applications like Vulkan, OpenGL, VA-API, and CUDA can use these.
3230

3331
```bash
3432
drwxr-xr-x 3 root root 100 Mar 16 15:04 .
@@ -38,12 +36,14 @@ crw-rw---- 1 root video 226, 1 Mar 16 15:05 card1
3836
crw-rw---- 1 root render 226, 128 Mar 16 15:04 renderD128
3937
```
4038

39+
You'll note on my machine, there is no `card0`, but there is a `card1` even though I only have 1 GPU. Also note the numbers following both the card and render node, `226:1` and `226:128`. These are the device driver major and minor numbers, identify what driver to use.
40+
4141
> [!NOTE]
4242
> In proxmox, usually the user running PVE is root, so there shouldn't be a permissions issue.
4343
4444
## Granting access to the LXC
4545

46-
Stop your LXC in the GUI and then edit the configuration. For this example I'm going to use LXC ID 100.
46+
Stop your LXC in the GUI and then edit the configuration from the CLI. For this example I'm going to use LXC ID 100.
4747

4848
```bash
4949
cd /etc/pve/lxc
@@ -94,21 +94,19 @@ Breaking it down by token:
9494

9595
So the full line is telling the cgroup to allow the LXC container to read, write, and create the character device with major:minor 226:128, which is my renderD128 render node.
9696

97-
Under the cgroup lines are the device permissions.
98-
99-
### dev
97+
### Device Permissions
10098

101-
Here I've added the paths to the hardware on the host. You'll notice them from before, `/dev/dri/card1` and `/dev/dri/renderD128`.
99+
Next, under cgroup, I've added the paths to the hardware on the host. You'll notice they match from before: `/dev/dri/card1` and `/dev/dri/renderD128`.
102100

103101
Breaking it down by token:
104102

105103
- `dev0` - the Proxmox config key, just an index for the device passthrough entry. dev0, dev1, dev2 etc. if you have multiple devices.
106104
- `/dev/dri/card1` - the path on the host to the device being passed through. Proxmox will bind-mount this into the container.
107105
- `gid=44` - the group ID that will own the device node inside the container. This is what makes it accessible to the video group (GID 44) inside the LXC, so the plex user can actually use it.
108106

109-
One important thing to understand is the gid here is applied to the device node as seen from **_inside_** the container. That's why it needs to match the GID of the video/render group inside the LXC specifically, not necessarily the host's GID. Often they are the same, though sometimes they are not, which was my problem.
107+
One important thing to understand is the GID here is applied to the device node as seen from **_inside_** the container. That's why it needs to match the GID of the video/render group inside the LXC specifically, not necessarily the host's GID. Often they are the same, though sometimes they are not, _which was my problem_.
110108

111-
You'll need to start the LXC and then run the following command to find the correct GID.
109+
Once all that is configured and saved. I can start the LXC and run the following command inside the container to find the correct GID.
112110

113111
```bash
114112
getent group video render
@@ -117,12 +115,11 @@ getent group video render
117115
For my container, I got back the following.
118116

119117
```bash
120-
plex:~$ getent group video render
121118
video:x:44:plex
122119
render:x:105:plex
123120
```
124121

125-
This is where the GIDs in my configuration are derived, `44` and `105` respectively.
122+
This is where the GIDs in my configuration are derived, `44` and `105` respectively. If they don't match, shut down the container and go back to the host lxc configuration and update them.
126123

127124
> [!IMPORTANT]
128125
> the device GID refers to the device node as seen from **_inside_** the container.

0 commit comments

Comments
 (0)