Issues compiling Win-32 project with CUDA 5.5 64 bit

Hi,

I’m running a Win 7 64-bit with a NVidia Quadro 4000 (driver 320.57). I have installed Cuda Toolkit version 5.5 64-bit version, since I was unable to install the 32-bit version.

The project I’m compiling is osgPPU, and I receive hundreds of error messages with error-code C2719 connected with surface_functions.h in the cuda library (see error message below). The project is configured by CMake.

Any ideas of how to resolve this problem?

Kind regards
Patrik

16>ClCompile:
16>  kernel.cu_cudakernel_generated.cpp
16>c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(27): error C2371: 'size_t' : redefinition; different basic types
16>          predefined C++ types (compiler internal)(19) : see declaration of 'size_t'
16>c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/../../VC/INCLUDE\stdlib.h(342): error C4235: nonstandard extension used : '__unaligned' keyword not supported on this architecture
16>c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\surface_functions.h(2642): error C2719: 'val': formal parameter with __declspec(align('8')) won't be aligned
...

As the error mentions, it seems you’re redefining size_t. It also might be related that you need to compile to a higher SM architecture… by default the templates compile for SM_10, change the SM to 2.0/3.0/3.5 as appropriate and retry your compilation… that itself might fix all the problems.

Thanks, you help me to find where to set the flags for the CUDA.

The main issue appear to be that the machine was not set, I added the flag -m=32 which solved the problems.

Thank you for your help!

Best regards
Patrik

Yes, a switch from 32 or 64 bit architecture would be exactly why you’d get mismatch errors like those, glad you got it fixed!