Enabling GPU in OpenStack
In this article we are going to investigate GPU virtualization in OpenStack. Because whole of this project is building for the university, some of students not only need CPU for their job, but also need some GPU. So first we started to investigate this subject generally and then we studied it in OpenStack.
Motivation
The reason that we are looking for GPU virtualization is enabling very interesting and nice technology that they are not feasible just with CPU. here we summarize three of them.
Automatic Driving
An automated driving system is a complex combinations of various components that can be defined as systems where perception, decision making, and operation of the automobile are performed by electronics and machinery instead of a human driver, and as introduction of automation into road traffic. This includes handling of the vehicle, destination, as well as awareness of surroundings. While the automated system has control over the vehicle, it allows the human operator to leave all responsibilities to the system.
here you can find useful information: Enabling The Self-Driving Car
Video Streaming
Streaming media is multimedia that is constantly received by and presented to an end-user while being delivered by a provider. The verb "to stream" refers to the process of delivering or obtaining media in this manner; the term refers to the delivery method of the medium, rather than the medium itself, and is an alternative to file downloading, a process in which the end-user obtains the entire file for the content before watching or listening to it.
here you can find additional information: Cloud-Based Mobile Video Streaming Techniques
Cloud Gaming
Cloud gaming, sometimes called gaming on demand, is a type of online gaming. Currently there are two main types of cloud gaming: cloud gaming based on video streaming and cloud gaming based on file streaming. Cloud gaming aims to provide end users frictionless and direct play-ability of games across various devices. it means that you can play your favorite games anywhere, anytime and on any device.
here you can find additional information: THE POWER OF CLOUD GAMING
GPU Virtualization Technics
Virtual desktop infrastructure(VDI) is a great way to deliver desktops and apps to workers, but in the past, it's only been viable if those workers use applications that don't rely on complex graphics or video rendering.
VDI is not ideal for delivering the type of performance power users need to accomplish work with apps that display complex graphics. That's where virtual graphics processing unit (vGPU) cards come in. A vGPU renders the graphics on a back-end server rather than on the actual endpoint device. As a result, the server expends the resources to deliver graphics instead of the laptop, PC or mobile device the user is running. The device will run more smoothly because it can focus on CPU.
Several technologies achieve graphics virtualization, as illustrated in the image below, with more hardware acceleration toward the right.
Device Emulation
Device emulation is mainly used in server virtualization, with emulation of an old VGA display card. Qemu is the most widely used vehicle. Full emulation of a GPU is almost impossible, because of complexity and extremely poor performance.
API Forwarding
API forwarding implements a frontend/backend driver pair. The frontend driver forwards high-level DirectX/OpenGL API calls from the VM to the backend driver in the host through an optimized inter-VM channel. Multiple backend drivers behave like normal 3D applications in the host, so a single GPU can be multiplexed to accelerate multiple VMs. However, the difference between the VM and host graphics stacks easily leads to reduced performance or compatibility issues. Because it is hardware-agnostic, this is the most widely used technology, so far. Actual implementations vary, depending on the level where forwarding happens. For example, VMGL directly forwards GL commands, while VMware vGPU presents itself as a virtual device, with high-level DirectX calls translated to its private SVGA3D protocol. Another recent example is Virgil, with its experimental virtual 3D support for QEMU.
Meditated Pass-Through or Full GPU virtualization
Mediated pass-through extends direct pass-through, using a software approach. Every VM is allowed to access partial device resources without hypervisor intervention, while privileged operations are mediated through a software layer. It sustains the performance of direct pass-through, while still provides the sharing capability. XenGT adopts this technology.
Direct Pass-Through
Direct pass-through, based on VT-d, assigns the whole GPU exclusively to a single VM. When achieving the best performance, it sacrifices the sharing capability.
Industrial solution
Intel GPU Virtualization
Intel offers a full suite of graphics virtualization technologies, known as Intel® Graphics Virtualization Technology (Intel® GVT), that offer different approaches with varying levels of performance, capabilities and sharing to best meet the needs of a wide range of developers.
Intel® Graphics Virtualization Technology –d (Intel® GVT –d): vDGA: virtual dedicated graphics acceleration (one VM to one physical GPU)
Intel® Graphics Virtualization Technology –s (Intel® GVT -s): vSGA: virtual shared graphics acceleration (multiple VMs to one physical GPU)
Intel® Graphics Virtualization Technology –g (Intel® GVT -g): vGPU: virtual graphics processing unit (multiple VMs to one physical GPU)
As a long-standing member of the open source community, Intel works upstream to ensure that full, open source implementations of Intel® GVT exist for open source virtualization hypervisors, KVM* and Xen*, known respectively as KVMGT and XenGT. KVMGT and XenGT deliver excellent virtual GPU performance in VMs across 5th and 6th generation Intel® Core™ processors (Intel® Core™ i3, Intel® Core™ i5, and Intel® Core™ i7 processors) with Intel Processor Graphics as well as Intel® Xeon® processors E3 v4 family with Intel Processor Graphics.
Nvidia GPU Virtualization
NVIDIA GRID™ is the industry's most advanced technology for sharing virtual GPUs (vGPUs) across multiple virtual desktop and applications instances. You can now leverage the full power of NVIDIA data center GPUs to deliver a superior virtual graphics experience to any device, anywhere. The NVIDIA GRID platform offers the highest levels of performance, flexibility, manageability, and security—offering the right level of user experience for any virtual workflow. - See more at: http://www.nvidia.com/object/grid-technology.html#sthash.G3ck3Adj.dpuf
- CUSTOMIZED GRAPHICS PROFILES
IT managers can assign the optimal amount of graphics horsepower and deliver a customized graphics profile for each user. Every virtual desktop has dedicated graphics memory, just like they would at their desk, so they always have the resources they need to launch and run their applications at full performance.
NVIDIA GRID lets up to sixteen users share each physical GPU, so the graphics resources of the available GPUs can be assigned to virtual machines in an the optimally balanced way.
AMD GPU Virtualization
For companies considering centralized computing solutions, AMD FirePro™ S-series server cards make it easy for IT to choose one flexible, scalable solution to meet various employee needs. It’s now possible to take advantage of the processing power of the GPU to create virtual machines for users – all managed from one central, secure location. AMD Multiuser GPU (MxGPU). The World’s First Hardware Virtualized GPU Solution.
Additional data: AMD Virtualization Solution
GPU in OpenStack
Because we don't have Intel graphics processing units we can't use full GPU virtualization technic. because XenGT and KvmGT support this feature only for Intel processor. Another important factor is that we don't have large number of GPUs and our students that interested in GPU staffs are not really much, so we decided to select Direct Pass-Through approach. With this approach the number of VMs that have GPU are equal to the number of physical graphics card. of course that we have full performance of the graphics card for the VM and it is our desire.
The PCI passthrough feature in OpenStack allows full access and direct control of a physical PCI device in guests. This mechanism is generic for any kind of PCI device, and runs with a Network Interface Card (NIC), Graphics Processing Unit (GPU), or any other devices that can be attached to a PCI bus. Correct driver installation is the only requirement for the guest to properly use the devices.
Some PCI devices provide Single Root I/O Virtualization and Sharing (SR-IOV) capabilities. When SR-IOV is used, a physical device is virtualized and appears as multiple PCI devices. Virtual PCI devices are assigned to the same or different guests. In the case of PCI passthrough, the full physical device is assigned to only one guest and cannot be shared.
Here is link for configuring OpenStack for enabling graphics card for the VM based on the PCI passthrough feature.
Attaching physical PCI devices to guests