If I run ./deviceQuery without sudo:
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 30
-> unknown error
Result = FAIL
But running it with sudo (sudo ./deviceQuery) works, and after I run it once with sudo, subsequent runs of ./deviceQuery without sudo also results in pass.
My guess is that the first run with sudo initialises some files correctly which would otherwise cause it to fail. I am not sure how to debug this further, however.