Mapping gpu for transcoding in unprivileged container.

Hammerhand

Member
Dec 6, 2021
20
0
6
44
Hello. I am trying to passthrough gpu from proxmox to a lxc to achieve hardware transcoding with jellyfin inside docker, but I am not able to do it.

I've edited my .conf file with the following entries:

Code:
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
lxc.cgroup.devices.allow: c 226:128 rwm
lxc.cgroup.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.hook.pre-start: sh -c "chown 101000:100105 /dev/dri/renderD128"
lxc.hook.pre-start: sh -c "chown 101000:100044 /dev/dri/card0"

and inside the container, I see folders inside /dev/dri belonging to my user and video and render group.

I've been trying to do it mapping them but I can't do it either:

Code:
lxc.idmap: u 0 100000 65535
lxc.idmap: g 0 100000 44
lxc.idmap: g 44 44 1
lxc.idmap: g 105 103 1
lxc.idmap: g 45 100045 58

My /etc/subgid is:


Code:
root:1000:1
root:100000:65536
root:44:1
root:103:1
root:101:1

And my /etc/subuid is:


Code:
root:1000:1
root:100000:65536


Even more, if I use the mapping method I completely lose the ability to access jellyfin inside docker.

The problem is that I am not even sure that I am mapping the right user: I am mapping my host user to a lxc user, but don't know if I should I map host root user to lxc root user, or neither them.

Pretty new to proxmox and been struggling for days with uid & gid sintax.[/CODE]
 
Last edited: