Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable nvidia-smi permissions to be run by all users

Tags:

gpu

How can I enable nvidia-smi for all users. I can run it as a sudo user, but as a regular user, I get:

Failed to initialize NVML: Insufficient Permissions
like image 530
Elena Avatar asked Sep 25 '18 23:09

Elena


People also ask

What is SMI in nvidia-SMI?

The NVIDIA System Management Interface (nvidia-smi) is a command line utility, based on top of the NVIDIA Management Library (NVML), intended to aid in the management and monitoring of NVIDIA GPU devices.

Why is nvidia-SMI not working?

NVIDIA-SMI has failed because it couldn't communicate with the Nvidia driver. Make sure that the latest NVIDIA driver is installed and running.

How do I run nvidia-SMI?

Accessing nvidia-smi to review GPU Usage Change the directory location to the folder where nvidia-smi is located. Type cd C:\Program Files\NVIDIA Corporation\NVSMI into the DOS window and press enter. Type nvidia-smi -l 10 in the DOS window and press enter. This will instruct nvidia-smi to refresh every 10 seconds.

What does nvidia-SMI command do?

DESCRIPTION nvidia-smi (also NVSMI) provides monitoring and management capabilities for each of NVIDIA's Tesla, Quadro, GRID and GeForce devices from Fermi and higher architecture families.


1 Answers

I had the problem and here was my solution. Maybe it is helpful to you.

By ll /dev/nvidia* you can find that the devices belong to root and vglusers group.

If you are the same to me, now you should add your user account into the vglusers group.

by usermod -a -G vglusers username (require sudo)

or editing /etc/group and add your username at the end of the line vglusers:x:****:user1,user2,...

Then logout the bash and re-enter.

Notes:

  • The group name may be video rather than vglusers; you'll see which name is used when you ll /dev/nvidia*.
  • If you are using vncserver, you have to kill the server and restart it because you did not have the permission when you started the vncserver.
like image 127
Zealseeker Avatar answered Nov 15 '22 11:11

Zealseeker