Reputation: 13614
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.
Upvotes: 1
Views: 13367
Reputation: 15450
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 :)
Upvotes: 6
Reputation: 11
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.
Upvotes: 1
Reputation: 1178
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.
Upvotes: -1
Reputation: 21475
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.
Upvotes: 1
Reputation: 13614
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.
Upvotes: -1