1

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.

1 Answer 1

1

No other instruction worked for me also so we can put commands to do stuff after reboot. For instance to limiting only second card put commands in /etc/rc.local:

chmod 660 /dev/nvidia1
chgrp cuda /dev/nvidia1

Other users not in group cuda will not even see device with nvidia-smi. Further instructions to use /etc/rc.local:

1
  • I tried this and upon starting nvidia-smi the group reverts back to its original state. I also tried starting the nvidia-persistenced daemon after the above statements in /etc/rc.local however this didn't work either.
    – RHankins
    Nov 30, 2018 at 19:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .