flat assembler
Message board for the users of flat assembler.

Index > Heap > What is exactly the function of the GPU?

Author
Thread Post new topic Reply to topic
A$M



Joined: 29 Feb 2012
Posts: 94
A$M
Considering only 3D graphics, what are the functions of the GPU and the functions of the CPU? Feel free to say what you think, even if not sure.
Post 12 Dec 2013, 18:38
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1180
Location: Unknown
HaHaAnonymous
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 19:04; edited 1 time in total
Post 12 Dec 2013, 19:02
View user's profile Send private message Reply with quote
A$M



Joined: 29 Feb 2012
Posts: 94
A$M
HaHaAnonymous wrote:
Actually, the CPU can do anything the GPU can. But the GPU is just much faster at doing what it was created for than the CPU.

That's the reason for having a GPU.

Not sure. I can be wrong.


Thanks, but yes, I know that. My question is, to explain better: for example, in OpenGL, what USUALLY is attributed to the CPU and what is usually attributed to the GPU?
Post 12 Dec 2013, 19:08
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 730
tthsqe
well, I think the capabilities of intel's cpu's are well know. As for opengl, there is a lot of flexibility with the vertex and fragment shaders. The sky is the limit if you can phrase your computations/graphics in terms of these. CUDA also seems to be great as well, but the nvidia gpu's I know SUCK in double precision. A well-crafted and vectorized piece of code for intel's quad cores are about as good as CUDA in double precision on a nice consumer gpu.
Post 12 Dec 2013, 19:43
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel
A$M wrote:
what USUALLY is attributed to the CPU and what is usually attributed to the GPU?

The basic idea is that the CPU generates the tris and the GPU renders the textures and everything that modifies/interacts with them (light, shades, special effects).
Post 12 Dec 2013, 20:06
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1180
Location: Unknown
HaHaAnonymous
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 19:04; edited 1 time in total
Post 12 Dec 2013, 20:54
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 730
tthsqe
Haha, I challenge you to write a sudoku solver for the GPU Laughing
Post 12 Dec 2013, 23:57
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1180
Location: Unknown
HaHaAnonymous
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 19:04; edited 1 time in total
Post 12 Dec 2013, 23:59
View user's profile Send private message Reply with quote
A$M



Joined: 29 Feb 2012
Posts: 94
A$M
I read that the GPU is a CPU optimized to make the necessary calculations with greater speed. The GPU does almost everything alone, or only do calculations such as addition, subtraction, multiplication, division, addition of vectors, subtraction of vectors, scalar product, and so on... for the API do the rest? I've studied a lot about how 3D works, but do not understand it yet.
Post 13 Dec 2013, 00:11
View user's profile Send private message Reply with quote
gens



Joined: 18 Feb 2013
Posts: 161
gens
from what i got till now

yes, more or less
the (modern) gpu is a lot of simple cores that can do (almost) only math things
there are some parts of it that are still specialized like texture units and some passes on the geometry (maybe some more idk about)
also the Z-buffer

the cpu prepares what needs to be done by compiling simple programs to run on the gpu (shaders or compute kernels)
cpu also prepares the material by managing buffers in main memory and, when needed, in gpu memory

in games the cpu also does the first passes in culling (back-face is done on the gpu)
like scene management that im scratching my head about lately as it can get complicated

so ye, a massive SIMD chip with some addons

thats about as far as i got in it
older gpu design is all hardcoded
Post 13 Dec 2013, 01:39
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 730
tthsqe
A$M, the best way to learn about your gpu is to write a program for it. Do you have ATI or Nvidia?
Post 13 Dec 2013, 05:31
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 9002
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
i was thinking the GPU is a macro for several groups of CPU instructions,

then they decide a separate load with specialize hardware to compact 100 CPU instructions into 20 GPU instructions using specialize hardware inside graphic card.

maybe soon, GPU with SATA I/O =) USB port, to replace traditional CPU.
Post 13 Dec 2013, 10:45
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1180
Location: Unknown
HaHaAnonymous
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 19:03; edited 1 time in total
Post 13 Dec 2013, 11:27
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4240
Location: 2018
edfed
HaHaAnonymous wrote:
Quote:

to replace traditional CPU.

Well, they are doing the opposed (e.g.: Intel and AMD putting GPU on their CPUs). But I don't think they will ever meet the performance of modern PCI-E cards, not in the nearest future at least.

But who knows...


i think it is still the case in electronic corps labs, but before to launch the better CPU with better GPU, they should first sell all the crap they made.
Post 13 Dec 2013, 12:43
View user's profile Send private message Visit poster's website Reply with quote
A$M



Joined: 29 Feb 2012
Posts: 94
A$M
tthsqe wrote:
A$M, the best way to learn about your gpu is to write a program for it. Do you have ATI or Nvidia?


My computer's GPU is integrated into the processor: Intel HD Graphics 3000 on an Intel Core i3-2370M processor. How can I do this?
Post 13 Dec 2013, 16:53
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 730
tthsqe
Oh, I'm sorry - that looks unfortunate. You will have to try a fragment shader in opengl. Why don't you try to make a mandelbrot set render? You will will draw two triangles that fill your whole screen and let the fragment shader do the actual computations. Do you need some hints on how to start?
Post 13 Dec 2013, 17:51
View user's profile Send private message Reply with quote
A$M



Joined: 29 Feb 2012
Posts: 94
A$M
tthsqe wrote:
Oh, I'm sorry - that looks unfortunate. You will have to try a fragment shader in opengl. Why don't you try to make a mandelbrot set render? You will will draw two triangles that fill your whole screen and let the fragment shader do the actual computations. Do you need some hints on how to start?
Well, I did not understand it well.
I'll need to use OpenGL? How can I use hardware 3D acceleration without OpenGL or DirectX? I'll need to make a driver for that?
Post 13 Dec 2013, 18:29
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 730
tthsqe
I don't not know how to write a driver for gpu's, nor do we need to. The only way of using intel's graphics that I know of is through opengl. You code your graphics as a fragment shader and then pass it some triangles. What I am talking about is at
http://board.flatassembler.net/topic.php?t=15917
Each stone and tile is one triangle, I just made the fragment shader turn them into 3d-looking objects.
With opengl, though, I don't know of a way to get the results of the shader back to the cpu, so using for general purpose computations seems out of reach.
Post 13 Dec 2013, 18:39
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.