I have successfully created several 32-bit CUDA-based DLLs for Windows using CUDA toolkit 2.3 and Visual C++ Express 2008. But I am struggling with trying to create 64-bit DLLs. I have tried visual C++ Express 2010 with CUDA toolkit 4.0 (64-bit) and Windows SDK 7.1. I am in the process of trying with a trial edition of Visual Studio 2010 pro.
Would somebody please recommend a combination of tools/versions that are known to work well together for 64-bit development? I am on Windows XP x64 Pro at the moment, and will be moving to Windows 7 very soon.
at the moment I am using only x64 compiler in CUDA 4.0 projects with Visual Studio 2010 Professional on Windows 7 x64 and Windows Server 2008 R2 (to build x64 mex for MATLAB 2011a)… work like a charm. After you have installed ParallelNsight 2.0 x64, in Visual Studio installed templates you have an entry called “NVIDIA->CUDA->CUDA 4.0 RUNTIME”… click on it and you have done :D.
If you are using Visual Studio 2010 Express edition, you cannot install ParallelNsight because express edition does not support add-ons and x64 compiler; in this case you can do:
That sounds good, Paolo. I have the x64 compilers installed and working with VC++ 2010 Express for regular (CPU) code (although that mathworks link didn’t work for me).
I think I understand the parts about additional include and lib directories, but I’m not so sure how to tell VC++ how to build a .cu file. I know there are .props files for that, but I don’t know how to debug them.
It would help if NVidia had documentation for this.
In ConfigurationProperties->C/C+±>General->AdditionalIncludeDirectories add entry $(CUDA_INC_PATH);
In ConfigurationProperties->Linker->General->AdditionalLibraryDirectories add entry $(CUDA_LIB_PATH);
In ConfigurationProperties->Linker->Input->AdditionalDependencies add cudart.lib (to use C runtime for CUDA), npp.lib (if you want to use NVIDIA Performance Primitive for image processing and DSP), cufft.lib (for FFT) and so on.
Under BuildCostumizations select CUDA 4.0 (.targets, .props) and you have done.
Without Visual Studio 2010 Professional and NVIDIA ParallelNsight 2.0 it is very stressful to debug CUDA application, I am not sure if you can use cuda-gdb under Windows (cuda-gdb is a porting of GNU/Linux gdb for CUDA applications). Anyway, remember that to debug CUDA applications you need 2 GPUs, for single GPU read this post but I do not know if this will work.