Exception on first CUDA call/Kernel fails to run SDK and Memcpy work though....

Hi gang,

I’m about at my wits’ end… I’m trying to get a basic kernel, embedded in a shared library for a much larger project, to execute, but the kernel always fails. First of all, the SDK projects all seem to work, plus the sample project created by the VS2005 project wizard compiles and runs fine. Second, all the memcopy functions seem to work, and what I send to the device seems to come back.

But, the first invocation of a CUDA call generates the following errors:

First-chance exception at 0x7c812aeb in my.exe: Microsoft C++ exception: cudaError_enum at memory location 0x0012f594…
First-chance exception at 0x7c812aeb in my.exe: Microsoft C++ exception: cudaError_enum at memory location 0x0012f594…

Doesn’t matter what the call is. I’ve used cudaGetDeviceCount, cudaMalloc, CUT_CHECK_ERROR, etc., and the errors are the same on the first call. Furthermore, any kernel I try to run fails like this:

First-chance exception at 0x7c812aeb in my.exe: Microsoft C++ exception: cudaError at memory location 0x00123404…

Plus, CUT_CHECK_ERROR catches this:

Cuda error: test_kernel failed in file ‘<…>/my.cu’ in line ### : invalid device function .

I’ve tried my own kernel as well as attempted the “HelloCUDA” kernel from the project wizard. No luck. Everything runs in emulation mode, though.

It’s gotta be something really simple in my project/solution setup, but I haven’t been able to find anything obvious. I inherited the build setup and added the CUDA files to the project, which triggered the custom build rule from the wizard. All the include files and libraries should be in the right place, since it compiles and runs (for the most part).

Anyone have any thoughts?

Thanks,
David