ERR_NVGPUCTRPERM - The user does not have permission to profile on the target device.

On my Ubuntu 18.04 system CUDA Toolkit 10.1.168 installed with CUDA-driver 418.67. While I am trying to use nvprofile as a non-admin user I am getting the following error:

Cuda failure p2pBandwidthLatencyTest.cu:213: 'an illegal memory access was encountered'
==68236== Warning: ERR_NVGPUCTRPERM - The user does not have permission to profile on the target device. See the following link for instructions to enable permissions and get more information: https://developer.nvidia.com/ERR_NVGPUCTRPERM
==68236== Profiling application: ./p2pBandwidthLatencyTest
==68236== Profiling result:
No kernels were profiled.
No API activities were profiled.
==68236== Warning: Some profiling data are not recorded. Make sure cudaProfilerStop() or cuProfilerStop() is called before application exit to flush profile data.

I have noticed that there are few discussion on this. where folks suggest the following changes:

modprobe nvidia NVreg_RestrictProfilingToAdminUsers=0

But this does not help me.

Thanks.

[url]https://developer.nvidia.com/ERR_NVGPUCTRPERM[/url]

I have followed that but it does not help me.

Hi, I just meet the same problem, and I find a way to solve it. Launch nvprof with sudo

sudo nvprof ./fileName

It may cause following error:

sudo: nvprof: command not found

Address it as following:

sudo visudo

Now you open the file named “sudoers”, comment out the followings:
Defaults env_reset
Defaults mail_badpass
Defaults secure_path=“/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin”

Now you may can profile the program using command line

sudo nvprof ./fileName
1 Like