Error 38 when using cudaGetDeviceCount, nvml at fault?

I get error 38 “no CUDA-capable device is detected” using cudaGetDeviceCount if running my code as plain user. The same code run as root works fine. This happens with Tesla K80 and GTX660 on two different machines. Other info: openSuSe42.3, PGI 18.4, cuda 9.1 and Nvidia driver 396.44 from repository https://developer.download.nvidia.com/compute/cuda/repos/opensuse423/x86_64/, installed via Yast . Both installations are fresh.

Additional observation: nvidia-smi only works with root privileges. Running as plain user results in “Failed to initialize NVML: Insufficient Permissions”.

After massive internet searches, it looks as all device queries go via the nvml library, which ALWAYS requires root privileges. Not sure, though.

All suggestions will be appreciated.

Hi Plimak,

Can you verify that /dev/nvidia* is set the 666?

See:
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#runfile-verifications

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#running-binaries