Skip to content

Instantly share code, notes, and snippets.

@xaliander
Last active December 11, 2023 06:54
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save xaliander/8173ffe623546529c99e9cdd7e0655c4 to your computer and use it in GitHub Desktop.
Save xaliander/8173ffe623546529c99e9cdd7e0655c4 to your computer and use it in GitHub Desktop.
ERR_NVGPUCTRPERM: Permission issue with Performance Counters

Error

ERR_NVGPUCTRPERM: Permission issue with Performance Counters

Solutions for this issue

NVIDIA has a page that addresses the issue. Unfortunately, the instructions didn't solve the problem for me. However, I found a solution from rameshgunjal in the NVIDIA forums.

Option 1: Running the program as admin

You might have noticed that sudo nv-nsight-cu results in an error. Instead, you have to provide the path: sudo /usr/local/cuda/bin/nv-nsight-cu. The same applies for other applications as well: sudo /usr/local/cuda/bin/nsight-sys.

Option 2: Enable access for all users

You might be thinking: There must be a reason why NVIDIA restricted access to admins only - and there is. In the Description it is stated, that the security flaw is 'not a network or remote attack vector'. Further, NVIDIA has released updated drivers to address this issue in February 2019. So I don't think there is much to worry about.

If you temporarily want to enable access for all users you can call:

modprobe nvidia NVreg_RestrictProfilingToAdminUsers=0

For persistence across reboots:

  1. Create a .conf file with a file name of your choice in the /etc/modprobe.d/ directory
  2. Write options nvidia "NVreg_RestrictProfilingToAdminUsers=0" into it
  3. Restart your computer

Steps 1 and 2 can be performed with the following command:

(echo 'options nvidia "NVreg_RestrictProfilingToAdminUsers=0"') | sudo tee -a /etc/modprobe.d/RestrictedProfiling.conf >/dev/null

You can check if everything worked by calling the following command:

cat /proc/driver/nvidia/params | grep RmProfilingAdminOnly

It should return RmProfilingAdminOnly: 0.

@vincuemor
Copy link

in case you are running windows?

@xaliander
Copy link
Author

Hi @vincuemor,
the above description is for Ubuntu 20.04. If you find a way to solve this in Windows I'll be happy to add your solution here.
Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment