exception at cudaSetDevice


I have just bought a new 9800GT board and trying CUDA for the first time. However, I encounter a problem. Even the simplest program I write receives run-time exception. For example, the following code:

[font=“Arial Black”]#include <cuda.h>
#include <cutil.h>
#include <stdio.h>

int main(int argc, char* argv)
CUT_DEVICE_INIT(argc, argv);
CUT_EXIT(argc, argv)
return 0;

generates the message:
[font=“Arial Black”]First-chance exception at 0x767a42eb in cudaLargeSum.exe: Microsoft C++ exception: cudaError_enum at memory location 0x0012fc50…
The program ‘[5156] cudaLargeSum.exe: Native’ has exited with code 0 (0x0).

Note that it does find the board and when I use the demos in the SDK they seem to be working nicely. Moreover, when I do memory transfer using my code to the board and back I get what I expected. However, I do not succeed to get my own kernel to work since I keep getting the same exception. Can someone help me out here?

My Setup:
OS: Vista 32bit SP1
CPU: Intel Core 2 6700 @ 2.66GHz
Memory: 2GB
GFX: Gigabyte 9600gt
CUDA version 2.0
CUDA SDK version 2.0 beta 2
Driver version:

Few details that I missed in my previous post:

  • CUT_DEVICE_INIT does find my board and recognize it correctly

  • the compiled examples in the SDK seem to be working correctly

  • when drilling down into CUT_DEVICE_INIT I have found that the exception is being thrown when the cudaSetDevice function is being called

any clue someone?