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

**URL:** <https://forums.developer.nvidia.com/t/solved-cuda-error-no-cuda-capable-device-was-found/74313>\
**Category:** CUDA Setup and Installation\
**Created:** [May 7, 2019, 12:59pm UTC](https://forums.developer.nvidia.com/t/solved-cuda-error-no-cuda-capable-device-was-found/74313 "2019-05-07T12:59:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hauret.tsi](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hauret.tsi](https://forums.developer.nvidia.com/u/hauret.tsi)\
**Post date:** [May 7, 2019, 12:59pm UTC](https://forums.developer.nvidia.com/t/solved-cuda-error-no-cuda-capable-device-was-found/74313/1 "2019-05-07T12:59:11Z")

</div>

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/](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 :

```auto
// 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

```auto
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 :

```auto
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](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:

```auto
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](https://drive.google.com/open?id=1Qsg7EtDMuyOr39L51ZfDQReGaaE_O3As)

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

```auto
[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.

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [May 8, 2019, 12:24am UTC](https://forums.developer.nvidia.com/t/solved-cuda-error-no-cuda-capable-device-was-found/74313/2 "2019-05-08T00:24:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hauret.tsi](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hauret.tsi](https://forums.developer.nvidia.com/u/hauret.tsi)\
**Post date:** [May 8, 2019, 12:08pm UTC](https://forums.developer.nvidia.com/t/solved-cuda-error-no-cuda-capable-device-was-found/74313/3 "2019-05-08T12:08:25Z")

</div>

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

I did it by following these instructions : [UEFI/SecureBoot/DKMS - Ubuntu Wiki](https://wiki.ubuntu.com/UEFI/SecureBoot/DKMS)

And nvidia-smi returns :

```auto
+-----------------------------------------------------------------------------+
| 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 !

---

<div class="post-metadata">

**Author:** ![ssaishriram](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ssaishriram](https://forums.developer.nvidia.com/u/ssaishriram)\
**Post date:** [October 17, 2020, 6:38am UTC](https://forums.developer.nvidia.com/t/solved-cuda-error-no-cuda-capable-device-was-found/74313/4 "2020-10-17T06:38:17Z")

</div>

Worked!  
Thanks for the solution!

---

<div class="post-metadata">

**Author:** ![firewarden981](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@firewarden981](https://forums.developer.nvidia.com/u/firewarden981)\
**Post date:** [January 21, 2021, 3:34pm UTC](https://forums.developer.nvidia.com/t/solved-cuda-error-no-cuda-capable-device-was-found/74313/5 "2021-01-21T15:34:32Z")

</div>

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

 ![IMG_20210121_183033](https://global.discourse-cdn.com/nvidia/original/3X/f/3/f31d6fae26637f61ba8630cc88c536b56c1379e9.jpeg)
