Professional Documents
Culture Documents
Presentation Overview
Definition Comparison with CPU Architecture GPU-CPU Interaction GPU Memory
2/2/2013
Why GPU?
To provide a separate dedicated graphics
resources including a graphics processor and memory. To relieve some of the burden of the main system resources, namely the Central Processing Unit, Main Memory, and the System Bus, which would otherwise get saturated with graphical operations and I/O requests.
2/2/2013
There comes
GPU
2/2/2013
What is a GPU?
A Graphics Processing Unit or GPU (also occasionally called Visual Processing Unit or VPU) is a dedicated processor efficient at manipulating and displaying computer graphics . Like the CPU (Central Processing Unit), it is a single-chip processor.
2/2/2013
HOWEVER,
The abstract goal of a GPU, is to enable
a representation of a 3D world as realistically as possible. So these GPUs are designed to provide additional computational power that is customized specifically to perform these 3D tasks.
2/2/2013
GPU vs CPU
A GPU is tailored for highly parallel operation
while a CPU executes programs serially. For this reason, GPUs have many parallel execution units , while CPUs have few execution units . GPUs have singificantly faster and more advanced memory interfaces as they need to shift around a lot more data than CPUs. GPUs have much deeper pipelines (several thousand stages vs 10-20 for CPUs).
2/2/2013 7
BRIEF HISTORY
First-Generation GPUs
Up to 1998; Nvidias TNT2, ATis Rage, and 3dfxs Voodoo3;DX6 feature set.
1999 -2000; Nvidias GeForce256 and GeForce2, ATis Radeon7500, and S3s Savage3D; T&L; OpenGL and DX7;Configurable.
2001; GeForce3/4Ti, Radeon8500, MSs Xbox; OpenGL ARB, DX7/8; Vertex Programmability + ASM
Fourth-Generation GPUs
2002 onwards; GeForce FX family, Radeon 9700; OpenGL+extensions, DX9; Vertex/Pixel Programability + HLSL; 0.13 Process, 125M T/C, 200M T/S.
2/2/2013
GPU Architecture
How many processing units?
How many ALUs? Do you need a cache? What kind of memory?
2/2/2013 9
GPU Architecture
How many processing units?
Lots.
GPU Architecture
How many processing units?
Lots.
GPU Architecture
How many processing units?
Lots.
GPU Architecture
How many processing units?
Lots.
The difference.
Without GPU
2/2/2013
With GPU
14
host interface
vertex processing
triangle setup
pixel processing
memory interface
2/2/2013
15
Details..
2/2/2013
16
Host Interface
The host interface is the communication bridge between the CPU and the GPU. It receives commands from the CPU and also pulls geometry information from system memory. It outputs a stream of vertices in object space with all their associated information (texture coordinates, per vertex color etc) .
host interface vertex processing triangle setup pixel processing memory interface
2/2/2013
17
Vertex Processing
The vertex processing stage receives vertices
from the host interface in object space and outputs them in screen space This may be a simple linear transformation, or a complex operation involving morphing effects No new vertices are created in this stage, and no vertices are discarded (input/output has 1:1 mapping)
host interface
vertex processing
triangle setup
pixel processing
memory interface
2/2/2013
18
Triangle setup
In this stage geometry information becomes
raster information (screen space geometry is the input, pixels are the output) Prior to rasterization, triangles that are backfacing or are located outside the viewing frustrum are rejected
host interface
vertex processing
triangle setup
pixel processing
memory interface
2/2/2013
19
2/2/2013
20
Pixel Processing
Each pixel provided by triangle setup is fed into
pixel processing as a set of attributes which are used to compute the final color for this pixel The computations taking place here include texture mapping and math operations
host interface
vertex processing
triangle setup
pixel processing
memory interface
2/2/2013
21
Memory Interface
Pixel colors provided by the previous stage are
written to the framebuffer Used to be the biggest bottleneck before pixel processing took over Before the final write occurs, some pixels are rejected by the zbuffer .On modern GPUs z is compressed to reduce framebuffer bandwidth (but not size).
host interface vertex processing triangle setup pixel processing memory interface
2/2/2013
22
2/2/2013
23
C P U
Vertex Setup
Vertex Shader
Rasterizer
Pixel Shader
Frame buffer
Vertices
2/2/2013
Pixels
24
Vertex Setup
Vertex Shader
Rasterizer
Pixel Shader
Frame buffer
CPU/GPU interaction
The CPU and GPU inside the PC work in
parallel with each other There are two threads going on, one for the CPU and one for the GPU, which communicate through a command buffer:
GPU reads commands from here
Synchronization issues
In the figure below, the CPU must not
overwrite the data in the yellow block until the GPU is done with the black command, which references that data:
data
28
inline all data to the command buffer and avoid references to separate data:
GPU reads commands from here
However, this is also bad for performance, since we may need to copy several Mbytes passing around a pointer
2/2/2013
29
GPU readbacks
The output of a GPU is a rendered image on the
screen, what will happen if the CPU tries to read it? GPU reads commands from here
Pending GPU commands
GPU must be synchronized with the CPU, ie it must drain its entire command buffer, and the CPU must wait while this happens
2/2/2013 30
2/2/2013
32
Memory Hierarchy
CPU and GPU Memory Hierarchy
Disk
CPU Main Memory GPU Video Memory CPU Caches GPU Caches GPU Constant Registers
CPU Registers
2/2/2013
Texture
Vertex Buffer
Vertex Processor
Rasterizer
Fragment Processor
Frame Buffer(s)
34
2/2/2013
GPU
Read/write None Read-only during computation. Write-only at end (to pre-computed address) None
Disk
2/2/2013
Read/write disk
35
It looks like..
2/2/2013
36
Some applications..
Computer generated holography using a
graphics processing unit Improve the performance of CAD tools. Computer graphics in games
2/2/2013
37
New..
NVIDIA's new graphics processing unit,
the GeForce 8X ULTRA, said to represent the very latest in visual effects technologies.
2/2/2013
38
THANK YOU
2/2/2013
39