I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions
Introduction to GPUs and to the Linux Graphics Stack
Martin Peres CC By-SA 3.0
Nouveau developer Ph.D. student at LaBRI
November 26, 2012
1 / 36
Introduction to GPUs and to the Linux Graphics Stack Martin Peres - - PowerPoint PPT Presentation
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Introduction to GPUs and to the Linux Graphics Stack Martin Peres CC By-SA 3.0 Nouveau developer Ph.D. student at LaBRI November 26, 2012 1 / 36 I -
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions
Nouveau developer Ph.D. student at LaBRI
1 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions General overview
1
2
3
2 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions General overview
3 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions General overview
CPU Flash ROM (BIOS)
Super I/O
Serial Port Parallel Port Floppy Disk Keyboard Mouse
Northbridge
(memory controller hub)
Southbridge
(I/O controller hub) IDE SATA USB Ethernet Audio Codec CMOS Memory
Onboard graphics controller
Clock Generator
Graphics card slot High-speed graphics bus (AGP or PCI Express) Chipset Front-side bus Memory bus Memory Slots PCI Bus PCI Slots LPC Bus Internal Bus PCI Bus Cables and ports leading
4 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions General overview
5 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Driving screens
1
2
3
6 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Driving screens
crtc0 VGA Encoder Display Port Encoder DVI Encoder crtc1 VGA Conn DP Conn DVI Conn
7 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Driving screens
8 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Driving screens
HBlank
Line 0 Line 1 Line Y - 1 Line Y
CRTC Scanout
VBlank HBlank HBlank HBlank
Line Y - 2
9 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Driving screens
EDID signal Video
EDID EEPROM
VGA cable
10 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Driving screens
11 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Host < − > GPU communication
1
2
3
12 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Host < − > GPU communication
13 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Host < − > GPU communication
Disk RAM
Another process's memory
Example of a CPU process's virtual memory space
0xffffffff
PCI-01:00 BAR0
0xffffff
Unused Unused
GPU 0, BAR 0 Register Space
0xffffffff
(swap) Logical address Physical address 14 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Host < − > GPU communication Location of the address/memory: CPU GPU GTT/GART(references RAM) RAM
GPU virtual address (VRAM + GART)
Providing the GPU with easy access to the Host RAM
Physical address
Device
BAR 0 BAR 1 ...
Process virtual address space (VM)
15 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions General overview
1
2
3
16 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions General overview
17 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions General overview
18 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions General overview
Kernel space User space Xorg Applications Hardware drm radeon intel nouveau GPU xlib x-server network libdrm ddx mesa CPU Rasterizer If UCS* Qt gtk nexuiz
19 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions DRM and libdrm
1
2
3
20 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions DRM and libdrm
21 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Mesa
1
2
3
22 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Mesa
23 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Mesa
Applications Mesa State Trackers pipe drivers Mesa Classics Weston egl x-server xorg mplayer VDPAU xonotic libgl Qt OpenGL intel radeon nouveau_vieux swrast Gallium softpipe llvmpipe r600g r300g nvc0 nv50 ... nv30 CPU LLVM GPU (through libdrm)
24 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions X11
1
2
3
25 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions X11
26 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions X11
27 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Wayland
1
2
3
28 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Wayland
29 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Wayland
30 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions X11 vs Wayland
1
2
3
31 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions X11 vs Wayland
32 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions X11 vs Wayland
33 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Attributions
1
2
3
34 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Attributions
35 / 36
I - Hardware : Anatomy of a GPU II - Host : The Linux graphics stack Attributions Attributions
36 / 36