It took me a while to be able to simply rebuild/compile all SDK examples using Visual Studio 2008 on windows 7 - 64 bits…
Here is a step-by step guide to how I finally managed to get it to work seamlessly.
I hope this will be of help to others who are struggling like I did !
(incidentally, my laptop is a HP Pavillion intel core 5 - 4G ram with NVIDIA Geforce G105M)
First of all, install last versions of:
[*]Visual Studio C++ professionnal 2008 - (don’t forget the x64 component under vc++ … for me, it did not install itself by default !!!)
[*]Windows SDK
[*]Direct X
[*]CUDA toolkit
[*]CUDA developer SDK
[*]NVIDIA Driver
Then you can start the setup…
Step1:
Go to file:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat
Edit that file (in Windows 7 you have to open notepad as administrator = right click on notepad in the accessories and then → run as administrator )
Step 2:
Under the line that gives the install directory of visual studio - something like :
@SET VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
Add a new line that contains the path to the last version of your windows SDK:
@SET WIN64SDKDIR=C:\Program Files\Microsoft SDKs\Windows\v7.1
(here v7.1 could be replaced by whatever other version you have)
Step 3:
Edite the line that starts like : @set PATH=%VCINSTALLDIR (…lots of stuff…) %PATH%
by adding this at the end just before the %PATH%:
WIN64SDKDIR%\Bin\x64;%WIN64SDKDIR%\Bin\x64\vsstools;c:\CUDA\bin64;
(note that “c:\CUDA\bin64;” could be changed with whatever is your cuda bin64 path)
So you get something like :
@set PATH=%VCINSTALLDIR%\BIN\amd64;%FrameworkDir%%FrameworkVersion%;%VCINSTALLDIR%\VCPackages;%VSINSTALLDIR%\Common7\IDE;%VSINSTALLDIR%\Common7\Tools;%WIN64SDKDIR%\Bin\x64;%WIN64SDKDIR%\Bin\x64\vsstools;c:\CUDA\bin;%PATH%
Step 4:
Edit the line that starts like
@set INCLUDE=%VCINSTALLDIR%\INCLUDE (…stuff…)%INCLUDE%
such that you add %WIN64SDKDIR%\INCLUDE; just before the %INCLUDE%
So you get something like:
@set INCLUDE=%VCINSTALLDIR%\INCLUDE;%WIN64SDKDIR%\INCLUDE;%INCLUDE%
Step 5:
Edit the line that starts like
@set LIB=%VCINSTALLDIR%\LIB\amd64 (…stuff…)%LIB%
such that you add %WIN64SDKDIR%\INCLUDE; just before the %LIB%
So you get something like:
@set LIB=%VCINSTALLDIR%\LIB\amd64;%WIN64SDKDIR%\Lib\x64;%LIB%
Step 6
Go to your SDK examples folders, and open a project with Visual Studio 2008
Make sure x64 is chosen in the the combo-box top-center.
Change project → properties → Configuration properties → Cuda Build Rule vx.x → Hybrid Cuda/C++ options → Runtime Library from Multi-Threaded (/MT) to Multi-Threaded Debug (/MTd)
That’s it !!
Feel free to build/compile and run…
This was working fine on cuda 3.1 - the new Cuda 3.2 seems to behave slightly differently. (I just got it to work by copying cUtil64D.lib in each project directory).
Good luck!