Click here to Skip to main content
15,881,753 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
IS gpu present in all computer and is it possible to execute an application(Not graphical) completely on GPU?

What I have tried:

if it is possible any sample of code to do it that may be in any languague
Posted
Updated 19-Feb-16 9:19am

Quote:
IS gpu present in all computer
Many Yes, all No.
Quote:
is it possible to execute an application completely on GPU?
The answer is NO because the GPU is a slave processor and don't have access to hardware.
Quote:
is it possible to execute an application (Not graphical) on GPU?
The GPU is tailored for massively parallel calculus, so any part of an app that is heavily parallel can by efficiently off loaded to GPU.
The main CPU simply offload computing on the GPU, nothing else. Simply the GPU being general purpose, it also handle non graphical stuff.

Until the OS directly handle the GPU usage, you will always have something in main CPU to manage I/O and user interaction.
 
Share this answer
 
v4
Comments
Sergey Alexandrovich Kryukov 19-Feb-16 15:21pm    
I hate to say that:
Not only your answer totally wrong, but you tried to answer based on your own lack of awareness of the related technologies. Not only it is possible, but this is also a big field of computing, so their is a good number of professionals working nearly exclusively at such kind of computing, as their main job.

Please see Solution 2.

—SA
[no name] 19-Feb-16 16:30pm    
That is really something hard from your side. I think it would be similar if I asked you before 20 years "is it possible to run an app on a 386 CoProcessor". It was not possible and it is also not possible to run an "app" on a gpu "directly". So the answer here is maybe not perfect but also not "totally wrong" I think. Only my mind.
Bruno
Patrice T 19-Feb-16 17:38pm    
Do you mean "387 CoProcessor" ?
I agree with you, it is what I had in mind for my answer.
[no name] 19-Feb-16 17:42pm    
Yep sorry it is a Long time. The 387 Co for 386 and so on ;)
Sergey Alexandrovich Kryukov 19-Feb-16 17:45pm    
Sorry about that, but this is about what happens today and attempted to answer today, so your past example is not quite adequate to that. If you abstract out from history and information available today, this kind of thinking would be good enough, but not at this moment and reality.

Probably you were talking about 387 co-processor, not 386, when 387 was a slave of 386. That is different architecture where 387 could not run as independently as some GPU can, so the answer "no", "impossible" would be good enough, if answered to your past question. Those things are essentially different.

This is all about answering the question without having not enough expertise in the subject; and this is the kind of mistake many of us do, so it's not so big mistake. Sometimes you answer "from general consideration", and sometimes it can be very useful; your thinking might work and even suggest new approach. In some other cases, you just put yourself in a funny position. So what? It happened to me sometimes, so I got some 2s, too (it happens very often anyway, without any reasons :-). Big deal! I just removed my purely-qualified answers after I was convinced and said "thank you" to the one who criticized me. But there was a number of cases where my "speculations from scratch" made a good useful advice. Still, it's better to be careful and check available resource, Google and consult resources on the topic before trying to answer.

—SA
Not only this is possible, but there is whole field in computing activity called GPGPU: General-purpose computing on graphics processing units — Wikipedia, the free encyclopedia[^].

Of course, this approach is one of the weird paradoxes of technological development in the computing world: the technologies initially designed purely for serving displays are now sometimes used for serving up the general-purpose calculations, providing more computing power than the host system's CPUs. However, in real practice this approach is used in a number of areas. Notably, the application leveraging the power of GPUs, still allow them to show graphics on screen, in parallel to the GPGPU operation.

One of the most used technologies of this sort is NVIDIA CUDA:
CUDA — Wikipedia, the free encyclopedia[^],
Parallel Programming and Computing Platform | CUDA | NVIDIA|NVIDIA[^].

As to the code samples, few code sample from few Quick Answers hardly can help you. You have to learn this field well, to understand how to use it. For CUDA, for example, you can find a lot of material, and even study courses with code samples and homework assignments, like this one: CS 179: GPU Programming[^].

You need to study the subject independently, to a reasonable depth, to be able to ask more specific and qualified questions.

—SA
 
Share this answer
 
v4
Comments
NoorKaximi 27-Nov-16 11:10am    
Thank you very it really helped me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900