What's inside a GPU - Page 1
Forum section: electronics / general

author: c64
author_rank: Frequent Contributor
timestamp: December 12, 2023, 02:29:18 am
content: Is it just a lot of processors optimized for image manipulation (like drawing lines, moving pixels) which work in parallel?Or is it done withcustom logicdedicated hardware?Or is it combination of both?

author: Mechatrommer
author_rank: Super Contributor
timestamp: December 12, 2023, 03:49:16 am
content: this kid probably can give you some startup, but then you need to be well versed in 3d processing / engine and what instructions are really needed to lay down on the silicone.. so you need to be a good ASICs/custom IC designer as well. here i google for you so i can get to know more as well... ymmv..

author: Whales
author_rank: Super Contributor
timestamp: December 12, 2023, 04:58:32 am
content: Quote from: c64 on December 12, 2023, 02:29:18 amAll of the above.Moving large blocks of pixels: really wide memory busesDrawing lines: even though GPUs are marketed as general purpose processing I believe they still have dedicated "rasteriser" silicon that's optimised for drawing textured polygons. Lines are sort of a subset of this job (albeit most non-3D software draws lines on the CPU because it's simple and fast enough anyway).Custom logic: Depends on what you mean by custom. Some of it is fixed, other parts are programmable at runtime (ie shader processing). Is it truly "custom" if they manufacture a million of them?Notably GPUs are particular bad at:1. Branching (if statements)2. LatencyInstead they're optimised for throughput of lots of similar computations. Each pixel of your image, in an ideal world, undergoes almost exactly the same processing. In reality it's not perfectly homogeneous but it's much more so than typical CPU tasks & code.

author: Berni
author_rank: Super Contributor
timestamp: December 12, 2023, 06:45:05 am
content: What is inside a GPU changed quite a bit over the years.At first we only had 2D capabilities and a "graphics card" was actually called a video adapter since it was just a dual port RAM with a VGA DAC on the other side of it, it could also be run trough a character ROM to create text. The fanciest graphics functionality back then was basically glorified DMA transfers to move blocks of data around.The first actual graphics accelerated GPUs used in PCs were basically ASICs purpose built for doing the major operations of 3D rendering. These are so called "fixed function" GPUs where there are blocks dedicated for certain operations that get strung together to form the 3D rendering pipeline. So it might have a geometry transformation block that can apply transformation matrices to a pile of points (useful for implementing a moving camera in the scene), it might have a block for Z sorting vertecies, it might have a rasterization block that draws triangles between vertices, this might interact with a texture mapper block that pulls pixels from textures and filters them smooth...etc Back in this day 3D applications had to have their rendering code specifically designed to work with the functions available in the particular GPU.Then as computers got faster and graphics tasks more demanding it became clear that a more flexible and universal solution was needed. So programmable shader pipelines were introduced. This is a new concept where instead of hard wiring the common functions we instead create a small processor core that is more DSP like (aka really really good at math on large amounts of data), this core executes machine code much like a CPU, but works with data in a very parallel way. These are called shader cores and we can program them to do whatever we want. The 3D application can choose a pipeline it wants and program it into the GPU. Modern cards have 1000s (some even >10000) of these shade cores, giving them an incredible amount of math performance. They are now flexible enough to even be used for non graphics tasks that involve a lot of data and math. Like DSP, simulations, cryptocurrency mining, AI ...etcThere are still some dedicated sections more optimized for certain tasks (also coming in multiple cores so that the GPU vendor can scale the GPU for higher performance models by just adding more cores). Notably in the new generations getting new types of cores like tensor cores (really good at integer math, useful for AI) or raytracing cores (does what it says on the tin)

author: David Hess
author_rank: Super Contributor
timestamp: December 12, 2023, 10:11:10 am
content: These days GPUs use an an array of SIMD (single instruction multiple data) processors with some hardware to optimize rasterization. Interestingly enough, 2D operations like line drawing and blitting are slower than using dedicated hardware, at least last time I checked, but fast enough. Older GPUs which had dedicated 2D hardware were faster for 2D operations.GPUs use thread level parallelism instead of the instruction level parallelism found in CPUs to make best use of memory level parallelism.

author: Dan123456
author_rank: Regular Contributor
timestamp: December 12, 2023, 10:13:20 am
content: Here is another amazing video. This dude built his own 8 bit computer on a breadboard!!!His videos are long, but are super addictive, informative, interesting and well worth watching