[Solved] CUDA error : No CUDA capable device was found

Hi,

I decided to install CUDA for computer vision projects.

Once installed, I tried to run the c++ code exemple on this page :https://devblogs.nvidia.com/even-easier-introduction-cuda/ unfortunately I got a core dumped error by running it. By using cuda-gdb I found out this error comes from this for loop :

// initialize x and y arrays on the host
  for (int i = 0; i < N; i++) {
    x[i] = 1.0f;
    y[i] = 2.0f;
  }

and returns

fatal:  No CUDA capable device was found. (error code = CUDBG_ERROR_NO_DEVICE_AVAILABLE(0x27)

Also tried to run a simple “Hello World” code, but it didn’t print anything.

Now here are the details about my setup and how I installed CUDA:

I use ubuntu 18.04 LTS with an Asus S56C laptop
I have a GEFORCE 740M GPU
nvcc --version returns :

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Fri_Feb__8_19:08:17_PST_2019
Cuda compilation tools, release 10.1, V10.1.105

I have the NVIDIA 418 driver

I installed CUDA via the runfile (None of the others worked for me), the installation got completed with a few errors, and then I installed nvcc with apt-get. After trying to run the code, I uninstalled and reinstalled everything by following the installation guide.
I found out in the 4.5 section (https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#runfile-verifications) that the /dev/nvidia* files do not exist, and the given script returns this:

modprobe: ERROR: could not insert 'nvidia': Operation not permitted

even when I run it as a superuser. I have no problem with the post-installation actions though.

I posted the log files here : https://drive.google.com/open?id=1Qsg7EtDMuyOr39L51ZfDQReGaaE_O3As

Edit : Here are the errors in my cuda-installer.log anyway:

[INFO]: ERROR: The kernel module failed to load. Secure boot is enabled on this

[INFO]:        system, so this is likely because it was not signed by a key that is

[INFO]:        trusted by the kernel. Please try installing the driver again, and

[INFO]:        sign the kernel module when prompted to do so.

[INFO]: 

[INFO]: 

[INFO]: ERROR: Unable to load the kernel module 'nvidia.ko'.  This happens most

[INFO]:        frequently when this kernel module was built against the wrong or

[INFO]:        improperly configured kernel sources, with a version of gcc that

[INFO]:        differs from the one used to build the target kernel, or if another

[INFO]:        driver, such as nouveau, is present and prevents the NVIDIA kernel

[INFO]:        module from obtaining ownership of the NVIDIA GPU(s), or no NVIDIA

[INFO]:        GPU installed in this system is supported by this NVIDIA Linux

[INFO]:        graphics driver release.

[INFO]:        

[INFO]:        Please see the log entries 'Kernel module load error' and 'Kernel

[INFO]:        messages' at the end of the file '/var/log/nvidia-installer.log' for

[INFO]:        more information.

[INFO]: 

[INFO]: 

[INFO]: ERROR: Installation has failed.  Please see the file

[INFO]:        '/var/log/nvidia-installer.log' for details.  You may find

[INFO]:        suggestions on fixing installation problems in the README available

[INFO]:        on the Linux driver download page at www.nvidia.com.

Thanks in advance to those who will help me, tell me if you need any more detail.

You can turn off secure boot. Anyway you need to research that to discover the options and solutions, there are various writeups on this forum as well as around the web.

1 Like

All right it works fine now, thanks a lot !!

I did it by following these instructions : UEFI/SecureBoot/DKMS - Ubuntu Wiki

And nvidia-smi returns :

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.56       Driver Version: 418.56       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GT 740M     Off  | 00000000:01:00.0 N/A |                  N/A |
| N/A   55C    P8    N/A /  N/A |    137MiB /  2002MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0                    Not Supported                                       |
+-----------------------------------------------------------------------------+

(didn’t work before)

Thanks again Robert !

1 Like

Worked!
Thanks for the solution!

I was trying to train yolov3 with darknet but i came across with an error which says ‘no cuda capable device was found’ but the gpu is nvidia geforce gtx 1080. And i was sure that it was cuda capable. Then i tried this solution. But now ubuntu can’t boot. And it stuck in this screen