I have a permissions problem. I am running Photoprism inside a Docker container on Ubuntu 22.04. I want to use Intel QuickSync hardware transcoding. To do this, the app needs to access the /dev/dri device. I am attempting to get the app running without using priviledged: true in the docker-compose file. It works (ie, the app is able to use /dev/dri) when using priviledged: true. When I remove priviledged: true, the app reports this, even though devices:\n - /dev/dri is in the docker-compose.yml file:
$ docker-compose up -d
...
⠿ Container photoprism-photoprism-1 Starting 1.9s
Error response from daemon: error gathering device information while adding custom device "/dev/dri": no such file or directory
Currently I have Plex installed natively (ie, not using Docker), and it works with /dev/dri just fine.
Here are the permissions on /dev/dri:
$ ls -al /dev/dri
total 0
drwxr-xr-x 3 root root 100 May 29 14:09 .
drwxr-xr-x 19 root root 5200 May 29 14:09 ..
drwxr-xr-x 2 root root 80 May 29 14:09 by-path
crw-rw----+ 1 root render 226, 0 May 29 14:09 card0
crw-rw----+ 1 root render 226, 128 May 29 14:09 renderD128
(render is a group name, but what is the meaning of 226, in the listing output?)
Here are the details of the plex user (which is the user which is running plexmediaserver, which is working with /dev/dri):
$ id plex
uid=998(plex) gid=998(plex) groups=998(plex),44(video),109(render)
...and the user which is running docker-compose up -d
$ id myuser
uid=1000(myuser) gid=1000(myuser) groups=1000(myuser),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),120(lpadmin),131(lxd),132(sambashare)
I thought that since the plex user is working fine with /dev/dri, maybe I could use the plex user with Photoprism as well. But I was unable to get it working:
# inside docker compose
user: "998:998"
The relevant parts of the docker-compose.yml file:
services:
photoprism:
image: photoprism/photoprism:latest
...
## Start as non-root user before initialization (supported: 0, 33, 50-99, 500-600, and 900-1200):
user: "998:998"
## Share hardware devices with FFmpeg and TensorFlow (optional):
devices:
- "/dev/dri:/dev/dri" # Intel QSV
...
TL;DR:
Works when I use docker privileged mode, doesn't work otherwise. Also, I could use some help understanding ls output which mysteriously includes an unexplained 226, in it (See above ls output).
226in the output oflsis the Direct Rendering Manger render node number for Direct Rendering Infrastructure, see kernel admin-guide devices