Simple CUDA Wizard for Visual Studio 2005
  1 / 7    
2.0 release version

[url="http://forums.nvidia.com/index.php?showtopic=83054"]http://forums.nvidia.com/index.php?showtopic=83054[/url]






I've made a simple VS2005 Project Wizard for CUDA. After you install the CUDA VS2005 Wizard, you can see the CUDAWin32App in your Visual Studio installed templates Category. Then it's easy to create a new CUDA project in VS2005.

This is first version only made in two days. So if there is any problem please let me know.

PS: Thanks JaredHoberock's "Simple CUDA build rule for Visual Studio 2005".

The new version:
Modify two bug:
1, Change the CUDA_LIB_PATH into CUDA_INC_PAHT;
2, Add debug info into EmuDebug;

MD5:9fc707a08946573de28b75aad2f075ca

And the new version 1.2. We can get it:
[url="http://forums.nvidia.com/index.php?showtopic=69183"]http://forums.nvidia.com/index.php?showtopic=69183[/url]

VS2005 Express verson is done.
The x64 OS version is done.

[url="http://forums.nvidia.com/index.php?act=ST&f=70&t=69183&st=0#entry390252"]http://forums.nvidia.com/index.php?act=ST&...t=0#entry390252[/url]
2.0 release version



http://forums.nvidia.com/index.php?showtopic=83054













I've made a simple VS2005 Project Wizard for CUDA. After you install the CUDA VS2005 Wizard, you can see the CUDAWin32App in your Visual Studio installed templates Category. Then it's easy to create a new CUDA project in VS2005.



This is first version only made in two days. So if there is any problem please let me know.



PS: Thanks JaredHoberock's "Simple CUDA build rule for Visual Studio 2005".



The new version:

Modify two bug:

1, Change the CUDA_LIB_PATH into CUDA_INC_PAHT;

2, Add debug info into EmuDebug;



MD5:9fc707a08946573de28b75aad2f075ca



And the new version 1.2. We can get it:

http://forums.nvidia.com/index.php?showtopic=69183



VS2005 Express verson is done.

The x64 OS version is done.



http://forums.nvidia.com/index.php?act=ST&...t=0#entry390252

#1
Posted 04/18/2008 02:11 PM   
Thanks! The generated "hello cuda!" compiles and runs well. I haven't made any real tests yet.
Thanks! The generated "hello cuda!" compiles and runs well. I haven't made any real tests yet.

#2
Posted 04/18/2008 06:16 PM   
Thanks Kaiyong, this is really helpful
Thanks Kaiyong, this is really helpful

#3
Posted 04/19/2008 12:44 AM   
hi, every body:) need more items into the wizard? if so, I will continue to do it.
hi, every body:) need more items into the wizard? if so, I will continue to do it.

#4
Posted 04/24/2008 07:02 AM   
I've just had a Windows reinstall and a clean install of VS2005 and CUDA toolkit. I've found a little inconvenience. By default, the sample code has:
[code]#include <cuda_runtime.h> [/code]

The <..> mean the include file is searched within VS specified includes directory, which is not yet set for CUDA after a fresh install.

I usually add CUDA/include dir into VC++ directories anyway but to make this wizard foolproof you might want to add a rule to account for it (is possible) :)
I've just had a Windows reinstall and a clean install of VS2005 and CUDA toolkit. I've found a little inconvenience. By default, the sample code has:

#include <cuda_runtime.h>




The <..> mean the include file is searched within VS specified includes directory, which is not yet set for CUDA after a fresh install.



I usually add CUDA/include dir into VC++ directories anyway but to make this wizard foolproof you might want to add a rule to account for it (is possible) :)

#5
Posted 05/08/2008 09:16 PM   
Hello _Big_Mac_

I used the VS2005 Project Wizard to create a new project...
But my VS couldn't fine the <cutil.h> & <cuda_runtime.h>...
How to include the directory to tell VS the correct path and get the *.h

I check "template" (SDK project) and "wizard project "...

the "template" vcproj file includes the "CUDA_INC_PATH"
but the "wizard project " doesn't have it ...

Is the main reason that my VS couldn't find the <cutil.h> & <cuda_runtime.h>...?

thanks~~ ^_^
Hello _Big_Mac_



I used the VS2005 Project Wizard to create a new project...

But my VS couldn't fine the <cutil.h> & <cuda_runtime.h>...

How to include the directory to tell VS the correct path and get the *.h



I check "template" (SDK project) and "wizard project "...



the "template" vcproj file includes the "CUDA_INC_PATH"

but the "wizard project " doesn't have it ...



Is the main reason that my VS couldn't find the <cutil.h> & <cuda_runtime.h>...?



thanks~~ ^_^

#6
Posted 05/09/2008 01:45 AM   
[quote name='_Big_Mac_' date='May 9 2008, 05:16 AM']I've just had a Windows reinstall and a clean install of VS2005 and CUDA toolkit. I've found a little inconvenience. By default, the sample code has:
[code]#include <cuda_runtime.h> [/code]

The <..> mean the include file is searched within VS specified includes directory, which is not yet set for CUDA after a fresh install.

I usually add CUDA/include dir into VC++ directories anyway but to make this wizard foolproof you might want to add a rule to account for it (is possible) :)
[right][snapback]374441[/snapback][/right]
[/quote]
Thanks:)
But the error is not here. It's me made a mistake in the Wizard set the -I with $(CUDA_LIB_PATH). It should be CUDA_INC_PATH. - -hehe I will update it in the next version.

BTW, the include <...> means search from the INCLUDE environment and the directories that specified by the /I compiler option.
[url="http://msdn.microsoft.com/en-us/library/36k2cdd4(VS.80).aspx"]http://msdn.microsoft.com/en-us/library/36k2cdd4(VS.80).aspx[/url]

And always we use <...> to distinguish "system environment & SDK" from our sources. :)
[quote name='_Big_Mac_' date='May 9 2008, 05:16 AM']I've just had a Windows reinstall and a clean install of VS2005 and CUDA toolkit. I've found a little inconvenience. By default, the sample code has:

#include <cuda_runtime.h>




The <..> mean the include file is searched within VS specified includes directory, which is not yet set for CUDA after a fresh install.



I usually add CUDA/include dir into VC++ directories anyway but to make this wizard foolproof you might want to add a rule to account for it (is possible) :)

[snapback]374441[/snapback]




Thanks:)

But the error is not here. It's me made a mistake in the Wizard set the -I with $(CUDA_LIB_PATH). It should be CUDA_INC_PATH. - -hehe I will update it in the next version.



BTW, the include <...> means search from the INCLUDE environment and the directories that specified by the /I compiler option.

http://msdn.microsoft.com/en-us/library/36k2cdd4(VS.80).aspx



And always we use <...> to distinguish "system environment & SDK" from our sources. :)

#7
Posted 05/09/2008 05:03 AM   
[quote name='Huang Wei Hao' date='May 9 2008, 09:45 AM']Hello _Big_Mac_

I used the VS2005 Project Wizard to create a new project...
But my VS couldn't fine the <cutil.h> & <cuda_runtime.h>...
How to include the directory to tell VS  the correct path and get the  *.h

I check "template" (SDK project) and  "wizard project "...

the "template" vcproj file includes the "CUDA_INC_PATH"
but the "wizard project " doesn't have it ...

Is the main reason that my VS couldn't find the <cutil.h> & <cuda_runtime.h>...?

thanks~~ ^_^
[right][snapback]374520[/snapback][/right]
[/quote]

Change the CUDA_LIB_PATH to CUDA_INC_PATH in the wizard project :)
[quote name='Huang Wei Hao' date='May 9 2008, 09:45 AM']Hello _Big_Mac_



I used the VS2005 Project Wizard to create a new project...

But my VS couldn't fine the <cutil.h> & <cuda_runtime.h>...

How to include the directory to tell VS  the correct path and get the  *.h



I check "template" (SDK project) and  "wizard project "...



the "template" vcproj file includes the "CUDA_INC_PATH"

but the "wizard project " doesn't have it ...



Is the main reason that my VS couldn't find the <cutil.h> & <cuda_runtime.h>...?



thanks~~ ^_^

[snapback]374520[/snapback]






Change the CUDA_LIB_PATH to CUDA_INC_PATH in the wizard project :)

#8
Posted 05/09/2008 05:04 AM   
Hello~kyzhao

You mean I change in vcproj...
or in VS->projects->properties->Linker->General->
Additional Libraries Directories -> $(CUDA_LIB_PATH);../../common/lib

Thanks~!! :)
Hello~kyzhao



You mean I change in vcproj...

or in VS->projects->properties->Linker->General->

Additional Libraries Directories -> $(CUDA_LIB_PATH);../../common/lib



Thanks~!! :)

#9
Posted 05/09/2008 06:38 AM   
[quote name='Huang Wei Hao' date='May 9 2008, 02:38 PM']Hello~kyzhao

You mean I change in vcproj...
or in VS->projects->properties->Linker->General->
Additional Libraries Directories -> $(CUDA_LIB_PATH);../../common/lib

Thanks~!! :)
[right][snapback]374616[/snapback][/right]
[/quote]
VS->projects->properties->CUDA->General->Additional include Directories->$(CUDA_LIB_PATH) ---------->$(CUDA_INC_PATH)

:)
[quote name='Huang Wei Hao' date='May 9 2008, 02:38 PM']Hello~kyzhao



You mean I change in vcproj...

or in VS->projects->properties->Linker->General->

Additional Libraries Directories -> $(CUDA_LIB_PATH);../../common/lib



Thanks~!! :)

[snapback]374616[/snapback]




VS->projects->properties->CUDA->General->Additional include Directories->$(CUDA_LIB_PATH) ---------->$(CUDA_INC_PATH)



:)

#10
Posted 05/09/2008 06:47 AM   
I've did that and now an error occurs during linking:
[code]
Linking...
LINK : fatal error LNK1104: cannot open file '.\Debug\CUDAWin32App1.obj'
Build log was saved at "file://d:\projekty_dev\test2\CUDAWin32App1\CUDAWin32App1\Debug\BuildLog.htm"[/code]

I've added the build log as an attachment.
I've did that and now an error occurs during linking:



Linking...

LINK : fatal error LNK1104: cannot open file '.\Debug\CUDAWin32App1.obj'

Build log was saved at "file://d:\projekty_dev\test2\CUDAWin32App1\CUDAWin32App1\Debug\BuildLog.htm"




I've added the build log as an attachment.
Attachments

BuildLog.htm

#11
Posted 05/12/2008 05:44 PM   
[quote name='_Big_Mac_' date='May 13 2008, 01:44 AM']I've did that and now an error occurs during linking:
[code]
Linking...
LINK : fatal error LNK1104: cannot open file '.\Debug\CUDAWin32App1.obj'
Build log was saved at "file://d:\projekty_dev\test2\CUDAWin32App1\CUDAWin32App1\Debug\BuildLog.htm"[/code]

I've added the build log as an attachment.
[right][snapback]376013[/snapback][/right]
[/quote]
There is no Debug Category in your program category.
[quote name='_Big_Mac_' date='May 13 2008, 01:44 AM']I've did that and now an error occurs during linking:



Linking...

LINK : fatal error LNK1104: cannot open file '.\Debug\CUDAWin32App1.obj'

Build log was saved at "file://d:\projekty_dev\test2\CUDAWin32App1\CUDAWin32App1\Debug\BuildLog.htm"




I've added the build log as an attachment.

[snapback]376013[/snapback]




There is no Debug Category in your program category.

#12
Posted 05/16/2008 06:05 PM   
[quote name='kyzhao' date='May 16 2008, 08:05 PM']There is no Debug Category in your program category.
[/quote]

I still can't get it to work.

I can compile and link in EmuDebug mode but when I try to debug it, VS says "Debugging information cannot be found or does not match. Binary was not built with debug information". I fixed this by manually editing Properties->Linker->Debugging and setting [b]Generate Debug Info[/b] to on, as per Debug configuration.

EmuRelease works fine.

Ordinary Debug does what I described earlier.

Release mode gives me:
[code]LINK : fatal error LNK1181: cannot open input file '.\release\wizardtest.obj'
Build log was saved at "file://d:\NVIDIA CUDA SDK\projects\wizardTest\wizardTest\Release\BuildLog.htm"
wizardtest - 1 error(s), 0 warning(s)[/code]
(build log in attachment)


I compared build logs from the failed Release and Debug modes with the successfully linked Emu modes and found one difference:

One of the command lines looks like this in Release build log:
[code]/OUT:"Release\wizardtest.exe"[/code]

And here's the successfully linked EmuRelease
[code]/OUT:"D:\NVIDIA CUDA SDK\projects\wizardtest\EmuRelease\wizardtest.exe" [/code]

I noticed EmuRelease version has a complete path and Release doesn't. Can this be the case? If so, how to fix it?

Edit: I changed it so that all configurations use complete paths and it didn't help.
[quote name='kyzhao' date='May 16 2008, 08:05 PM']There is no Debug Category in your program category.





I still can't get it to work.



I can compile and link in EmuDebug mode but when I try to debug it, VS says "Debugging information cannot be found or does not match. Binary was not built with debug information". I fixed this by manually editing Properties->Linker->Debugging and setting Generate Debug Info to on, as per Debug configuration.



EmuRelease works fine.



Ordinary Debug does what I described earlier.



Release mode gives me:

LINK : fatal error LNK1181: cannot open input file '.\release\wizardtest.obj'

Build log was saved at "file://d:\NVIDIA CUDA SDK\projects\wizardTest\wizardTest\Release\BuildLog.htm"

wizardtest - 1 error(s), 0 warning(s)


(build log in attachment)





I compared build logs from the failed Release and Debug modes with the successfully linked Emu modes and found one difference:



One of the command lines looks like this in Release build log:

/OUT:"Release\wizardtest.exe"




And here's the successfully linked EmuRelease

/OUT:"D:\NVIDIA CUDA SDK\projects\wizardtest\EmuRelease\wizardtest.exe"




I noticed EmuRelease version has a complete path and Release doesn't. Can this be the case? If so, how to fix it?



Edit: I changed it so that all configurations use complete paths and it didn't help.

#13
Posted 05/19/2008 10:27 PM   
Here's the successful build log
Here's the successful build log

#14
Posted 05/19/2008 10:45 PM   
I guess the error is not the set of OUT path. Because the path is created by the VS, in "$(OutDir)\$(ProjectName).exe"

Can you find the wizardtest.obj in the Release Category?
If can't the error is about the linker.
If so, the error is the obj compiler.

If there is also error, can you send me the project?
I guess the error is not the set of OUT path. Because the path is created by the VS, in "$(OutDir)\$(ProjectName).exe"



Can you find the wizardtest.obj in the Release Category?

If can't the error is about the linker.

If so, the error is the obj compiler.



If there is also error, can you send me the project?

#15
Posted 05/20/2008 07:29 AM   
  1 / 7    
Scroll To Top