I’m trying to figure out how I can tell from my program if a CUDA capable graphics card is installed. That way I can branch and execute different code.
I was looking at the deviceQuery example project that comes with SDK 2.0 (which I’m using). It looks like this.
int
main( int argc, char** argv)
{
int deviceCount;
CUDA_SAFE_CALL(cudaGetDeviceCount(&deviceCount));
if (deviceCount == 0)
printf(“There is no device supporting CUDA\n”);
int dev;
for (dev = 0; dev < deviceCount; ++dev) {
…
If I build and run the Debug (not EmuDebug) version of this code on my laptop PC, which does not support CUDA, I expected that I would see
“There is no device supporting CUDA” but instead I get…
C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\bin\win32\Debug>deviceQuery.exe
Cuda error in file ‘deviceQuery.cu’ in line 53 : feature is not yet implemented.
It looks like the program dies before it can execute the “There is no device supporting CUDA” printf statement.
Am I missing something? How can I do this without killing the main program?
Thanks in advance,
Paul Jackson