Not able to profile using nvprof

Hi, I am not able to use nvprof for profiling Cuda code on GPU. Getting below error while using nvprof.

==3904== Warning: 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/NVSOLN1000
==3904== Profiling application: ./a.out
==3904== Profiling result:
No kernels were profiled.
No API activities were profiled.
==3904== Warning: Some profiling data are not recorded. Make sure cudaProfilerStop() or cuProfilerStop() is called before application exit to flush profile data.

You might want to click on that link and read the instructions.

Hi @Robert_Crovella ,
I followed the steps given in the link. While running the below command I am getting error message.
modprobe nvidia NVreg_RestrictProfilingToAdminUsers=0
error:
modprobe: FATAL: Module nvidia not found in directory /lib/modules/4.15.0-121-generic

Can you please help to resolve this error

Use the method given in footnote 2.

Alternatively, A file containing ‘options nvidia “NVreg_RestrictProfilingToAdminUsers=0”’ may be saved to /etc/modprobe.d

so create/save that file

then reboot

To be clear that file should contain one line that looks like this:

options nvidia "NVreg_RestrictProfilingToAdminUsers=0"

I created a file /etc/modprobe.d/profile.conf, added the mentioned line into that file and restarted my system. Still getting same error.

I am having Ubuntu 20.04 OS installed, CUDA driver version is 440.100, CUDA version is 10.1

I’m not sure what that means. Anyway, if you are still having trouble, you may need to follow the instructions given in footnote 7. To some degree this is a function of the source of your GPU driver install, so instructions or applicability may vary here.