The reason it works after running as root is root has the right to create a device node. Once it’s created, users can run programs-- but only because by default it’s owned by root, group root, world read/writable… seriously? I’m in Funtoo so I first added nvidia_uvm to /etc/conf.d/modules thus it’s always loaded but the node doesn’t get created. I also have a local script (/etc/local.d/nv_smi_pm.start) where I switch on persistent mode so I added these lines to it:
mknod -m 660 /dev/nvidia-uvm c 249 0
chgrp video /dev/nvidia-uvm
now everything works. I suppose you could write a proper udev rule but I’m not on that.
Update:
I just discovered nvidia-modprobe. If you run it as root:
nvidia-modprobe -c0 -u
it loads the module and creates the node just as it would be auto-created… the --help indicates it was meant to be setuid in order to work for everyone but package maintainers might have other ideas. Those default permissions are terribly DoS-happy.