simplest programming environment (editor) for Cuda?
  1 / 2    
Hi all,

Actually, perhaps the topic should say simplest programming environment for CUDA (editor that is easy to compile CUDA with).

I'm wanting to mess around with CUDA a bit, and from the looks of the sample code, it seems like modifying some of that code should be easy. I've also looked around online and seen several tutorials that even I understand!

I know Java, C, PHP, and a bit of C++. However, i do not consider myself a great programmer by any standards. When i program, i'm always using Dev C++ or Jgrasp for Java. I use their built in compilers, and as such, i never need to worry about various (aka technical) build instructions or command line instructions.

So basically, is there a way i can work with CUDA in a simple manner? Just like Dev C++ is to C or to C_++, is there any programming environment made for CUDA (meaning an easy editor).

I've tried to use MSVS2005 with CUDA 2.0 and have received NUMEROUS errors. I've never been able to build any program. I tried to search for solutions and edit some of the settings, put perhaps this is beyond me.?.

After installing CUDA, i was ideally sexpecting to be able to simply open up one of the sample programs, "build" it and have it run. I didn't even get close. But this could be because i have ZERO experience with Visual Studio.

So can anyone help me out here. Supposedly release 2.1 allows one to use MSVS2008. Does this help any? Are things easier?

Is there some tutorial that shows me how to simply compile and then run CUDA programs?

Thanks for all your help.
Hi all,



Actually, perhaps the topic should say simplest programming environment for CUDA (editor that is easy to compile CUDA with).



I'm wanting to mess around with CUDA a bit, and from the looks of the sample code, it seems like modifying some of that code should be easy. I've also looked around online and seen several tutorials that even I understand!



I know Java, C, PHP, and a bit of C++. However, i do not consider myself a great programmer by any standards. When i program, i'm always using Dev C++ or Jgrasp for Java. I use their built in compilers, and as such, i never need to worry about various (aka technical) build instructions or command line instructions.



So basically, is there a way i can work with CUDA in a simple manner? Just like Dev C++ is to C or to C_++, is there any programming environment made for CUDA (meaning an easy editor).



I've tried to use MSVS2005 with CUDA 2.0 and have received NUMEROUS errors. I've never been able to build any program. I tried to search for solutions and edit some of the settings, put perhaps this is beyond me.?.



After installing CUDA, i was ideally sexpecting to be able to simply open up one of the sample programs, "build" it and have it run. I didn't even get close. But this could be because i have ZERO experience with Visual Studio.



So can anyone help me out here. Supposedly release 2.1 allows one to use MSVS2008. Does this help any? Are things easier?



Is there some tutorial that shows me how to simply compile and then run CUDA programs?



Thanks for all your help.

#1
Posted 03/03/2009 08:26 PM   
Mind you, i'm not even experienced with MSVS 2008 either. Just don't want anyone to think i know that program. I've never used it.

But perhaps it, or some other program, is user friendly for compiling and running CUDA programs.?.
Mind you, i'm not even experienced with MSVS 2008 either. Just don't want anyone to think i know that program. I've never used it.



But perhaps it, or some other program, is user friendly for compiling and running CUDA programs.?.

#2
Posted 03/03/2009 08:59 PM   
Personally, I use Eclipse with the C / C++ toolkit ... it's only so-so for [i]building[/i], but for writing CUDA programs it's quite nice. It's good at understanding sources and figuring out what comes from which header and jumping around in code etc.
Personally, I use Eclipse with the C / C++ toolkit ... it's only so-so for building, but for writing CUDA programs it's quite nice. It's good at understanding sources and figuring out what comes from which header and jumping around in code etc.

#3
Posted 03/03/2009 10:56 PM   
Textmate works fine on a Mac.
Textmate works fine on a Mac.

#4
Posted 03/04/2009 02:45 AM   
I used to have Windows XP Pro x64, with the older 2.0 release of CUDA, and I had tons of errors with VS2005. Since then, I've switched to Vista Business x64, CUDA 2.1, and VS2008, and haven't had any problems. Just make sure after you install the toolkit and the SDK, that you do the following:

- Open "My Computer" (or explorer, or whatever) and navigate to C:\ProgramData\NVIDIA Corporation\NVIDIA CUDA SDK\common
- Double-click on cutil_vc90.sln (assuming you're using CUDA 2.1 and VS2008); when the solution loads up, you will see a drop-down menu for the build configuration. If you are on a 64-bit platform, you need to change this from [b]Win32[/b] to [b]x64[/b].
- Build the solution.
- Look up top again -- you should see the build configuration menu that says "Debug". Change it to "Release" and build the solution again.
- Close Visual Studio.
- Back in the explorer window, find the file "paramgl_vc90.sln". Double-click it to open that solution.
- Repeat the same configuration setup and build process as described above, then close Visual Studio.

At this point, you should be able to compile the SDK projects; if you are using VS2008, make sure you open the solutions ending in _vc90.sln. Again, if you're on x64, you need to also make sure to set the build platform to "x64" in that drop-down menu.

If you get this far, and you're ready to write your own projects, check out the "template" project that comes with the SDK. You should be able to make a copy of that and use it for your own stuff, with the compiler settings (for CUDA, that is) already set up.
I used to have Windows XP Pro x64, with the older 2.0 release of CUDA, and I had tons of errors with VS2005. Since then, I've switched to Vista Business x64, CUDA 2.1, and VS2008, and haven't had any problems. Just make sure after you install the toolkit and the SDK, that you do the following:



- Open "My Computer" (or explorer, or whatever) and navigate to C:\ProgramData\NVIDIA Corporation\NVIDIA CUDA SDK\common

- Double-click on cutil_vc90.sln (assuming you're using CUDA 2.1 and VS2008); when the solution loads up, you will see a drop-down menu for the build configuration. If you are on a 64-bit platform, you need to change this from Win32 to x64.

- Build the solution.

- Look up top again -- you should see the build configuration menu that says "Debug". Change it to "Release" and build the solution again.

- Close Visual Studio.

- Back in the explorer window, find the file "paramgl_vc90.sln". Double-click it to open that solution.

- Repeat the same configuration setup and build process as described above, then close Visual Studio.



At this point, you should be able to compile the SDK projects; if you are using VS2008, make sure you open the solutions ending in _vc90.sln. Again, if you're on x64, you need to also make sure to set the build platform to "x64" in that drop-down menu.



If you get this far, and you're ready to write your own projects, check out the "template" project that comes with the SDK. You should be able to make a copy of that and use it for your own stuff, with the compiler settings (for CUDA, that is) already set up.

GPU.NET: Write your GPU code in 100% pure C#.

Learn more at tidepowerd.com, and download a free 30-day trial of GPU.NET. Follow @tidepowerd for release updates.



GPU.NET example projects

#5
Posted 03/04/2009 03:32 AM   
[quote name='profquail' post='513354' date='Mar 3 2009, 10:32 PM']I used to have Windows XP Pro x64, with the older 2.0 release of CUDA, and I had tons of errors with VS2005. Since then, I've switched to Vista Business x64, CUDA 2.1, and VS2008, and haven't had any problems. Just make sure after you install the toolkit and the SDK, that you do the following:

- Open "My Computer" (or explorer, or whatever) and navigate to C:\ProgramData\NVIDIA Corporation\NVIDIA CUDA SDK\common
- Double-click on cutil_vc90.sln (assuming you're using CUDA 2.1 and VS2008); when the solution loads up, you will see a drop-down menu for the build configuration. If you are on a 64-bit platform, you need to change this from [b]Win32[/b] to [b]x64[/b].
- Build the solution.
- Look up top again -- you should see the build configuration menu that says "Debug". Change it to "Release" and build the solution again.
- Close Visual Studio.
- Back in the explorer window, find the file "paramgl_vc90.sln". Double-click it to open that solution.
- Repeat the same configuration setup and build process as described above, then close Visual Studio.

At this point, you should be able to compile the SDK projects; if you are using VS2008, make sure you open the solutions ending in _vc90.sln. Again, if you're on x64, you need to also make sure to set the build platform to "x64" in that drop-down menu.

If you get this far, and you're ready to write your own projects, check out the "template" project that comes with the SDK. You should be able to make a copy of that and use it for your own stuff, with the compiler settings (for CUDA, that is) already set up.[/quote]
Alright! Seems like we're getting somewhere now.

Let me add some details. I'm using 32 bit Vista Ultimate. I have not installed either MSVS2008 or CUDA 2.1. But i'm guessing from your response (above) that you feel i should be okay doing this.?.

Building and running should be straightforward.?.

If so, i can download them and install tomorrow.
[quote name='profquail' post='513354' date='Mar 3 2009, 10:32 PM']I used to have Windows XP Pro x64, with the older 2.0 release of CUDA, and I had tons of errors with VS2005. Since then, I've switched to Vista Business x64, CUDA 2.1, and VS2008, and haven't had any problems. Just make sure after you install the toolkit and the SDK, that you do the following:



- Open "My Computer" (or explorer, or whatever) and navigate to C:\ProgramData\NVIDIA Corporation\NVIDIA CUDA SDK\common

- Double-click on cutil_vc90.sln (assuming you're using CUDA 2.1 and VS2008); when the solution loads up, you will see a drop-down menu for the build configuration. If you are on a 64-bit platform, you need to change this from Win32 to x64.

- Build the solution.

- Look up top again -- you should see the build configuration menu that says "Debug". Change it to "Release" and build the solution again.

- Close Visual Studio.

- Back in the explorer window, find the file "paramgl_vc90.sln". Double-click it to open that solution.

- Repeat the same configuration setup and build process as described above, then close Visual Studio.



At this point, you should be able to compile the SDK projects; if you are using VS2008, make sure you open the solutions ending in _vc90.sln. Again, if you're on x64, you need to also make sure to set the build platform to "x64" in that drop-down menu.



If you get this far, and you're ready to write your own projects, check out the "template" project that comes with the SDK. You should be able to make a copy of that and use it for your own stuff, with the compiler settings (for CUDA, that is) already set up.

Alright! Seems like we're getting somewhere now.



Let me add some details. I'm using 32 bit Vista Ultimate. I have not installed either MSVS2008 or CUDA 2.1. But i'm guessing from your response (above) that you feel i should be okay doing this.?.



Building and running should be straightforward.?.



If so, i can download them and install tomorrow.

#6
Posted 03/05/2009 06:56 AM   
Also, is there any reason why a person cannot simply use notepad and then build/run from the command line? Sorry if this is a stupid question. But in the same way that i can compile java programs from the command line, can i compile CUDA programs this way and simply use notepad as my editor?

If so, why all the fuss with MSVS? Is it SOOO amazing or so helpful? Again, i've NEVER used it at all...so i'm unaware of the benefits.

Thanks.
Also, is there any reason why a person cannot simply use notepad and then build/run from the command line? Sorry if this is a stupid question. But in the same way that i can compile java programs from the command line, can i compile CUDA programs this way and simply use notepad as my editor?



If so, why all the fuss with MSVS? Is it SOOO amazing or so helpful? Again, i've NEVER used it at all...so i'm unaware of the benefits.



Thanks.

#7
Posted 03/05/2009 07:08 AM   
[quote name='cazint' post='513878' date='Mar 5 2009, 07:08 AM']Also, is there any reason why a person cannot simply use notepad and then build/run from the command line?[/quote]

IDEs have 1) Autocompletion, 2) syntax coloring, 3) live syntax error detection, 4) source navigation ... etc. It's a matter of convenience, but so great convenience that it is comparable to living in a house vs. living in a tent.
[quote name='cazint' post='513878' date='Mar 5 2009, 07:08 AM']Also, is there any reason why a person cannot simply use notepad and then build/run from the command line?



IDEs have 1) Autocompletion, 2) syntax coloring, 3) live syntax error detection, 4) source navigation ... etc. It's a matter of convenience, but so great convenience that it is comparable to living in a house vs. living in a tent.

#8
Posted 03/05/2009 11:25 AM   
[quote name='cazint' post='513875' date='Mar 5 2009, 12:56 AM']Alright! Seems like we're getting somewhere now.

Let me add some details. I'm using 32 bit Vista Ultimate. I have not installed either MSVS2008 or CUDA 2.1. But i'm guessing from your response (above) that you feel i should be okay doing this.?.

Building and running should be straightforward.?.

If so, i can download them and install tomorrow.[/quote]

I imagine you'll be fine. You can also skip the part about building the x64 binaries, since those won't apply to you. Install MSVS2008, the CUDA 2.1 driver, the CUDA Toolkit, and the CUDA SDK (in that order), then build the projects as directed above, and that should be it.
[quote name='cazint' post='513875' date='Mar 5 2009, 12:56 AM']Alright! Seems like we're getting somewhere now.



Let me add some details. I'm using 32 bit Vista Ultimate. I have not installed either MSVS2008 or CUDA 2.1. But i'm guessing from your response (above) that you feel i should be okay doing this.?.



Building and running should be straightforward.?.



If so, i can download them and install tomorrow.



I imagine you'll be fine. You can also skip the part about building the x64 binaries, since those won't apply to you. Install MSVS2008, the CUDA 2.1 driver, the CUDA Toolkit, and the CUDA SDK (in that order), then build the projects as directed above, and that should be it.

GPU.NET: Write your GPU code in 100% pure C#.

Learn more at tidepowerd.com, and download a free 30-day trial of GPU.NET. Follow @tidepowerd for release updates.



GPU.NET example projects

#9
Posted 03/05/2009 03:09 PM   
The simpliest is notepad under Linux + the command line :

nvcc -o executable source.cu /yes.gif' class='bbc_emoticon' alt=':yes:' />
The simpliest is notepad under Linux + the command line :



nvcc -o executable source.cu /yes.gif' class='bbc_emoticon' alt=':yes:' />

#10
Posted 03/05/2009 04:44 PM   
[quote name='profquail' post='514041' date='Mar 5 2009, 10:09 AM']I imagine you'll be fine. You can also skip the part about building the x64 binaries, since those won't apply to you. Install MSVS2008, the CUDA 2.1 driver, the CUDA Toolkit, and the CUDA SDK (in that order), then build the projects as directed above, and that should be it.[/quote]
Okay. Good deal. I'm now running MSVS2008 (did not load SP1 yet), and loaded in the order you specified. It WORKS!

I can finally simply open up a 2008 MSVS Solution file (bandwidth solution, for example), and it builds properly. Is there a way to run it within MSVS2008? I could not find that, so i simply navigated to the folder (via My Computer) and double clicked the newly generated executable file.

But bottom line, i am now able to proceed.

Now on to tutorials...
[quote name='profquail' post='514041' date='Mar 5 2009, 10:09 AM']I imagine you'll be fine. You can also skip the part about building the x64 binaries, since those won't apply to you. Install MSVS2008, the CUDA 2.1 driver, the CUDA Toolkit, and the CUDA SDK (in that order), then build the projects as directed above, and that should be it.

Okay. Good deal. I'm now running MSVS2008 (did not load SP1 yet), and loaded in the order you specified. It WORKS!



I can finally simply open up a 2008 MSVS Solution file (bandwidth solution, for example), and it builds properly. Is there a way to run it within MSVS2008? I could not find that, so i simply navigated to the folder (via My Computer) and double clicked the newly generated executable file.



But bottom line, i am now able to proceed.



Now on to tutorials...

#11
Posted 03/09/2009 04:08 PM   
Previously, I've seen and read through the following tutorial at Dr. Dobbs:
[url="http://www.ddj.com/cpp/207200659"]http://www.ddj.com/cpp/207200659[/url]

It's pretty basic but goes through the process nicely. Now that i'm up and finally able to build these predone solutions, i was expecting to be able to simply make a new BLANK file in MSVS and then cut and paste the first CU program, shown on that website, into this CU file. I thought i could do this, and then build.?.

Apparently not.?.

Again, i have zero knowledge of MSVS, and no doubt, that is one of the many bottlenecks here.

I'm guessing i need to make a new project file, but when i do so, it asks for what project type (Visual C, C#, C++, etc), and upon selecting one of them, it loads up a project with several header files, several src files, etc. I'm guessing this is the wrong direction to go in?

So then i turn to the files given in the CUDA SDK, specifically the template file. So i load up that solution, and it thankfully only has the CU file as part of the solution...nothing else.

BUT, there's a good bit of "stuff" already in that CU file.

So, bottom line, how do i make this happen. I want to run through the examples on the tutorial website (given above). The first example makes PERFECT sense to me. But how do i make a new file/project and run this thing in MSVS?

Thanks for your patience.
Previously, I've seen and read through the following tutorial at Dr. Dobbs:

http://www.ddj.com/cpp/207200659



It's pretty basic but goes through the process nicely. Now that i'm up and finally able to build these predone solutions, i was expecting to be able to simply make a new BLANK file in MSVS and then cut and paste the first CU program, shown on that website, into this CU file. I thought i could do this, and then build.?.



Apparently not.?.



Again, i have zero knowledge of MSVS, and no doubt, that is one of the many bottlenecks here.



I'm guessing i need to make a new project file, but when i do so, it asks for what project type (Visual C, C#, C++, etc), and upon selecting one of them, it loads up a project with several header files, several src files, etc. I'm guessing this is the wrong direction to go in?



So then i turn to the files given in the CUDA SDK, specifically the template file. So i load up that solution, and it thankfully only has the CU file as part of the solution...nothing else.



BUT, there's a good bit of "stuff" already in that CU file.



So, bottom line, how do i make this happen. I want to run through the examples on the tutorial website (given above). The first example makes PERFECT sense to me. But how do i make a new file/project and run this thing in MSVS?



Thanks for your patience.

#12
Posted 03/09/2009 04:15 PM   
Let me add, that I've tried to make a "New -> File" and then i simply choose text file from the options. I then paste the aforementioned tutorial code into this blank document, and then i save as test.cu. So it is NOT text file.

However, how do i then compile and run this cu file within MSVS?

Thanks.
Let me add, that I've tried to make a "New -> File" and then i simply choose text file from the options. I then paste the aforementioned tutorial code into this blank document, and then i save as test.cu. So it is NOT text file.



However, how do i then compile and run this cu file within MSVS?



Thanks.

#13
Posted 03/09/2009 04:23 PM   
[quote name='cazint' post='515868' date='Mar 9 2009, 10:08 AM']I can finally simply open up a 2008 MSVS Solution file (bandwidth solution, for example), and it builds properly. Is there a way to run it within MSVS2008? I could not find that, so i simply navigated to the folder (via My Computer) and double clicked the newly generated executable file.[/quote]

In VS2008, either hit the "Play" button (a green arrow in the toolbar) or go to the Debug menu, then Debug. Or, just to run it, go to the Debug menu and then Start Without Debugging. If you want to run it on the actual GPU, make sure that your build mode is not set to one of the "Emu____" options (up in the toolbar).
[quote name='cazint' post='515868' date='Mar 9 2009, 10:08 AM']I can finally simply open up a 2008 MSVS Solution file (bandwidth solution, for example), and it builds properly. Is there a way to run it within MSVS2008? I could not find that, so i simply navigated to the folder (via My Computer) and double clicked the newly generated executable file.



In VS2008, either hit the "Play" button (a green arrow in the toolbar) or go to the Debug menu, then Debug. Or, just to run it, go to the Debug menu and then Start Without Debugging. If you want to run it on the actual GPU, make sure that your build mode is not set to one of the "Emu____" options (up in the toolbar).

GPU.NET: Write your GPU code in 100% pure C#.

Learn more at tidepowerd.com, and download a free 30-day trial of GPU.NET. Follow @tidepowerd for release updates.



GPU.NET example projects

#14
Posted 03/09/2009 07:34 PM   
[quote name='cazint' post='515874' date='Mar 9 2009, 10:23 AM']Let me add, that I've tried to make a "New -> File" and then i simply choose text file from the options. I then paste the aforementioned tutorial code into this blank document, and then i save as test.cu. So it is NOT text file.

However, how do i then compile and run this cu file within MSVS?

Thanks.[/quote]

Basically, you're going to want to copy the template project folder out of the SDK, and then open the copy in VS. The reason being, that (obviously) by default, VS2008 uses it's own compiler. To compile a CUDA project, there are extra build steps (use the CUDA compiler for the .cu files), which need to be set up in each project you create -- so to save time, it's much faster to use the template project. Just make sure that you take out any headers/functions which are not necessary to run _your_ code. Then, you can add extra .cu files, or whatever to the project as needed.
[quote name='cazint' post='515874' date='Mar 9 2009, 10:23 AM']Let me add, that I've tried to make a "New -> File" and then i simply choose text file from the options. I then paste the aforementioned tutorial code into this blank document, and then i save as test.cu. So it is NOT text file.



However, how do i then compile and run this cu file within MSVS?



Thanks.



Basically, you're going to want to copy the template project folder out of the SDK, and then open the copy in VS. The reason being, that (obviously) by default, VS2008 uses it's own compiler. To compile a CUDA project, there are extra build steps (use the CUDA compiler for the .cu files), which need to be set up in each project you create -- so to save time, it's much faster to use the template project. Just make sure that you take out any headers/functions which are not necessary to run _your_ code. Then, you can add extra .cu files, or whatever to the project as needed.

GPU.NET: Write your GPU code in 100% pure C#.

Learn more at tidepowerd.com, and download a free 30-day trial of GPU.NET. Follow @tidepowerd for release updates.



GPU.NET example projects

#15
Posted 03/09/2009 07:37 PM   
  1 / 2    
Scroll To Top