2014年9月25日木曜日

Changing the permission of /dev/nvidia* on Gentoo Linux

To use CUDA on Gentoo, just emerge nvvidia-cuda-sdk is sufficient.
After installing the driver and sdk, /dev/nvidia* will be found.

These device files has 660 permission and belong to video group.
So if users are a member of video group, no problem.

If you want to use the device file from other groups, you have to change the permission.
Here is what I did.


1) edit /etc/modprobe.d/nvidia.conf
  change the line starts with "options nvidia NVreg_DeviceFileMode=", from NVreg_DeviceFileMode=432 to NVreg_DeviceFileMode=0666

2) chmod +x /opt/bin/nvidia-modprobe

3) reboot

Then you will find /dev/nvidia* have permissioin 666.