does not have permission to access NVIDIA GPU Performance Counters on the target device._**```
For details, see [here](https://developer.nvidia.com/nvidia-development-tools-solutions-ERR_NVGPUCTRPERM-permission-issue-performance-counters).
_Permanent solution_
Follow the steps [here]([https://developer.nvidia.com/nvidia-development-tools-solutions-ERR_NVGPUCTRPERM-permission-issue-performance-counters](https://developer.nvidia.com/nvidia-development-tools-solutions-ERR_NVGPUCTRPERM-permission-issue-performance-counters)). The current steps for Linux are:
```
sudo systemctl isolate multi-user
sudo modprobe -r nvidia_uvm nvidia_drm nvidia_modeset nvidia-vgpu-vfio nvidia
sudo modprobe nvidia NVreg_RestrictProfilingToAdminUsers=0
sudo systemctl isolate graphical
```
The above steps should result in a permanent change.
_Temporary solution_
When running on bare metal, you can run nvprof with `sudo`.
If you're running in a Docker image, you can temporarily elevate your privileges with one of the following (oldest to newest syntax):
nvidia-docker run --privileged
docker run --runtime nvidia --privileged
docker run --gpus all --privileged