Ubuntu 20.04.3 LTS
Have 1 Nvidia GPU
Installed Nvidia drivers and CUDA 11.2
UserA has "sudo" capability i.e. in group "sudo"
UserB is a normal user
UserC is in group "cuda_allow"
At terminal, I could run "nvidia-smi" properly for UserA, UserB and UserC.
File permission for /dev/nvidia0 is 666
At /dev/nvidia0, I changed the permission to 660 => sudo chmod 660 /dev/nvidia0
At /dev/nvidia0, I replaced "root" group to "cuda_allow" group => sudo chown :cuda_allow /dev/nvidia0
At terminal for UserA, run 'nvidia-smi' and an error is encountered. The error => No devices were found
At terminal for UserB, run 'nvidia-smi' and same error is encountered => No devices were found.
At terminal for UserC, run 'nvidia-smi' and it run properly i.e. A table of information was displayed.
Add UserA to group "cuda_allow" => sudo usermod -aG cuda_allow usera
Check to ensure kst is in group "cuda_allow" i.e. members cuda_allow => Confirmed userA is in group "cuda_allow"
Rerun "nvidia-smi" and error => No devices were found
Question
Added "UserA" which has "sudo" capability to group "cuda_allow" is not behaving the same as "UserC". "UserC" is in group "cuda_allow" and does not have "sudo" capability. Question is why by adding "UserA" to group "cuda_allow", I can't run 'nvidia-smi'?
I found out that at terminal for "UserA", I run "sudo nvidia-smi" successfully. Is it possible to run it without having the "sudo" in front of "nvidia-smi"?