Linux Configuration
GPU profiling on Linux requires specific permissions depending on your GPU vendor.
NVIDIA Configuration
To allow non-root users to profile GPU kernels using CUPTI, you must relax the NVIDIA driver security restrictions.
-
Create a configuration file:
sudo nano /etc/modprobe.d/nvidia-profiler.conf -
Add the following line:
options nvidia NVreg_RestrictProfilingToAdminUsers=0 -
Apply changes and reboot:
sudo update-initramfs -u
sudo reboot -
Verify:
cat /proc/driver/nvidia/params | grep RestrictProfilingToAdminUsersIt should output
RestrictProfilingToAdminUsers: 0.
AMD Configuration
AMD GPUs require access to the KFD (Kernel Fusion Driver) and ROCm SMI devices.
-
Add your user to the required groups:
sudo usermod -aG video $USER
sudo usermod -aG render $USER -
Log out and back in for group changes to take effect.
-
Verify ROCm SMI access:
rocm-smiYou should see GPU information (temperature, utilization, etc.) without
sudo. -
Verify HIP runtime:
hipInfoThis should list your AMD GPU devices.
If rocm-smi requires sudo, check that /dev/kfd and /dev/dri/renderD* have the correct group permissions. On most distributions, installing ROCm sets these up automatically.