gpu-resource multiplexing in component-based systems · outline 1. motivation 2. state of the art...
TRANSCRIPT
GPU-resource multiplexing in component-basedsystems
Sebastian Sumpf<[email protected]>
Josef Söntgen<[email protected]>
Outline
1. Motivation
2. State of the art
3. GPU resource multiplexing in user space
4. Results
5. References
GPU-resource multiplexing in component-based systems 2
Outline
1. Motivation
2. State of the art
3. GPU resource multiplexing in user space
4. Results
5. References
GPU-resource multiplexing in component-based systems 3
Motivation
GPU-resource multiplexing in component-based systems 4
Motivation
Architecture layout of an Intel Core i7 6700K processor 1
1https://software.intel.com/sites/default/files/managed/c5/9a/The-Compute-Architecture-of-Intel-Processor-Graphics-Gen9-v1d0.pdf
GPU-resource multiplexing in component-based systems 5
Motivation
GPUs have become freely programmable, think shader language,CUDA/OpenCL 2
2https://www.shadertoy.com/view/ldlcRf
GPU-resource multiplexing in component-based systems 6
GPU machine code
3
3https://twitter.com/adamjmiles/status/821914849038966784
GPU-resource multiplexing in component-based systems 7
Maybe operating systems
→ should handle GPUs in a way like they do it for CPUs
GPU-resource multiplexing in component-based systems 8
Outline
1. Motivation
2. State of the art
3. GPU resource multiplexing in user space
4. Results
5. References
GPU-resource multiplexing in component-based systems 9
State of the art
GPU-resource multiplexing in component-based systems 10
Complexity analysis (Intel only)
Mesa library
Mesa KLOCEGL 7.5OpenGL 170GLSL 90i965 DRI driver 81
i915 driver
~100 KLOC
GPU-resource multiplexing in component-based systems 11
Port Mesa with software rendering back end
GPU-resource multiplexing in component-based systems 12
Or this
GPU-resource multiplexing in component-based systems 13
Until
GPU-resource multiplexing in component-based systems 14
3D software stack on Linux
GPU-resource multiplexing in component-based systems 15
3D software stack on Linux
1. Observation while investigating the i915 GPU driver fromLinux
I A lot of code to support previous IGD generationsI Support for many outdated features
2. Idea→ Support current hardware generations (i. e., Broadwell andnewer) only→ Take advantage of modern features→ Try to write a minimal GPU multiplexer from scratch
GPU-resource multiplexing in component-based systems 16
GPU resource multiplexing on Linux
GPU-resource multiplexing in component-based systems 17
Engines
1. Render engine (3D/GPGPU)
2. VCS engine (Video Command Streamer - video decodesupport)
3. VECS engine (Video Enhancement Command Streamer)
4. Blitter engine
→ Concentrate on render engine
GPU-resource multiplexing in component-based systems 18
Resource management by the GPU driver
44 https://image.slidesharecdn.com/19gscale1-160901124550/95/xpds16-live-scalability-for-vgpu-using-gscale-
xiao-zheng-intel-5-638.jpg?cb=1472733989
GPU-resource multiplexing in component-based systems 19
GGTT and PPGTT
Global Graphics Translation Table (GGTT)I Only one per GPUI One level (8MB)I 8 Byte page table entries (PTEs) point to 4KB physical pagesI The leading PTEs directly map into the aperture
Per-process GTT (PPGTT)I Hierarchical page table in various formatsI Gen8+ supports four level page table formatI 48 bit virtual-address space
GPU-resource multiplexing in component-based systems 20
Aperture and fence registers
ApertureI Only way for way CPU to access graphics memory directlyI Mapped through the GTTI Up to 512MB on Broadwell/Skylake
Fence registersI Allow to set tiling mode (X or Y) for memory area mapped
through the aperture (automatic tiling/detiling on write/readaccess by the CPU)
I 32 registers on Broadwell/Skylake
GPU-resource multiplexing in component-based systems 21
Ring management
Physical and logical rings
GPU-resource multiplexing in component-based systems 22
Command execution
1. Classical ring execution by setting the head
2. ExeclistsI Hardware status pageI Register state context
I PPGTT contextI Logical-ring contextI HW/engine context
GPU-resource multiplexing in component-based systems 23
Outline
1. Motivation
2. State of the art
3. GPU resource multiplexing in user space
4. Results
5. References
GPU-resource multiplexing in component-based systems 24
GPU resource multiplexing in user space
GPU-resource multiplexing in component-based systems 25
GPU resource multiplexing in user space
GPU-resource multiplexing in component-based systems 26
And of course
GPU-resource multiplexing in component-based systems 27
Something new
GPU-resource multiplexing in component-based systems 28
Component based scenario
GPU-resource multiplexing in component-based systems 29
Outline
1. Motivation
2. State of the art
3. GPU resource multiplexing in user space
4. Results
5. References
GPU-resource multiplexing in component-based systems 30
Results
Trusted computing base
Component KLOCMicrokernel 10Genode base system < 30Nitpicker GUI server 5GPU multiplexer 10
GPU-resource multiplexing in component-based systems 31
State
Current stateSupport for Mesa-based GPU clients
FutureTake advantage of the blitter engineSkylake, Kaby Lake, ...
Future (tempting) workVirtual GPU in VirtualBox as GPU client
GPU-resource multiplexing in component-based systems 32
Outline
1. Motivation
2. State of the art
3. GPU resource multiplexing in user space
4. Results
5. References
GPU-resource multiplexing in component-based systems 33
References
Intel’s open source community: https://01.org
Ben Widawsky: https://bwidawsk.net/blog/index.php/2015/09/gen-graphics-and-the-urb
Daniel Vetter:http://blog.ffwll.ch/2012/10/i915gem-crashcourse.html
GPU-resource multiplexing in component-based systems 34
Demo
GPU-resource multiplexing in component-based systems 35