I have a box with multiple GPUs running ubuntu 16.04. The box is going to have multiple users running different experiments and I need to restrict access to the GPUs so that only certain users have access to certain GPUs. As suggested on Restrict user access to GPU I've tried changing the group and permission of the /dev/nvidia*
files however, when a new session is opened they revert back to their original settings. I've also created /etc/modprode.d/nvidia.conf
which contains options nvidia NVreg_DeviceFileGID=120
but this doesn't work either. Am I placing nvidia.conf
in the wrong place or is the syntax wrong? Any other suggestions would be greatly appreciated!
Update:
As @TadejP suggested I have edited etc/rc.local
to include:
chmod 666 /dev/nvidia5
chgrp nvidia_5 /dev/nvidia5
/bin/usr/nvidia-persistenced --persistence-mode --user <USERNAME> --verbose
However, this doesn't work. As soon as I start nvidia-smi
the device files revert to their previous state.