starting witih CUDA How to start to coding ?

Hi everybody.

I'm a very newbie using CUDA. I installed it yesterday :). 

I have worked in C/C++, C++ Builder and MASM 32 and 64. 

I want to start to coding in CUDA and I hope you can give me some links to know how to start and how to configure an IDE for working. 

I'm using Vista 64 bits and I have installed VS2008. 

Sorry if this post is too general, but I have been looking by Internet for some information about and I'm very confusing, I hope you can guide me in my first steeps and the I'll be able to fly alone. 

Thanks in advance,
GUAN

First of, VS2008 is not fully compatible with CUDA, you should use 2005.

Some time ago I started a similar threads: [url=“http://forums.nvidia.com/index.php?showtopic=62620”]http://forums.nvidia.com/index.php?showtopic=62620[/url]

To start a project, a good idea is to download kyzhao’s CUDA Wizard: [url=“http://forums.nvidia.com/index.php?showtopic=80572”]http://forums.nvidia.com/index.php?showtopic=80572[/url]

Steps to do (for developing in Windows):
0) Get a proper video card

  1. Install MS VS2005
  2. Download and install video drivers, CUDA toolkit and CUDA SDK (preferably in this order)
  3. Check if the compiled projects in \NVIDIA CUDA SDK\bin launch
  4. Download and install CUDA Wizard
  5. Start a new project in VS2005 using “CUDAWinApp” template
  6. See if the dummy project compiles and runs
  7. If not, post the problem. If yes, you’re ready to start developing

It’s a good idea to read the Programming Guide and go through tutorials here [url=“http://www.nvidia.com/object/cuda_education.html”]http://www.nvidia.com/object/cuda_education.html[/url] . I found the podcasts from University of Illinois very helpful for understanding the concepts of CUDA programming and Dr. Dobbs’ articles offer many code examples. After you go through them, read the slides in “SC07 Tutorial: High Performance Computing with CUDA”, this pdf is often referenced on the forum (it’s mostly optimization, you should leave it for after you know the basics)

Thanks Big_Mac

That’s clearer for me.

I was try to compile with VS2008, and it was imposible.

Well, my first point is to search my old disc of VS2005.

If I’ll have some issue I come back ;)

Thanks again,
GUAN

Well, I have a problem :(
I installed the VS2005 I think that it is called Visual Studio 8 too.

I copy a sample form DSK (querydevice) to another directory.

I add in the Enviroment the path to Debugger, in my case:

C:\Program Files (x86)\NVIDIA Corporation\NVIDIA CUDA SDK\bin\win64

I fix:

  - DevideQuery.cu Property/Build by Step/Genearl/Command line
  - DevideQuery Property/linker => OutPut File  and Additional Library Directories

As I watched in the video which you can download using this link [url=“http://www.megaupload.com/?d=1EZ8WV7T”]http://www.megaupload.com/?d=1EZ8WV7T[/url]

And when I build the solution I had the following mistakes

1>------ Build started: Project: deviceQuery, Configuration: Debug Win32 ------
1>Performing Custom Build Step
1>nvcc fatal : Visual Studio configuration file ‘(null)’ could not be found for installation at ‘C:/Program Files (x86)/Microsoft Visual Studio 8/VC/bin’
1>Linking…
1>LINK : fatal error LNK1181: cannot open input file ‘cutil32D.lib’
1>Build log was saved at “file://c:\Borrar\deviceQuery\Debug\BuildLog.htm”
1>deviceQuery - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =========

I think that the first mistake is for this line in the command line:

“$(VCInstallDir)bin”

The variable VCInstallDir is not in my Enviroment Variable

I don’t have the file cutil32D.lib but I have cutil64D.lib
I don’t know where I need to change something for using the 64 bit dll which I have installed in my PC.

My Enviroment is:

- Vista 64 bit
- ASUS NVIDIA 9600 GTX

Best Regards,
GUAN

1>------ Build started: Project: deviceQuery, Configuration: Debug Win32 ------

This might be your problem, you are trying to compile to a 32 bit system.

Well, when I work with MASM I can choose ml or ml64 to compile for one platform or another.

Is it not posible with CUDA? Because the DSK examples are made in 32bit and it run ok.

But that isn’t matter.
Are there a easy way to tranlate the proyect to 64 bit system and compile it ?

I supouse The unique thing that I need to do is change some Visual Studio Setting but I don’t know what I need to change,isn’t it?

I want to check if I have CUDA configure correctly

GUAN

I forget where exactly, but in the Project Properties under the Linker section there is a place to specify additional libraries. There you will see a reference to cutil32D.lib. Change it accordingly.

Thanks Alex I found it but it did not work yet.

Well I searched for the CUDA on Vista foro and I found that there are problems with Vista 64 bit platform, so to start in this new advanture I’m thinking to install the tool kit for 32 bit first and try to make work CUAD in 32 bit first.

Can someone tell my how to install the 32 tool kit properly without uninstall the 64 tool kit? I mean, I’d like to have the two tool kits installed at the same time for a future use.

In this way, I don’t know what I need to change in the global Enviroment Variable to avoid problem between the two toolkits.

Best Regards,
GUAN

There are no problems on the vista 64 platform, just a few quirks to get everything working fine.

  1. You need VS2005 pro (express doesn’t build 64-bit executables)
  2. You need to select the Debug/Release x64 build target. You cannot build the win32 target with the 64-bit toolset
  3. If you are creating your own project, you need to setup the custom build rules so that nvcc is run with the argument -ccbin=“path_to_32-bit_cl.exe”

However it is possible to install the 32 bit toolset and 32 bit VC++ 2005 Express edition on a Vista 64 bit machine. This works - I’ve done it.

Christian

Well I installed the CUDA and SDK for 32 bit and I made the sample work fine xD.

If I try to compile for 64 bits I have the next error

1>Performing Custom Build Step
1>nvcc fatal : Visual Studio configuration file ‘(null)’ could not be found for installation at ‘C:/Program Files (x86)/Microsoft Visual Studio 8/VC/bin’
1>Linking…
1>LINK : fatal error LNK1181: cannot open input file ‘.\release\deviceQuery.obj’
1>Build log was saved at “file://c:\Borrar\deviceQuery\Release\BuildLog.htm”
1>deviceQuery - 1 error(s), 0 warning(s)

My command line for compiling in 64 bit platform is that:

“$(CUDA_BIN_PATH_64)\nvcc.exe” -ccbin “$(VCInstallDir)bin” -c -DWIN32 -D_CONSOLE -D_MBCS -Xcompiler /EHsc,/W3,/nologo,/Wp64,/O2,/Zi,/MT -I"$(CUDA_INC_PATH_64)" -I./ -I"$(NVSDKCUDA_ROOT_64)/common/inc" -o $(ConfigurationName)\deviceQuery.obj deviceQuery.cu

The configuration is Active(Release) and PlatForm (Active Win32). If I try to change it for x64 it is imposible then to open the window property for deviceQuery.cu, so I only change the Enviorment Variable to point to the rigiht path and change in the linker the lib cutil32D.lib for cutil64D.lib

What I was doing wrong?

GUAN

Well with CUDA for 32 bit and 32 SDK, I installed the CUDA Wizar beta 2.0.

I create a new proyect for CUDA, compile and Run.

The conlose apear and disapear very quickly and I can see the next excepcion

ProbandoCUDA.exe’: Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6001.18000_none_5cdbaa5a083979

cc\comctl32.dll’, No symbols loaded.

First-chance exception at 0x75b8f35f in ProbandoCUDA.exe: Microsoft C++ exception: cudaError_enum at memory location 0x0017fe04…

First-chance exception at 0x75b8f35f in ProbandoCUDA.exe: Microsoft C++ exception: cudaError at memory location 0x0017fe44…

The program ‘[4140] ProbandoCUDA.exe: Native’ has exited with code 0 (0x0).

I try to configure por compile using C or C++ but I always have the same problem.

GUAN

Ok I fix the issues.

I was necessary to set up project → property → CUDA → Output → Intern mode: set Real
because by defautl it is not set.

Well I have reade the Envioremnte for 32 bit :)

Thanks for all
GUAN