WeirdGamerAidan OP t1_j6laroy wrote
Reply to comment by TheLuteceSibling in ELI5: Why do computers need GPUs (integrated or external)? What information is the CPU sending to the GPU that it can't just send to a display? by WeirdGamerAidan
Yes, but wouldn't the GPU not know what to display if the CPU didn't tell it what to display? Or is it more like the CPU tells it "throw this object here and this object here, figure out how to put it on a screen" (albeit much more complex and many more objects)?
lygerzero0zero t1_j6lhvyy wrote
The CPU hands the recipe to the GPU, and the GPU actually cooks it. Knowing the recipe is not the time-consuming part, it’s the actual cooking.
neilk t1_j6lf4hb wrote
The CPU is like "here are all the 30 thousand triangles that represent this thing, and here is the angle from which I would like to view it. Please do the complex mathematical transformations that a) rotate all 30 thousand triangles in space b) project all 30 thousand triangles from 3D space into 2D triangles on a screen"
There's also stuff to figure out what parts of the model are hidden from view, reflections, textures, shadows, etc, but you get it.
TheLuteceSibling t1_j6lbu0x wrote
There are different techniques, but you can think of it like the CPU figuring out where all the objects are and then handing it to the GPU.
The GPU applies, color, texture, shadow, and everything else. Putting chess pieces on a board is easy. Making them look like marble is much more intense.
RSA0 t1_j6lt8mn wrote
The programmer decides, which tasks will be performed on CPU, and which - on GPU. GPU is a full capability processor that runs its own program, so in theory there is no limit on what it can do - the only limit is time. The programmer must write a program for GPU as well as for CPU. Programs for GPU are called "shaders".
If we talk about games, the GPU usually does at least 3 jobs: convert all 3D models to screen-relative coordinates, sample colors from texture images, and calculate light and shadow. However, more tasks get moved on GPU with time: modern games use it for simple physics simulation (hair, clothes, fire, smoke, rain, grass), and for post-processing (color correction, blur).
GPU can also be used in tasks unrelated to graphics. Many scientific physics simulators and machine learning tools have an option to run on GPU.
Xanjis t1_j6lf95a wrote
It's the second. The GPU takes all the information for the scene (the location/size/rotation) of objects in the scene and then calculates what color each pixel the screen can display. That calculation needs to be done millions of time per second but it's a very simple calculation so the GPU is suited for the task because it has a huge number of weak cores. Whereas a cpu has a small number of incredibly powerful cores.
Sevenstrangemelons t1_j6lcdrq wrote
Generally yes, but the GPU is the one actually executing the instructions containing the calculations that would otherwise be really slow on the CPU.
Viewing a single comment thread. View all comments