Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nvidia-smi Failed to initialize NVML: GPU access blocked by the operating system

Tags:

cuda

gpu

nvidia

when asking for

nvidia-smi

it gives this error:

Failed to initialize NVML: GPU access blocked by the operating system

other information:

$ nvcc --verion

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Mon_Feb_16_22:59:02_CST_2015
Cuda compilation tools, release 7.0, V7.0.27

and also:

 $ lspci | grep -i nvidia

 01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 425M] (rev a1)
 01:00.1 Audio device: NVIDIA Corporation GF108 High Definition Audio Controller (rev a1)

Having searched a lot in the internet I couldn't find a way to solve this problem. when I use ipython notebook and want to run Caffe framework it gives this error:

Check failed: error == cudaSuccess (38 vs. 0)  no CUDA-capable device is detected
like image 422
Majid Azimi Avatar asked Nov 20 '15 19:11

Majid Azimi


3 Answers

I noticed that after CUDA installation restarting Ubuntu works, and now I see the GPU details output by nvidia-smi

like image 195
Majid Azimi Avatar answered Jan 03 '23 05:01

Majid Azimi


If you believe that both CUDA and graphics driver are installed correctly, but you still cannot make your GPU to be detected, the problem might be in that you are using mobile Nvidia graphics on Optimus-enabled laptop on Linux.

You could either:

  • change your application to properly detect GPUs behind Optimus. See documentation here
  • or to run your application via Bumblebee (and primus)
like image 33
Ivan Aksamentov - Drop Avatar answered Jan 03 '23 05:01

Ivan Aksamentov - Drop


WSL user here. Running nvidia-smi on either Windows and WSL failed. Reinstalling the Nvidia for WSL driver, on the Windows side, fixed the problem. The problem was created when installing CUDA Toolkit and CUDNN broke the Nvidia for WSL driver.

like image 45
BSalita Avatar answered Jan 03 '23 03:01

BSalita