Question

This is a question which is a spin-off from another posted question which can be found at the following link:

CUDA - linking errors with convolution example

VS2008 not compiling cuda

In the above link and in several other posts about the same topic they state that if you compile 32 bit cuda this will solve your Build/Compile problems ...

Can anyone please help direct me to an article which would show how to link to 32 bit CUDA. This does not make sense. when you download CUDA toolkit, you have choice of downloading 64 or 32 bit. Both don't download. So are these people just downloading the 32 bit version of CUDA? This seems ridiculous and I know this cannot be what they mean. Any helpl would be greatly appreciated.

Any help as to what they are talking about when they say 'link to 32 bit CUDA' would be greatly appreciated.


ERROR MESSAGES (same as in previous posts)

1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>TestForCuda.cu.obj : error LNK2019: unresolved external symbol _cudaSetupArgument@12 referenced in function "void __cdecl __device_stub__Z10kernelTestPi(int *)" (?__device_stub__Z10kernelTestPi@@YAXPAH@Z)
1>TestForCuda.cu.obj : error LNK2019: unresolved external symbol ___cudaRegisterFunction@40 referenced in function "void __cdecl __sti____cudaRegisterAll_46_tmpxft_000022ac_00000000_3_TestForCuda_cpp1_ii_da17b9e9(void)" (?__sti____cudaRegisterAll_46_tmpxft_000022ac_00000000_3_TestForCuda_cpp1_ii_da17b9e9@@YAXXZ)
1>TestForCuda.cu.obj : error LNK2019: unresolved external symbol ___cudaRegisterFatBinary@4 referenced in function "void __cdecl __sti____cudaRegisterAll_46_tmpxft_000022ac_00000000_3_TestForCuda_cpp1_ii_da17b9e9(void)" (?__sti____cudaRegisterAll_46_tmpxft_000022ac_00000000_3_TestForCuda_cpp1_ii_da17b9e9@@YAXXZ)
1>TestForCuda.cu.obj : error LNK2019: unresolved external symbol ___cudaUnregisterFatBinary@4 referenced in function "void __cdecl __cudaUnregisterBinaryUtil(void)" (?__cudaUnregisterBinaryUtil@@YAXXZ)
1>TestForCuda.cu.obj : error LNK2019: unresolved external symbol _cudaLaunch@4 referenced in function "enum cudaError __cdecl cudaLaunch(char *)" (??$cudaLaunch@D@@YA?AW4cudaError@@PAD@Z)
1>C:\Users\misc\Documents\Visual Studio 2010\Projects\TestForCuda\Test_Configuration\TestForCuda.exe : fatal error LNK1120: 5 unresolved externals
1>
1>Build FAILED.

No correct solution

OTHER TIPS

The project I was attempting to compile was a VS2010 project I had created from scratch. The code was test code I downloaded from the internet. I actually had two problems …

1st problem:

Under ‘build customization’ you need to select the CUDA version to build with. I had selected the highest version shown which was ‘CUDA 4.2(.targets,.props)’. The problem was that I linked to CUDA version 5.0. When I say ‘linked’ I am referring to the linked option which you can find in the VS2010 menu bar at “Project => Properties =>Configuration properties => Linker”. When you get to this menu you have the option to add ‘Additional Library Directories’. I had linked to CUDA version 5.0. I have not figured out yet why I do not have a CUDA v5.0 under ‘build customization’ … but that is another question for another day.
Lesson: whatever version of cude you link to (in Linker menu), is the version you should select in the 'build customation' menu.

2nd problem:

I am running on Windows 7 (64 bit), Processor is 64 bit (Intel quad core), the CUDA sdk/toolkit I downloaded was 64 bit, but I was attempting to debug with a Win32 platform. Yes, I knew I needed to compile/build using the proper bit platform, but ignorantly, I could not figure out how to change the ‘Platform’ (located in the 'configuration manager' menu for your VS project) to x64. The how-tos on the web showed the x64 option as already being available in the ‘Platform’ dropdown. I read later articles that stated that VS can only debug in Win32 but can compile in Win32 or x64 (not true) which freaked me out even more. In Reality, If it is your first time to use x64 Platform, the x64 option will NOT be in the Platform dropdown. You must create a ‘new’ platform. When you do this, you need to select x64 for the ‘Copy settings from:’ dropdown. I want to say I tried this before and there was not x64 option in the ‘Copy settings form:’ dropdown. I either overlooked the x64 ‘Copy setting from:’ option previously … or this option was added after I conducted the custom install suggested by Roger (I wish I could remember/ was more observant about this). Lesson: may need to 'create new' platform in the 'configuration manager' menu if it is your first time to use x64 option (believe VS debug may default to Win32 ... but is easily changed to x64 if needed).

Anyway, after fixing both of these things (not just one … but both), the CUDA code did successfully compile. I just wanted to thank everyone again for all the help! Got me moving in the correct direction!

PS: Nice tutorial (not mine but I used to help me) to help you compile your first CUDA code http://www.youtube.com/watch?v=1HMVg40fsg0

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top