1

I installed CUDA 6.0 tookit on a Windows 8.1 machine and tried to run the deviceQuery CUDA sample. However, it returned the following error for Win32 and Win64 versions.

deviceQuery.exe Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 30
-> unknown error
Result = FAIL

I installed different versions of the drivers and tried to compile the sample code from Visual Studio but the result of the execution was same.

How can I solve this problem? Any suggestion is really welcome.

defvol
  • 14,392
  • 2
  • 22
  • 32
erogol
  • 13,156
  • 33
  • 101
  • 155

5 Answers5

6

Don't forget to restart your computer.

I was getting the same error (cudaGetDeviceCount 30) running samples from CUDA 8.0 on Ubuntu 14. Everything was up-to-date: Nvidia driver (375), chipset GeForce GT 730M (capacity 3). Restarting xserver made it work :)

defvol
  • 14,392
  • 2
  • 22
  • 32
1

As mentioned by Robert Crovella in his comment, tipically this error is caused by a driver being older than the CUDA toolkit. Said differently, only drivers of the same or later version numbers will work well with the CUDA toolkit. Accordingly, this error should go away with a latest driver installation.

I recently set up a machine with a GTX 980 and a new installation of CUDA 7.5. Having this error, I downloaded and installed the latest driver for the GTX 980 from the NVIDIA website and the error disappeared.

Vitality
  • 20,705
  • 4
  • 108
  • 146
1

I had the same result when running deviceQuery. I have GTX 745 in a Windows 7 box with the driver specified by Nvidia (378.66) and CUDA 8.0. What cured it was following the suggestion by Nicolas - removed the VGA adapter and plugged the monitor into the card. This may seem obvious, but since I am going to be using the card for processing rather than display it didn't seem necessary.

jgregor
  • 11
  • 2
-1

This is silly but true. CUDA 6.0 does not work with its default driver included in the installation file. I updates the driver to 332 to 340 and everything works just fine right now.

erogol
  • 13,156
  • 33
  • 101
  • 155
  • 3
    CUDA 6 works just fine with its default driver. What's more likely is that the driver included with CUDA 6 (331.xx) does not work with the GPU in your machine (which you haven't told us about) because it was released after the driver created for CUDA 6. Once you updated the driver to a version that works with your GPU, then everything started working. – Robert Crovella Sep 10 '14 at 12:37
  • Nope - erogol is right. I just installed the latest cuda 10 on my windows 10 pc. As my version of display driver was more current, I had to downgrade before the cuda install actually worked. After that - got same error as mentioned in this thread. So after that I updated display driver to latest again - only then did things start working. So at least in some cases - Cuda install and drivers definitely do not work out of the box. And I've had hours of uninstalling and refreshing everything down to bare bones. – djchapm Dec 08 '18 at 23:35
-1

I got this error in Windows 10 with CUDA 7.5 and an up-to-date driver because my screen was plugged on my motherboard board rather than my graphical card. Check in Windows' Device Manager if there is any VGA adapter in the display adapters; there should be none.

ndou
  • 1,048
  • 10
  • 15