Showing posts with label installation. Show all posts
Showing posts with label installation. Show all posts

Thursday, 26 March 2015

General Purpose Programming (GPU Programming)

In this post I am going to describe what is general purpose programming or G.P.U. programming is and why we use it over tradition C.P.U. Programming.

Traditional Programming:

C.P.U. programming is the traditional way of doing programming. In which our program is run on the C.P.U. It was the main part of our program execution. But Due to certain limitation now the trend is shifting towards the general purpose computing or G.P.U. computing.

Limitaions of Traditional Programming:

Because we cannot increase the frequency of the C.P.U. further and adding more number of cores to our system is very costly. How much cores we can afford on our own, 2 ,4, 8 ,16. And it will consume so much power that our system's battery will discharge very quickly. Main reason is we want to speed up our computations as now a days the Size of DATA is increasing rapidly. Our C.P.U computation will not give results as fast as our expectation.

G.P.U.( Graphical Processing Unit) :

G.P.U is the abbreviation for Graphical Processing Unit. Which is integrated to our systems for graphical processing. It is being used for graphical processing on our system for long time. Then some people think , why can't we use G.P.U. in general purpose computing instead of using only graphical processing. A single general Graphic Card or G.P.U. contains nearly 65,535 small processors on single chip. Which can do the arithmetic operations simultaneously.



G.P.U. Programming:

In G.P.U. programming we use the G.P.U to do the arithmetic calculations simultaneously. As I described above that a general G.P.U contains almost 65,535 small A.L.Us. We can write our programme logic in a way that our program can be spawn into parts for running simultaneously.

But G.P.U is not a C.P.U. It generally cannot access our Main Ram which is available for C.P.U. So whatever code we write first goes to C.P.U. Then C.P.U send the data and the programme logic to G.P.U. G.P.U. executes it parallely and again send back the data to C.P.U. By parallising the threads on multiple A.L.Us of G.P.U  we speed up the computation. That can be shown in a huge data set program otherwise the transferring cost of DATA from C.P.U. to G.P.U. will be large than the computation speed up we achieved on those data. 

Like: For sorting 10 elements we will not use G.P.U.
For sorting 100,000 elements we will use G.P.U. So that the cost of transferring data can be overcome by computation speed up.

We are using G.P.U. for doing our general processing so this is called general purpose computing.
It solves the problem which can not be solved by C.P.Us in reasonable time. Like: D.N.A. testing.

Next Question is How to do this Programming ???

Next question is how to do this. How can we interact with the G.P.U. as we interact with C.P.U. So there are some Platforms available which you can start with. These platforms provide APIs for interaction with the G.P.U.

1. CUDA(Compute Universal Device Architecture) developed By NVIDIA.
   You can start with this following link. If you are interested.

2. OPEN CL (Open Computing Language) developed by Khronos group.
    You can start with this following link. If you are interested.

But these are two famous tools for G.P.U Programming . I have worked with both the tools. These are awesome.
How to work with these I will explain in the following posts.

Limitations Of  G.P.U. Programming:

1. But every problem's logic cannot be spawned in to the parallel parts means its difficult to think a problem to solve parallely.

2. Even the single G.P.U. might not be sufficient for the task. So now a days people go for more than the one G.P.U.

3. But having more than one G.P.U. also can be problematic. Imagine the scenario if you have two different G.P.U.s developed by two different companies then how to integrate both of them simultaneously.

The research is going on for the improvement of these limitations. But still G.P.U programming is faster then the C.P.U. programming.

I hope it helps. For more posts, like my page on facebook. The link is given below. Subscribe By Email on the side of the page. Thanks for visiting.




Sunday, 15 March 2015

How to import ns2 in eclipse and start debugging

In this post I am going to describe How to open ns-2 in Eclipse without any make error?

If after installing ns-2 in Eclipse
Error: *****No make target 'all'.stop

1) Error comes because eclipse is not able to find makefile. As the makefile is itself present in ns-allinone-2.35/ns-2.35 folder but it is write-protected and eclipse don't have premissions to read it.

2) Change the permissions of the complete ns-2 folder by following commands
    a)First go to the ns-allione-2.35 folder by using cd command
    b)Then give permissions by "sudo chmod 777 *"
    c)All files permissios in folder will change

3) Now reimport the whole folder in eclipse
Suggestion: change the workspace while importing folder

4) Either change your make target or change the workspace in build configuration because your main makefile is in the ns-2.35 folder but by default it will search in  the main ns-allione-2.35 folder. 
So go to project -> build configuration -> c/c++ -> in workspace browse to the ns-2.35 folder
or 
project -> properties ->c/c++ -> and in workspace browse to the ns-2.35 folder

or

you can type the path for the makefile file in make command like
make -f  path
replace path with where your makefile is in ns-2.35 folder.

then compile it. It will able to compile the ns2.

How to Run your topology from Eclipse for debugging purpose?

In this tutorial "~/ns-allinone-2.35/ns-2.35/tcl/ex/example.tcl" is used.
1- Select Run>>Debug Configurations.
2- In Main Tab>>C/C++ Application, write "ns" without quotation marks.
3- In Arguments Tab>>Program arguments, write "example.tcl" without quotation marks.
4- In Arguments Tab>>Working directory, write "~/ns-allinone-2.35/ns-2.35/tcl/ex/" without quotation marks.
5- In Debugger Tab, uncheck "Stop on start up at main".
6- Click Apply then Debug.

Good luck to all students. If you like this post please like it, share it and comment it. Enjoy and have fun. Visit often for new posts.

Friday, 13 March 2015

Installing unity remote and start testing your app on your android device

In this post I am going to describe how to install unity remote on your device and start working with unity. After doing all the following step you will be able to run all the game on your device directly instead of unity.

I hope you have installed the unity on your computers.
Make Sure you installed google usb driver also using sdkmanager.

1. Go to Play store and download unity remote app for android device.
you can install it from this link.
https://play.google.com/store/apps/details?id=com.unity3d.androidremote&hl=en

Now download the android sdk from the below link to your computer.
http://developer.android.com/sdk/index.html

Make Sure you also installed google usb driver using sdkmanager.
Sdk manager is in the android bundle you have downloaded from the above link.
sdkmanager.exe -> Extras -> google usb driver  tick the check box and click install.

2. Now connect your device to computer using usb cable.

3. Make sure that usb debugging is enable on your device. To enable usb debugging go to settings on  your android device and in settings go to Developer Option and in Developer Option you will find the usb debugging option , Check that check box.

4. Now start unity remote on your android device.

5. Now start unity software in your computer.

NOTE : If you start unity software first in your computer and then unity remote in your android device then your unity software will not pick your unity remote. So whenever you start unity remote in your phone then again restart unity software in your computer.

6.Set the android sdk path in unity software by going in to Edit -> Preferences -> Set Path and browse to the android sdk you already downloaded.

7. Now in unity software go to Edit -> project Setting -> Editor -> Select any android device in that 
Menu.

Now you are done. Whenever you will click play it will play in your android device. 

Enjoy and have fun in developing game.
If you find this post useful please share it on google+ and like this post and comment. Thank you.

Thursday, 12 March 2015

Import CloudSim Simulator in to Eclipse

In this post I am going to describe how to import cloudsim simulator in to Eclipse and start working with it.

First of all we need to download the cloudsim source code. Which you can dowload it from the following address.


If you are working in windows then download the latest .zip file or if you are working in Linux environment download the .tar.gz file.

 Now you will need Eclipse IDE to open cloudsim project. You can download the Eclipse from this link.

After downloading and installing Eclipse. Open the Eclipse and follow the below procedure.

 1. Go to File menu in the top left corner of Eclipse.

 2 . Create a new folder using new and then folder, name it whatever you want. We will use this   folder for importing cloudsim later on.

 3. Then go to import option in file menu.

 4. Select Archive File in General Option and click on Next.


Select the Archive File and click Next
5. Now browse that compressed file which you have downloaded for cloudsim. Which may be look like this.
Cloudsim-3.0.3.tar.gz or Cloudsim-3.0.3.zip

Click on Open. It will ask you to select folder. Select the folder which we made on the second step.
Then click on finish. It will take some time to import all the files.

You can access all the resources of cloudsim by going to this folder.
In further posts I will describe How to work with cloudsim simulator.

Till than have fun. And don't hesitate to comment If you have any doubt. May be I can help.



Wednesday, 11 March 2015

Installing Android Studio and Deploy App on USB connected Android Device Instead of Emulator

In this post I am going to describe how to install Android Studio and make it work with your android device directly. The app will run directly on your android device which is connected using usb cable. If you don't have an android device than you can test your app on emulator. But Emulator is too slow to work with. If you have any android device( having min. android version ) can be used instead of emulator. That would be very much faster instead of working with emulator.


Installation:


1. First of we will see whether your system meet all the requirements which Android Studio needs.
   Visit this link to see the requirement.(depending which Operating System you are using)

2. If you meet all the hardware requirements, make sure that you have the latest version of java jdk and jre installed on your system. 

Note: The latest (till date) Android Studio needs java jdk7 or higher version.

You can download and install Java jdk and jre from the site below.

3. Now if you installed new java jdk and jre then set the environment variable PATH( in windows specifically) to the path where you have installed that jdk and jre.


 start(right click) -> system -> system advance setting ->advance -> environment variable

Set PATH Variable in Windows
If you have other than windows operating system you can search on google "how to set path variable for java jdk".

4. Now you are ready to install Android studio. Download it from the official website.


5. After downloading you will have the Android Studio adt bundle in your downloads.
                  android-studio-bundle-xxx.xxxxxxx.exe
         xxx.xxxxxxx will be your version which you have downloaded.

 click on it(for windows) and setup will start. It will ask simple things where you want to install ,language etc. go through it and install it. It will take little time. This process is easy.

Your android studio is installed . You can start developing android app but for changing the setting of the emulator to change it to your device go through the next process.

Setting your android device as default for running app instead of emulator:


1. First of all you will need an android device with min. android OS version(whichever you will  use  for developing app).

2. You need to download adb driver for your device. It is specific to every device. So search on google.
Download and install adb driver for your device.

3. You need to enable usb debugging in your phone. In older version(less than 4.2) there will be an option for developer in settings or application settings. Click on it you will get an option usb debugging.  Check that check box.

If you have android device having version 4.2 or higher go to settings -> about phone -> tap the build number 7 times.
Now go back to settings, you will find a developer option there. In which you will find the option for usb debugging.

Of course you have your phone is connected to system using usb.

Now your phone is ready. Just make a single change to android studio settings.

Changing Setting in Android Studio:



Near the button which is used to run the app a rotated green triangle in the following image. You will see a dropdown(app is written in the image) in which go to edit configuration and in Android Application go to app and general and set target device as usb. Following photo shows the Exact setting

Changing Setting in Android Studio


Now click on apply and ok. Attach your phone with usb. Restart Android Studio. Now whenever you run any app in Android Studio. It will be automatically deploy to your device instead of emulator. It is very much faster than the emulator.

I hope it helps. If you have any problems or queries do not hesitate to comment. May be I can help.
Till then enjoy developing your app.

Related Posts

Related Posts Plugin for WordPress, Blogger...