Apps can only detect CUDA device when run with root permissions

When I run the CUDA samples as a normal user, the apps start, then I get errors related to detecting the cuda device. For example, the deviceQuery sample returns:
cudaGetDeviceCount returned 38
-> no CUDA-capable device is detected
Result = FAIL
However, when I run with root privileges (sudo <.pathtosamples>/bin/aarch64/linux/release/deviceQuery), it works just fine as expected.

Background: I have a Jetson AGX Xavier and a 3rd party carrier board. I installed CUDA using JetPack 4.1.1 (as requested by the carrier board vendor). This install process deployed cuda-repo-l4t-10-0-local-10.0.117_1.0-1_arm64.deb onto the system.

Why would I need root to detect the CUDA device? This is obviously not the case with the official dev boards. The board vendor suggests this is an Nvidia issue, so I’m asking here. What can I do to make the cuda device accessible for “normal” processes (not root)?

I looked at the permissions of /dev entries: The result of ls -lah /dev | grep -Ei ‘nvidia’:
crw-rw-rw- 1 root root 195, 255 Jun 10 12:42 nvidiactl

This issue is very problematic for utility of the software I’m deploying, so any tips or guidance is much appreciated.

UPDATE: when I run as the ‘ubuntu’ or ‘nvidia’ user, it works fine. When I run as an added user, the samples fail unless I run as root. What would cause one user to fail and the others to succeed?

Hi,

Sorry for the late update.

You will need to enable the GPU access for an added user.
For more detail, please check this topic:

Thanks.

FYI, you wouldn’t need root to “detect” the GPU (and the usual PCI bus tools for GPU detect do not even exist on the Jetson). You would need permission to talk to the GPU. Is your regular user a member of group “video”? If not, add this (I am assuming user name is “ubuntu”, but adjust for your case):
sudo usermod -a -G video ubuntu

1 Like