Getting CUDA code to compile in Visual C++ 2005 has been a bit of a challenge for me.
I'm running Windows Vista Ultimate 64-bit. I'm using the latest Nvidia drivers, CUDA 2.1 toolkit and the 64-bit SDK.
Here's what I've figured out so far:
1. It need to say x64 in the "Configuration Manager" drop-down box at the top of the screen. That is, you need to tell the compiler that you're using a 64-bit platform.
2. In the solution propeties, under Configuration Properties -> C/C++ -> General, there is a setting called "Additional Include Directories". This needs to point to all the directories that contain CUDA header files. Mine is set to: $(CUDA_INC_PATH);./;../../common/inc
3. The CUDA files, which end in .cu, need to be compiled using a custom build rule that point to the CUDA compiler. This post on the Nvidia forum provides a tool that sets up the custom build rules for you. It worked for me, but use it at your own risk.
After I installed the tool from Step 3, I was able to open a new project, follow steps 1 and 2, copy code from the SDK into the new project, and then it compiled!
Regards,
The Greek Actuary Guy
Monday, April 13, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment