Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iddm/f18238ed22b37d43f9320b6601dc7ec5 to your computer and use it in GitHub Desktop.
Save iddm/f18238ed22b37d43f9320b6601dc7ec5 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.

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