Monday, June 25, 2012

How I Installed CUDA on my PC


Platform: Windows 7 (32 bit)
CUDA Hardware: None yet, will use simulator till then.

1 Prologue
      Before you start, get a clear idea about CUDA and its features from here.

2 Installation
2.1 Software setups
Basic step is to download the latest SDK and to choose an appropriate Toolkit according to your hardware’s compute capability. Download links are given here.
If you don’t have the hardware yet, you will need to use the emulator to compile and run programs (covered here). The emulator was however deprecated in the 3.x updates. Hence you need to download CUDA Toolkit 2.3 from here.

2.2  Installation Steps
Thankfully for windows, no post-installation configuration is required. Just run the setups and install-away.


3      Choose your language: C\C++
3.1 C++
Visual Studio will be used for C++ development for convenience. Express versions can be downloaded and registered for no cost. Or check with your countries IEEE MSDNAA alliance website if you are a member.
(If other, better IDE’s now have compatibility with CUDA; please notify me in the comments)
Downloads:
CUDA VS WIZARD (Win 32) 2.00 (or latest version)
  
3.2 C
C is best used on Linux or a native Linux environment. For windows users, the limited capability offered by the command line is satisfactory in this context. No separate setup is needed as the environment variables are already in place and CUDA’s compiler; nvcc can be invoked from the command line directly.

3.3 Java
I am, as of now, not committed to the idea of using Java for CUDA programs. But for reference, please go to this site.

After these steps have been completed, you are now ready to compile and execute CUDA programs.

CUDA Emulator

The CUDA emulator is a software that duplicates (or emulates) the functions of a computer system with a CUDA-enabled card in a computer system with no such hardware, so that the emulated behavior closely resembles the behavior of the real system. This software package is mainly aimed to empower developers and students who do not have access to Nvidia GPU's.


Initially, the CUDA Toolkit came with an emulator "built into" the CUDA compilor; "nvcc". Later, from versions after 3.0, the emulator was dropped. The last version that supports the emulator is v2.3, and can be downloaded from the CUDA Toolkit archives here.


But thankfully, several third parties have contributed to produce several emulation options that will be listed in this space shortly.

What is CUDA?


The article serves as a prologue for beginners. Please note that this is a primer not a tutorial, tutorials will follow.

CUDA (Compute Unified Device Architecture) is a parallel processing architecture that gives developers the ability to process their applications on CUDA-enabled processors. Basically it provides “us” the ability to process parallely, not just the CPU. The CPU and GPU are treated as separate devices with their own address space and memory. Actual processing is delegated to the GPU via a costly memory transfer between the CPU and GPU. After the job is finished, the result is transferred back to CPU for output to user.

One of the main implications of CUDA is that algorithms can now be split and processed on multiple processing units (called CUDA cores) to achieve excellent performance. This feature promises to add some viability to otherwise redundant or unfeasibly slow algorithms.
CUDA cores are processing units with their own memory as well as access to a shared global memory of the GPU. Each of these “cores” is a powerful processor in itself and can execute many threads collectively. Threads are the smallest execution unit of a program and are created\coded to suit the algorithm being processed.

In terms of software, parallel processed code is written using extensions to C\C++\Java, the favorite among developers being “extended C” due to its simplicity. Other languages can\will support CUDA via separately written libraries (for example: jCUDA for Java).  

In terms of hardware, CUDA needs to be run using CUDA-enabled GPU’s. These devices come with hundreds of CUDA cores, a fundamental requirement to run code written for CUDA. NVIDIA provides a list of all CUDA-enabled GPU’s here.

For a detailed theoretical explanation, you may now move on to Wikipedia (here) and then to NVIDIA Documentation provided with the SDK.

Wednesday, February 16, 2011

Using UML in Projects

Well the obvious question by any fresh student\developer is not how but WHY??? UML is used extensively in project development as a general programming practice, where you pictorially represent your entire project as a series of diagrams.


What is UML?
Seriously if you're still searching then I'd suggest Wikipedia. the most apt definition i found was:
The Unified Modeling Language (UML) is a standard  language for specifying, visualizing, constructing, and documenting the artifacts of software systems, as well as for business modeling and other non-software systems. The UML represents a collection of best engineering practices that have proven successful in the modeling of large and complex systems.
Now lets proceed to why we as students\developers should use it more often.


1) Everyone needs a plan
Thinking of starting without a plan? Well we are not cowboys, nor are we experienced that much, a plan will certainly help keep track of project progress. Also, a well structured plan can be verified, evaluated, and improved in the very initial stages without even having to make those obvious mistakes. Besides this the diagrams let you know exactly where you are and what you need to do next.


2) Ease of understanding
Software projects tend to get lengthy and boring. Class Diagrams will definitely help understand the project code better than a hundred page source-code booklet. UML helps you show the scope, depth and size of the project in simple diagrams. Any level of detail can be incorporated into the pictorials to ease understanding. 


3) Explain to "others"
It is simple to show how a project operates or how to proceed while making it using Use-case diagrams. Others simply have to put themselves in place of the "actor" and they have a plan of action that tells them how to operate.


4) Document Assets
Any software requires good documentation to support it. Both User Manuals and Developer manuals mark the beginning of a support and maintainance relationship that must continue long after sale, both for corporate and open source products. UML diagrams in documentation bring both transparency and clarity and reduces dependence on rather obtuse source code.


5) Re-Usability
Any reboot\restart\retry will require a new approach firmly rooted to the last one. Hence the use of UML retains the very essence of that process used. Also, it is pretty simple to edit existing models and modify them to match new requirements.


6) Universal
UML standards are universally accepted. People might not know the programming language used or whether it was object oriented or procedure centric but they definitely will understand the UML part of your documentation.


7) Further Development
Models can be isolated, segmented, and edited individually, allowing for branching into several projects. Large projects can be decomposed and utilized by many people for their applications.


Some Important Softwares(Opensource)
1) StarUML
2) ArgoUML

Saturday, January 29, 2011

IEEE - AIYEHUM 2011

IEEE Bangalore is organizing AIYEHUM 2011, or The All India Young Engineers’ Humanitarian Challenge to encourage students to solve real world problems and promote their ideas by providing all necessary means to implement them. These projects will be judged on the basis of their impact on humanity and their creativity, and several other factors like sustainability and cost.



Summary of events:

  • Proposals are invited from the students of India to solve Humanitarian Challenges.
  • Mentors from both Industry and Academia will be provided to guide selected teams implement their ideas for about 3 months.
  • The projects will be published on the IEEE Humanitarian Technology Network – www.ieeehtn.org 
  • The winners to be awarded with prizes and certificates.


Eligibility:
  • Challenge is open to all, both IEEE and non-IEEE members from UG/PG courses enrolled in technical colleges in India.
  • Teams will have minimum of 2 to up-to 4 members.
  • If a project is granted funds, teams must include an IEEE Student Member in the lead role, other team members are preferred to be IEE Student members but not mandatory. [All team members must be at least 18 years of age.].



Proposal submission:
Proposals must be submitted using the form provided on:




Important Deadlines:
Proposal submission: 01 March 2011
Notification: 10 March 2011
Initial progress report: 10 April 2011
Intermediate progress report: 30 May 2011
Final report: 01 July 2011

Please visit the Official Website  for more details...

Sourceforge.net attacked!

This was a direct attack to Open Source website sourceforge.net that hosts opensource projects made by anyone interested in making such projects. On Wednesday, the website reported exploit of several servers and fears compromise of user passwords. Hence all users have been asked to renew their passwords via the link:


Besides this, many developer-centric services were shut down to prevent data integrity. Mainly people reported that their file editing system was not working. The following services have been shut-down to prevent further damage:

* CVS Hosting
* ViewVC (web based code browsing)
* New Release upload capability
* Interactive Shell services
It was truly outrageous of some people to attack an open-source project in a world where anything else costs too much for individual PC users. Meanwhile, SF is busy identifying the attack's source.

Wednesday, January 26, 2011

Google Summer of CodeTM 2011

While surfing i came across this completely amazing concept by google, actually just another to add to their existing list of ideas. Eventually I also felt the need to promote this. Imagine being paid to express your coding abilities on open-source environments, i.e. to be paid stipends to work on open source programs.

An excellent opportunity for college students to gain experience on coding as well as get paid to do it, things just couldn't get better, heres an excerpt from their website.

"About Google Summer of Code

Google Summer of Code (GSoC) is a global program that offers student developers stipends to write code for various open source software projects. We have worked with several open source, free software, and technology-related groups to identify and fund several projects over a three month period. Since its inception in 2005, the program has brought together over 4,500 students and more than more than 4,000 mentors & co-mentors from over 85 countries worldwide, all for the love of code. Through Google Summer of Code, accepted student applicants are paired with a mentor or mentors from the participating projects, thus gaining exposure to real-world software development scenarios and the opportunity for employment in areas related to their academic pursuits. In turn, the participating projects are able to more easily identify and bring in new developers. Best of all, more source code is created and released for the use and benefit of all."