persistent permissions on /dev/dri

So in my latest post regarding setting up your media server app (Pex/Emby/Jellyfin) so that it uses your iGPU utilizing QuickSync I mentioned that you needed to change permissions on /dev/dri so that your docker container can access it. In order to do that you do:

sudo chmod -R 777 /dev/dri

So, that works. But the problem with that is, when you restart your server the permissions are reset and you need to repeat the same command again.

What you can do to make the permission changes permanent is that, you can create a udev rule. That will ensure that the correct permissions are applied to the /dev/dri device at boot time. So here’s how:

First we create a udev rule file:

sudo vim /etc/udev/rules.d/99-dri.rules

Then we add the following content to the file:

SUBSYSTEM=="drm", MODE="0777"

This rule sets the permissions of any device under the drm subsystem (like /dev/dri) to 0777.

After saving the file, reload the udev rules:

sudo udevadm control --reload-rules

Reboot your system and your docker containers can access /dev/dri persistently after each reboot:

sudo reboot