Strange cudaErrors popping up during dll loading.

I seem to be getting some strange cudaErrors occurring during DLL loading in my application.

I stripped away everything from the main method such that there is only a print statement for printing the cudaError and the return statement (ie: there is no actual GPU code being executed, no memory being allocated on the GPU, nothing):

int main(int argc, char* argv[])

{

	//ThisWouldGetMeIntoTheGPUCode();

	printf(cudaGetErrorString(cudaGetLastError()));

	return 0;

}

If I break the program at the printf statement (before it has executed), the cuda errors have already occurred (so the call to cudaGetErrorString or cudaGetLastError are not causing this), yet if I let the application continue to run (or just let it run from start to finish without a breakpoint), ‘no error’ is printed to the screen.

In the output, however, I see:

'Test.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll'

'Test.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll'

'Test.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll'

'Test.exe': Loaded 'C:\CUDA\v3.2\bin\cudart32_32_16.dll', Binary was not built with debug information.

'Test.exe': Loaded 'C:\CUDA\v3.2\bin\curand32_32_16.dll', Binary was not built with debug information.

First-chance exception at 0x7701b727 in Test.exe: Microsoft C++ exception: cudaError at memory location 0x004afc78..

First-chance exception at 0x7701b727 in Test.exe: Microsoft C++ exception: cudaError at memory location 0x004afc78..

First-chance exception at 0x7701b727 in Test.exe: Microsoft C++ exception: cudaError at memory location 0x004afc78..

First-chance exception at 0x7701b727 in Test.exe: Microsoft C++ exception: cudaError at memory location 0x004afc78..

'Test.exe': Loaded 'C:\Windows\SysWOW64\nvcuda.dll', Binary was not built with debug information.

'Test.exe': Loaded 'C:\Windows\SysWOW64\user32.dll'

'Test.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll'

'Test.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll'

...lots more dlls being loaded...

Does anyone have any ideas as to what could be causing these cudaErrors? I’m using the CUDA Toolkit version 3.2, and I’ve tried compiling for sm_13 and sm_20 (I have a compatible video card for either).

Thanks in advance for any aid provided!

-Edit- I should also mention that if I let my application run normally with the GPU/CUDA code executing and everything, I don’t see any cudaErrors during the runtime of the application beyond those 4 during the loading. The application appears to run correctly. Those errors have me worried though.

Same problem here. The problem seems to be caused by the texture and surface declarations (I got one exception per declaration). Results are the same with both CUDA “Developer Drivers” (260.99, 263.06) and the last one (266.58) on both NVIDIA samples and my application.

Same problem here, but with the cublas library. See: cublas library error. Currently using Parallel Nsight 1.51.

The same problem. Removing texture declarations helped. But is there any normal solution?

I am having the exact same problem. Linking an object that was compiled by nvcc with only

#include <cuda.h>

texture<unsigned char, 3, cudaReadModeNormalizedFloat> foo;

causes an error immediately upon running my program:

First-chance exception at 0x76acb727 in CudaRenderTest-Debug.exe: Microsoft C++ exception: cudaError at memory location 0x0018fd7c..

This is with CUDA 3.2 and drivers 270.61. I have CUDA 4.0 RC 2 installed, but I’m not using it.

Still no idea on that topic ??

I also have those exception, under MSVC 8 and 9, in debug and release, using cuda 4.0