GPU virtualization

GPU virtualization refers to technologies that allow the use of a GPU to accelerate graphics or GPGPU applications running on a virtual machine. GPU virtualization is used in various applications such as desktop virtualization,[1] cloud gaming[2] and computational science (eg. hydrodynamics simulations).[3]

GPU virtualization implementations generally involve one or more of the following techniques: device emulation, API remoting, fixed pass-through and mediated pass-through. Each technique presents different trade-offs regarding virtual machine to GPU consolidation ratio, graphics acceleration, rendering fidelity and feature support, portability to different hardware, isolation between virtual machines, and support for suspending/resuming and live migration.[1][4][5][6]

API remoting

In API remoting or API forwarding, calls to graphical APIs from guest applications are forwarded to the host by remote procedure call, and the host then executes graphical commands from multiple guests using the host's GPU as a single user.[1] It may be considered a form of paravirtualization when combined with device emulation.[7] This technique allows sharing GPU resources between multiple guests and the host when the GPU does not support hardware-assisted virtualization. It is conceptually simple to implement, but it has several disadvantages:[1]

  • In pure API remoting, there is little isolation between virtual machines when accessing graphical APIs; isolation can be improved using paravirtualization
  • Performance ranges from 86% to as low as 12% of native performance in applications that issue a large number of drawing calls per frame
  • A large number of API entry points must be forwarded, and partial implementation of entry points may decrease fidelity
  • Applications on guest machines may be limited to few available APIs

Hypervisors usually use shared memory between guest and host to maximize performance and minimize latency. Using a network interface instead (a common approach in distributed rendering), third-party software can add support for specific APIs (eg. rCUDA[8] for CUDA) or add support for typical APIs (eg. VMGL[9] for OpenGL) when it is not supported by the hypervisor's software package, although network delay and serialization overhead may outweigh the benefits.

Application support from API remoting virtualization technologies
Technology Direct3D OpenGL Vulkan OpenCL
VMware Virtual Shared Graphics Acceleration (vSGA)[10] 9.0c 2.1 No No
Parallels Desktop for Mac 3D acceleration[11] 11.0[upper-alpha 1] 3.3[upper-alpha 2] No No
Hyper-V RemoteFX vGPU[13][14] 11.0 4.4 No 1.1
VirtualBox Guest Additions 3D driver[15][16][17] 8/9[upper-alpha 3] 2.1[upper-alpha 4] No No
QEMU/KVM with Virgil 3D[19][20][21][22] No 4.3 Planned No
  1. Wrapped to OpenGL using WineD3D.[12]
  2. Compatibility profile.
  3. Experimental. Wrapped to OpenGL using WineD3D.[18]
  4. Experimental.

Fixed pass-through

In fixed pass-through or GPU pass-through (a special case of PCI pass-through), a GPU is accessed directly by a single virtual machine exclusively and permanently. This technique achieves 96100% of native performance[3] and high fidelity,[1] but the acceleration provided by the GPU cannot be shared between multiple virtual machines. As such, it has the lowest consolidation ratio and the highest cost, as each graphics-accelerated virtual machine requires an additional physical GPU.[1]

The following software technologies implement fixed pass-through:

VirtualBox removed support for PCI pass-through in version 6.1.0.[31]

For certain GPU models, Nvidia and AMD video card drivers attempt to detect the GPU is being accessed by a virtual machine and disable some or all GPU features.[32]

Mediated pass-through

In mediated device pass-through or full GPU virtualization, the GPU hardware provides contexts with virtual memory ranges for each guest through IOMMU and the hypervisor sends graphical commands from guests directly to the GPU. This technique is a form of hardware-assisted virtualization and achieves near-native[lower-alpha 2] performance and high fidelity. If the hardware exposes contexts as full logical devices, then guests can use any API. Otherwise, APIs and drivers must manage the additional complexity of GPU contexts. As a disadvantage, there may be little isolation between virtual machines when accessing GPU resources.[1]

The following software and hardware technologies implement mediated pass-through:

While API remoting is generally available for current and older GPUs, mediated pass-through requires hardware support available only on specific devices.

Hardware support for mediated pass-through virtualization
Vendor Technology Dedicated graphics card families Integrated GPU families
Server Professional Consumer
Nvidia vGPU[41] GRID, Tesla Quadro No
AMD MxGPU[37][42] FirePro Server, Radeon Instinct Radeon Pro No No
Intel GVT-g Broadwell and newer

Device emulation

GPU architectures are very complex and change quickly, and their internal details are often kept secret. It is generally not feasible to fully virtualize new generations of GPUs, only older and simpler generations. For example, PCem, a specialized emulator of the IBM PC architecture, can emulate a S3 ViRGE/DX graphics device, which supports Direct3D 3, and a 3dfx Voodoo2, which supports Glide, among others.[43]

When using a VGA or an SVGA virtual display adapter,[44][45][46] the guest may not have 3D graphics acceleration, providing only minimal functionality to allow access to the machine via a graphics terminal. The emulated device may expose only basic 2D graphics modes to guests. The virtual machine manager may also provide common API implementations using software rendering to enable 3D graphics applications on the guest, albeit at speeds that may be low as 3% of hardware-accelerated native performance.[1] The following software technologies implement graphics APIs using software rendering:

See also

Notes

  1. Not available on VMware Workstation.
  2. Intel GVT-g achieves 80–90% of native performance.[33][34] Nvidia vGPU achieves 88–96% of native performance considering the overhead on a VMware hypervisor.[35]

References

  1. Dowty, Micah; Sugerman, Jeremy (July 2009). Written at San Diego. "GPU Virtualization on VMware's Hosted I/O Architecture" (PDF). ACM SIGOPS Operating Systems Review. New York City: Association for Computing Machinery. 43 (3): 73–82. doi:10.1145/1618525.1618534. ISSN 0163-5980. S2CID 228328. Retrieved 10 September 2020.
  2. Hong, Hua-Jun; Fan-Chiang, Tao-Ya; Lee, Che-Rung; Chen, Kuan-Ta; Huang, Chun-Ying; Hsu, Cheng-Hsin (2014). "GPU Consolidation for Cloud Games: Are We There Yet?". 13th Annual Workshop on Network and Systems Support for Games. Nagoya: Institute of Electrical and Electronics Engineers: 1–6. doi:10.1109/NetGames.2014.7008969. ISBN 978-1-4799-6882-4. ISSN 2156-8138. S2CID 664129. Retrieved 14 September 2020.
  3. Walters, John; Younge, Andrew; Kang, Dong-In; Yao, Ke-Thia; Kang, Mikyung; Crago, Stephen; Fox, Geoffrey (2014). "GPU Passthrough Performance: A Comparison of KVM, Xen, VMware ESXi, and LXC for CUDA and OpenCL Applications" (PDF). IEEE 7th International Conference on Cloud Computing. IEEE 7th International Conference on Cloud Computing. Anchorage: IEEE Computer Society. pp. 636–643. doi:10.1109/CLOUD.2014.90. ISBN 978-1-4799-5063-8. ISSN 2159-6190. Retrieved 13 September 2020.
  4. Yu, Hangchen; Rossbach, Christopher (25 June 2017). Full Virtualization for GPUs Reconsidered (PDF). ISCA-44 14th Annual Workshop on Duplicating, Deconstructing and Debunking. Toronto. Retrieved 12 September 2020.
  5. Tian, Kun; Dong, Yaozu; Cowperthwaite, David (June 2014). "A Full GPU Virtualization Solution with Mediated Pass-Through" (PDF). Proceedings of the 2014 USENIX Conference on USENIX Annual Technical Conference (USENIX ATC'14). USENIX Annual Technical Conference. Philadelphia: USENIX. pp. 121–132. ISBN 978-1-931971-10-2.
  6. Gottschlag, Mathias; Hillenbrand, Marius; Kehne, Jens; Stoess, Jan; Bellosa, Frank (November 2013). LoGV: Low-Overhead GPGPU Virtualization (PDF). 10th International Conference on High Performance Computing. Zhangjiajie: IEEE Computer Society. pp. 1721–1726. doi:10.1109/HPCC.and.EUC.2013.245. ISBN 978-0-7695-5088-6. Retrieved 16 September 2020.
  7. Suzuki, Yusuke; Kato, Shinpei; Yamada, Hiroshi; Kono, Kenji (June 2014). "GPUvm: Why Not Virtualizing GPUs at the Hypervisor?" (PDF). Proceedings of the 2014 USENIX Conference on USENIX Annual Technical Conference (USENIX ATC'14). USENIX Annual Technical Conference. Philadelphia: USENIX. pp. 109–120. ISBN 978-1-931971-10-2. Retrieved 14 September 2020.
  8. Duato, José; Peña, Antonio; Silla, Federico; Fernández, Juan; Mayo, Rafael; Quintana-Ortí, Enrique (December 2011). Enabling CUDA acceleration within virtual machines using rCUDA (PDF). 18th International Conference on High Performance Computing. International Conference on High Performance Computing. Bangalore: IEEE Computer Society. pp. 1–10. doi:10.1109/HiPC.2011.6152718. ISBN 978-1-4577-1951-6. ISSN 1094-7256. Retrieved 13 September 2020.
  9. Lagar-Cavilla, Horacio; Tolia, Niraj; Satyanarayanan, Mahadev; Lara, Eyal (June 2007). "VMM-Independent Graphics Acceleration" (PDF). Written at San Antonio. Proceedings of the 3rd International Conference on Virtual Execution Environments. VEE '07. New York City: Association for Computing Machinery. pp. 33–43. doi:10.1145/1254810.1254816. ISBN 978-1-59593-630-1. Retrieved 12 September 2020.
  10. Lantinga, Hilko. Deploying Hardware-Accelerated Graphics with VMware Horizon (Guide). VMware. Retrieved 12 September 2020.
  11. "Graphics Settings". Parallels Desktop - User's Guide (Guide). Parallels.
  12. Bright, Peter (11 March 2014). "Valve releases open source Direct3D to OpenGL translator". Ars Technica. Retrieved 15 September 2020.
  13. "Deploy graphics devices using RemoteFX vGPU". Hyper-V on Windows Server (Manual). Microsoft. Retrieved 13 September 2020.
  14. "Plan for GPU acceleration in Windows Server". Hyper-V on Windows Server (Manual). Microsoft. Retrieved 15 September 2020.
  15. "Hardware-Accelerated Graphics". Oracle VM VirtualBox User Manual (Manual). Oracle Corporation. Retrieved 12 September 2012.
  16. "Guest Additions". Oracle VM VirtualBox User Manual (Manual). Oracle Corporation. Retrieved 12 September 2020.
  17. Larabel, Michael (19 December 2018). "VirtualBox 6.0 3D/OpenGL Performance With VMSVGA Adapter". Phoronix. Retrieved 15 September 2020.
  18. Larabel, Michael (29 January 2009). "VirtualBox Gets Accelerated Direct3D Support". Phoronix. Retrieved 15 September 2020.
  19. "Virgil 3D GPU project". GitHub (Project). freedesktop.org. Retrieved 13 September 2020.
  20. Edge, Jake (10 September 2014). Virgil 3D: A virtual GPU (Article). LWN.net. Retrieved 13 September 2020.
  21. Wollny, Gert (28 August 2019). "Virglrenderer and the state of virtualized virtual worlds". Collabora News & Blog. Retrieved 15 September 2020.
  22. Hoffmann, Gerd (28 November 2019). "virtio gpu status and plans". Retrieved 15 September 2020.
  23. GPU Development with Parallels Workstation Extreme (PDF) (White paper). Parallels. 2010. Retrieved 13 September 2020.
  24. "Deploy graphics devices using Discrete Device Assignment". Hyper-V on Windows Server (Manual). Microsoft. Retrieved 13 September 2020.
  25. "HDX 3D Pro". XenApp and XenDesktop 7.15 LTSR (Manual). Citrix Systems. Retrieved 15 September 2020.
  26. "Graphics overview". Citrix Hypervisor 8.2 (Manual). Citrix Systems. Retrieved 15 September 2020.
  27. GVT-d Setup Guide. GitHub (Guide). Retrieved 13 September 2020.
  28. Larabel, Michael (4 May 2014). "Intel Pushes Their Graphics Virtualization Capabilities". Phoronix. Retrieved 13 September 2020.
  29. "Bringing New Use Cases and Workloads to the Cloud with Intel Graphics Virtualization Technology (Intel GVT-g)" (PDF). Intel Open Source Technology Center (Flyer). Intel. 2016. Retrieved 14 August 2020.
  30. Jain, Sunil (4 May 2014). "Intel Graphics Virtualization Update" (Article). Intel. Retrieved 13 September 2020.
  31. "Changelog for VirtualBox 6.1". VirtualBox. Oracle Corporation. 10 December 2019. Retrieved 12 September 2020.
  32. "PCI passthrough via OVMF - Video card driver virtualization detection". Arch Linux Wiki (Wiki). Retrieved 13 September 2020.
  33. Zheng, Xiao (August 2015). Media Cloud Based on Intel Graphics Virtualization Technology (Intel GVT-g) and OpenStack (PDF). Intel Developer Forum (Presentation slide). San Francisco: Intel. Retrieved 14 September 2020.
  34. Wang, Zhenyu (September 2017). Full GPU virtualization in mediated pass-through way (PDF). XDC2017 (Presentation slide). Mountain View, California: X.Org Foundation. Retrieved 14 September 2020.
  35. Kurkure, Uday (12 October 2017). Performance Comparison of Native GPU to Virtualized GPU and Scalability of Virtualized GPUs for Machine Learning. VMware VROOM! Performance Blog (Article). VMware. Episode 3. Retrieved 14 September 2020.
  36. Virtual GPU Software User Guide (Guide). Nvidia. Retrieved 13 September 2020.
  37. Wong, Tonny (28 January 2016). AMD multiuser GPU: hardware-enabled GPU virtualization for a true workstation experience (PDF) (White paper). AMD. Retrieved 12 September 2020.
  38. Wang, Hongbo (18 October 2018). "2018-Q3 release of XenGT (Intel GVT-g for Xen)" (Press release). Intel Open Source Technology Center. Retrieved 14 August 2020.
  39. GVT-g Setup Guide. GitHub (Guide). Retrieved 13 September 2020.
  40. Wang, Hongbo (18 October 2018). "2018-Q3 release of KVMGT (Intel GVT-g for KVM)" (Press release). Intel Open Source Technology Center. Retrieved 14 August 2020.
  41. "NVIDIA Virtual GPU Software Supported GPUs". Nvidia. Retrieved 9 September 2020.
  42. AMD FirePro S-Series for Virtualization (PDF) (Datasheet). AMD. 2016. Retrieved 13 September 2020.
  43. "Systems/motherboards emulated". PCem (Project). PCem. Retrieved 26 October 2020.
  44. "VMware Tools Device Drivers". VMware Tools Documentation (Manual). VMware. Retrieved 12 September 2020.
  45. "Configuring Virtual Machines". Oracle VM VirtualBox User Manual (Manual). Oracle Corporation. Retrieved 12 September 2020.
  46. "Display options". QEMU User Documentation. QEMU (Manual). Retrieved 12 September 2020.
  47. Long, Simon (2013). Virtual Machine Graphics Acceleration Deployment Guide (PDF) (White paper). VMware. Retrieved 14 September 2020.
  48. "OpenGL Software Accelerator". XenApp and XenDesktop 7.15 LTSR (Manual). Citrix Systems. Retrieved 15 September 2020.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.