Sign in to follow this  
stu2000

Getting started with CUDA

Recommended Posts

Hello there,
I have been meaning to get started with CUDA for ages now and decided to buy this book:"CUDA by Example: An introduction to General Purpose GPU Programming". I had thought this would help me get started but to say that it is lacking information on how to get started is an understatement. Either that or I missed something.

It states that we need a C compiler and to download Microsoft Visual Studio. I take it I need to use (and already have) Visual studio C++ 2008? I cant seee one just for C, but can see one for C#. It also states that I need to download and install the CUDA development toolkit which I did and installed.

It came as no surprise that when i tried to build their example Hello World code,

Click here to view full size

it failed and didnt know what the hell to do.
Click here to view full size

I get the feeling there a couple more steps I need to perform on my IDE that the book does not mention at all. Either that or I should be using a different IDE, the book never really specifies. I take it that the code should be in a cpp file as well?

Any and all help appreciated.
For background info im running 64bit win7 with a nvidia 260gtx card.

Stu

Share this post


Link to post
Share on other sites
I realise that its CUDA code but need a few more details. Ive added the custom build step but that still doesnt seem to be enough. I have found that i have that nvcc.exe on my computer which is a good sign. Is the file supposed to be .cu when developing as thats what the examples from the site are in. cu and .cuh. Unfortunately if i rename to .cu the option to compile gets faded out. Compiling as .cpp still results in errors with the custom build step. Also, all of their projects fail to open in my MSVC++ and have to load the src code directly, so i cant prove that compiler works like they suggest here: http://julianapena.com/2009/09/how-to-install-and-configure-cuda-on-windows/


#include <iostream>

__global__void kernel(void)
{
}

int main(void)
{
kernel<<<1,1>>>();
printf("Hello, World \n");
return 0;
}


Stu

Share this post


Link to post
Share on other sites
What do you plan to use CUDA for? I'd urge you to consider OpenAL as it is an open standard, supported by more than just one company. It's also extremely similar to CUDA. If you plan to use it in games, you'd be alienating everyone with ATI/AMD.

Share this post


Link to post
Share on other sites
Quote:
Original post by Chris_F
What do you plan to use CUDA for? I'd urge you to consider OpenAL as it is an open standard, supported by more than just one company. It's also extremely similar to CUDA. If you plan to use it in games, you'd be alienating everyone with ATI/AMD.


s/OpenAL/OpenCL/

Share this post


Link to post
Share on other sites
Using CUDA for very specialist server program, so not alienating AMD/ATI people. Definitely needs to be CUDA.
So once all custom build steps put in etc. i should be able to hit big green debug button and it work? I take it i call it a .cu file right?
Stu

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this