Step-by-step mini guide to CUDA compiling on Visual Studio 2008 - windows 7 - 64 bits Step-by-step m
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:
[list]
[*]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
[/list]

Then you can start the setup...

[b]Step1:[/b]

Go to file:
[b]C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat[/b]
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 )

[b]Step 2: [/b]

Under the line that gives the install directory of visual studio - something like :
[b]@SET VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC[/b]
Add a new line that contains the path to the last version of your windows SDK:
[b]@SET WIN64SDKDIR=C:\Program Files\Microsoft SDKs\Windows\v7.1[/b]
(here v7.1 could be replaced by whatever other version you have)

[b]Step 3:[/b]

Edite the line that starts like : [b]@set PATH=%VCINSTALLDIR (...lots of stuff.....) %PATH%[/b]
by adding this at the end just before the [b]%PATH%[/b]:
[b]WIN64SDKDIR%\Bin\x64;%WIN64SDKDIR%\Bin\x64\vsstools;c:\CUDA\bin64;[/b]
(note that "c:\CUDA\bin64;" could be changed with whatever is your cuda bin64 path)
So you get something like :
[b]@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%[/b]

[b]Step 4:[/b]

Edit the line that starts like
[b]@set INCLUDE=%VCINSTALLDIR%\INCLUDE (...stuff.....)%INCLUDE%[/b]
such that you add [b]%WIN64SDKDIR%\INCLUDE;[/b] just before the [b]%INCLUDE%[/b]
So you get something like:
[b]@set INCLUDE=%VCINSTALLDIR%\INCLUDE;%WIN64SDKDIR%\INCLUDE;%INCLUDE%[/b]

[b]Step 5:[/b]

Edit the line that starts like
[b]@set LIB=%VCINSTALLDIR%\LIB\amd64 (...stuff.....)%LIB%[/b]
such that you add [b]%WIN64SDKDIR%\INCLUDE;[/b] just before the [b]%LIB%[/b]
So you get something like:
[b]@set LIB=%VCINSTALLDIR%\LIB\amd64;%WIN64SDKDIR%\Lib\x64;%LIB%[/b]

[b]Step 6[/b]

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!
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!

#1
Posted 09/04/2010 12:47 PM   
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:
[list]
[*]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
[/list]

Then you can start the setup...

[b]Step1:[/b]

Go to file:
[b]C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat[/b]
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 )

[b]Step 2: [/b]

Under the line that gives the install directory of visual studio - something like :
[b]@SET VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC[/b]
Add a new line that contains the path to the last version of your windows SDK:
[b]@SET WIN64SDKDIR=C:\Program Files\Microsoft SDKs\Windows\v7.1[/b]
(here v7.1 could be replaced by whatever other version you have)

[b]Step 3:[/b]

Edite the line that starts like : [b]@set PATH=%VCINSTALLDIR (...lots of stuff.....) %PATH%[/b]
by adding this at the end just before the [b]%PATH%[/b]:
[b]WIN64SDKDIR%\Bin\x64;%WIN64SDKDIR%\Bin\x64\vsstools;c:\CUDA\bin64;[/b]
(note that "c:\CUDA\bin64;" could be changed with whatever is your cuda bin64 path)
So you get something like :
[b]@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%[/b]

[b]Step 4:[/b]

Edit the line that starts like
[b]@set INCLUDE=%VCINSTALLDIR%\INCLUDE (...stuff.....)%INCLUDE%[/b]
such that you add [b]%WIN64SDKDIR%\INCLUDE;[/b] just before the [b]%INCLUDE%[/b]
So you get something like:
[b]@set INCLUDE=%VCINSTALLDIR%\INCLUDE;%WIN64SDKDIR%\INCLUDE;%INCLUDE%[/b]

[b]Step 5:[/b]

Edit the line that starts like
[b]@set LIB=%VCINSTALLDIR%\LIB\amd64 (...stuff.....)%LIB%[/b]
such that you add [b]%WIN64SDKDIR%\INCLUDE;[/b] just before the [b]%LIB%[/b]
So you get something like:
[b]@set LIB=%VCINSTALLDIR%\LIB\amd64;%WIN64SDKDIR%\Lib\x64;%LIB%[/b]

[b]Step 6[/b]

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!
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!

#2
Posted 09/04/2010 12:47 PM   
Alternatively, I've been able to use the 32 bit libraries that install with CUDA. This is obviously a different solution and either this or the above may be better depending on your situation.

Just use the library files at "${CUDA_BIN_PATH}\..\lib".

~ Raz


[quote name='Mehdi Khoury' post='1112773' date='Sep 4 2010, 05:47 AM']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:
[list]
[*]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
[/list]

Then you can start the setup...

[b]Step1:[/b]

Go to file:
[b]C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat[/b]
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 )

[b]Step 2: [/b]

Under the line that gives the install directory of visual studio - something like :
[b]@SET VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC[/b]
Add a new line that contains the path to the last version of your windows SDK:
[b]@SET WIN64SDKDIR=C:\Program Files\Microsoft SDKs\Windows\v7.1[/b]
(here v7.1 could be replaced by whatever other version you have)

[b]Step 3:[/b]

Edite the line that starts like : [b]@set PATH=%VCINSTALLDIR (...lots of stuff.....) %PATH%[/b]
by adding this at the end just before the [b]%PATH%[/b]:
[b]WIN64SDKDIR%\Bin\x64;%WIN64SDKDIR%\Bin\x64\vsstools;c:\CUDA\bin64;[/b]
(note that "c:\CUDA\bin64;" could be changed with whatever is your cuda bin64 path)
So you get something like :
[b]@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%[/b]

[b]Step 4:[/b]

Edit the line that starts like
[b]@set INCLUDE=%VCINSTALLDIR%\INCLUDE (...stuff.....)%INCLUDE%[/b]
such that you add [b]%WIN64SDKDIR%\INCLUDE;[/b] just before the [b]%INCLUDE%[/b]
So you get something like:
[b]@set INCLUDE=%VCINSTALLDIR%\INCLUDE;%WIN64SDKDIR%\INCLUDE;%INCLUDE%[/b]

[b]Step 5:[/b]

Edit the line that starts like
[b]@set LIB=%VCINSTALLDIR%\LIB\amd64 (...stuff.....)%LIB%[/b]
such that you add [b]%WIN64SDKDIR%\INCLUDE;[/b] just before the [b]%LIB%[/b]
So you get something like:
[b]@set LIB=%VCINSTALLDIR%\LIB\amd64;%WIN64SDKDIR%\Lib\x64;%LIB%[/b]

[b]Step 6[/b]

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...

Good luck![/quote]
Alternatively, I've been able to use the 32 bit libraries that install with CUDA. This is obviously a different solution and either this or the above may be better depending on your situation.



Just use the library files at "${CUDA_BIN_PATH}\..\lib".



~ Raz





[quote name='Mehdi Khoury' post='1112773' date='Sep 4 2010, 05:47 AM']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...



Good luck!

#3
Posted 09/21/2010 09:33 PM   
Alternatively, I've been able to use the 32 bit libraries that install with CUDA. This is obviously a different solution and either this or the above may be better depending on your situation.

Just use the library files at "${CUDA_BIN_PATH}\..\lib".

~ Raz


[quote name='Mehdi Khoury' post='1112773' date='Sep 4 2010, 05:47 AM']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:
[list]
[*]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
[/list]

Then you can start the setup...

[b]Step1:[/b]

Go to file:
[b]C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat[/b]
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 )

[b]Step 2: [/b]

Under the line that gives the install directory of visual studio - something like :
[b]@SET VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC[/b]
Add a new line that contains the path to the last version of your windows SDK:
[b]@SET WIN64SDKDIR=C:\Program Files\Microsoft SDKs\Windows\v7.1[/b]
(here v7.1 could be replaced by whatever other version you have)

[b]Step 3:[/b]

Edite the line that starts like : [b]@set PATH=%VCINSTALLDIR (...lots of stuff.....) %PATH%[/b]
by adding this at the end just before the [b]%PATH%[/b]:
[b]WIN64SDKDIR%\Bin\x64;%WIN64SDKDIR%\Bin\x64\vsstools;c:\CUDA\bin64;[/b]
(note that "c:\CUDA\bin64;" could be changed with whatever is your cuda bin64 path)
So you get something like :
[b]@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%[/b]

[b]Step 4:[/b]

Edit the line that starts like
[b]@set INCLUDE=%VCINSTALLDIR%\INCLUDE (...stuff.....)%INCLUDE%[/b]
such that you add [b]%WIN64SDKDIR%\INCLUDE;[/b] just before the [b]%INCLUDE%[/b]
So you get something like:
[b]@set INCLUDE=%VCINSTALLDIR%\INCLUDE;%WIN64SDKDIR%\INCLUDE;%INCLUDE%[/b]

[b]Step 5:[/b]

Edit the line that starts like
[b]@set LIB=%VCINSTALLDIR%\LIB\amd64 (...stuff.....)%LIB%[/b]
such that you add [b]%WIN64SDKDIR%\INCLUDE;[/b] just before the [b]%LIB%[/b]
So you get something like:
[b]@set LIB=%VCINSTALLDIR%\LIB\amd64;%WIN64SDKDIR%\Lib\x64;%LIB%[/b]

[b]Step 6[/b]

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...

Good luck![/quote]
Alternatively, I've been able to use the 32 bit libraries that install with CUDA. This is obviously a different solution and either this or the above may be better depending on your situation.



Just use the library files at "${CUDA_BIN_PATH}\..\lib".



~ Raz





[quote name='Mehdi Khoury' post='1112773' date='Sep 4 2010, 05:47 AM']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...



Good luck!

#4
Posted 09/21/2010 09:33 PM   
I Can't Find the amd64 folder...

I know this means i don't have support for x64. Where can I find the complement?

I have installed Windows SDK 7.1 but it i can't target x64 plataform.

I have VISUAL STUDIO 2008 Cuda Toolkit 3.2, and i can RUN all the examples already compiled....


Please Help!!!
I Can't Find the amd64 folder...



I know this means i don't have support for x64. Where can I find the complement?



I have installed Windows SDK 7.1 but it i can't target x64 plataform.



I have VISUAL STUDIO 2008 Cuda Toolkit 3.2, and i can RUN all the examples already compiled....





Please Help!!!

#5
Posted 02/26/2011 04:45 AM   
You 're tutorial was quite thorough and very helpful. I followed it step by step and i managed to compile and run the cuda examples successfully. Moreover, I would really appreciate it if you could be more specific on the following instruction:

[quote]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)[/quote]

I wasn't able to find the above selection, and I would be really grateful if you could help me out.
Thank you again for your splendid tutorial.

Regards /thanks.gif' class='bbc_emoticon' alt=':thanks:' />
You 're tutorial was quite thorough and very helpful. I followed it step by step and i managed to compile and run the cuda examples successfully. Moreover, I would really appreciate it if you could be more specific on the following instruction:



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)




I wasn't able to find the above selection, and I would be really grateful if you could help me out.

Thank you again for your splendid tutorial.



Regards /thanks.gif' class='bbc_emoticon' alt=':thanks:' />

#6
Posted 02/27/2011 01:38 PM   
Hi,
I think I had the same problem.
You need to reinstall Visual Studio 2008 in custom mode. Then You will have the option to tick the box to install the x64 module...
Hopefully, that should work...


[quote name='__Ernesto__' date='26 February 2011 - 05:45 AM' timestamp='1298695549' post='1199276']
I Can't Find the amd64 folder...

I know this means i don't have support for x64. Where can I find the complement?

I have installed Windows SDK 7.1 but it i can't target x64 plataform.

I have VISUAL STUDIO 2008 Cuda Toolkit 3.2, and i can RUN all the examples already compiled....


Please Help!!!
[/quote]
Hi,

I think I had the same problem.

You need to reinstall Visual Studio 2008 in custom mode. Then You will have the option to tick the box to install the x64 module...

Hopefully, that should work...





[quote name='__Ernesto__' date='26 February 2011 - 05:45 AM' timestamp='1298695549' post='1199276']

I Can't Find the amd64 folder...



I know this means i don't have support for x64. Where can I find the complement?



I have installed Windows SDK 7.1 but it i can't target x64 plataform.



I have VISUAL STUDIO 2008 Cuda Toolkit 3.2, and i can RUN all the examples already compiled....





Please Help!!!

#7
Posted 02/27/2011 07:15 PM   
Hi,

If I remember well, in Cuda 3.2 the way visual studio project are built is different from Cuda 3.1. You can't access any more this rather strange Cuda Build Rule vx.x since Cuda 3.2. Hopefully (last time I played with Cuda was several months ago, so my memory of the whole installation thing is quite blurry now), this should not be an issue.
Cheers!

[quote name='popanik' date='27 February 2011 - 02:38 PM' timestamp='1298813938' post='1199447']
You 're tutorial was quite thorough and very helpful. I followed it step by step and i managed to compile and run the cuda examples successfully. Moreover, I would really appreciate it if you could be more specific on the following instruction:



I wasn't able to find the above selection, and I would be really grateful if you could help me out.
Thank you again for your splendid tutorial.

Regards /thanks.gif' class='bbc_emoticon' alt=':thanks:' />
[/quote]
Hi,



If I remember well, in Cuda 3.2 the way visual studio project are built is different from Cuda 3.1. You can't access any more this rather strange Cuda Build Rule vx.x since Cuda 3.2. Hopefully (last time I played with Cuda was several months ago, so my memory of the whole installation thing is quite blurry now), this should not be an issue.

Cheers!



[quote name='popanik' date='27 February 2011 - 02:38 PM' timestamp='1298813938' post='1199447']

You 're tutorial was quite thorough and very helpful. I followed it step by step and i managed to compile and run the cuda examples successfully. Moreover, I would really appreciate it if you could be more specific on the following instruction:







I wasn't able to find the above selection, and I would be really grateful if you could help me out.

Thank you again for your splendid tutorial.



Regards /thanks.gif' class='bbc_emoticon' alt=':thanks:' />

#8
Posted 02/27/2011 07:44 PM   
[quote name='Mehdi Khoury' date='27 February 2011 - 07:44 PM' timestamp='1298835860' post='1199574']
Hi,

If I remember well, in Cuda 3.2 the way visual studio project are built is different from Cuda 3.1. You can't access any more this rather strange Cuda Build Rule vx.x since Cuda 3.2. Hopefully (last time I played with Cuda was several months ago, so my memory of the whole installation thing is quite blurry now), this should not be an issue.
Cheers!
[/quote]

Oh, ok then /smile.gif' class='bbc_emoticon' alt=':smile:' />
Again, thanks for your help /thanks.gif' class='bbc_emoticon' alt=':thanks:' />
[quote name='Mehdi Khoury' date='27 February 2011 - 07:44 PM' timestamp='1298835860' post='1199574']

Hi,



If I remember well, in Cuda 3.2 the way visual studio project are built is different from Cuda 3.1. You can't access any more this rather strange Cuda Build Rule vx.x since Cuda 3.2. Hopefully (last time I played with Cuda was several months ago, so my memory of the whole installation thing is quite blurry now), this should not be an issue.

Cheers!





Oh, ok then /smile.gif' class='bbc_emoticon' alt=':smile:' />

Again, thanks for your help /thanks.gif' class='bbc_emoticon' alt=':thanks:' />

#9
Posted 02/28/2011 12:51 PM   
[quote name='popanik' date='27 February 2011 - 07:38 AM' timestamp='1298813938' post='1199447']
You 're tutorial was quite thorough and very helpful. I followed it step by step and i managed to compile and run the cuda examples successfully. Moreover, I would really appreciate it if you could be more specific on the following instruction:



I wasn't able to find the above selection, and I would be really grateful if you could help me out.
Thank you again for your splendid tutorial.

Regards /thanks.gif' class='bbc_emoticon' alt=':thanks:' />

/quote]
I just completed this tutorial as well, I was able to change the debugging, but I was not able to compile within this new environment. Regardless, I've attached a screen shot of where to find the run time debug change.
[quote name='popanik' date='27 February 2011 - 07:38 AM' timestamp='1298813938' post='1199447']

You 're tutorial was quite thorough and very helpful. I followed it step by step and i managed to compile and run the cuda examples successfully. Moreover, I would really appreciate it if you could be more specific on the following instruction:







I wasn't able to find the above selection, and I would be really grateful if you could help me out.

Thank you again for your splendid tutorial.



Regards /thanks.gif' class='bbc_emoticon' alt=':thanks:' />



/quote]

I just completed this tutorial as well, I was able to change the debugging, but I was not able to compile within this new environment. Regardless, I've attached a screen shot of where to find the run time debug change.
Attachments

CUDA_MTd_Debug.png

#10
Posted 03/20/2011 05:59 PM   
Thanks for the detailed explanation! /thanks.gif' class='bbc_emoticon' alt=':thanks:' />
Just one simple addition : You have to install [u]DirectX SDK[/u], not just DirectX :)
Otherwise, it will keep asking for "d3dx9.h" :)
Thanks for the detailed explanation! /thanks.gif' class='bbc_emoticon' alt=':thanks:' />

Just one simple addition : You have to install DirectX SDK, not just DirectX :)

Otherwise, it will keep asking for "d3dx9.h" :)

#11
Posted 11/09/2011 08:24 AM   
Scroll To Top