Dynamic System Memory Allocation for Virtual GPUs
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In virtualized GPU environments, existing methods for managing video memory are inefficient due to complex memory management and reduced available guest memory, as well as difficulties in enforcing performance guarantees and memory limits, leading to potential performance degradation.
Innovation Solution
Implementing a dynamic shared system memory model where the guest graphics driver allocates memory objects on an as-needed basis within the VM's guest memory space, allowing synchronization primitives for updating and invalidating graphics resources, and caching at the hypervisor level to optimize rendering and manage host memory effectively.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If a static pool of guest memory is reserved for each VGPU, then video memory availability is improved, but memory efficiency deteriorates due to multiple memory read/writes and reduced guest memory for other purposes
Solution Approach 1:
The patent implements a dynamic memory allocation system where the VGPU memory pool is not statically reserved but dynamically allocated from the host system's available memory. The guest graphics driver can allocate memory objects from the VGPU memory pool as needed, and the hypervisor dynamically manages the underlying host memory allocation. This allows memory to be allocated on-demand rather than pre-reserved, improving both video memory availability and overall memory efficiency.
Solution Approach 2:
The patent merges the VGPU memory pool with the host system's general memory space, allowing the same physical memory to serve multiple purposes. Instead of having separate dedicated memory for VGPU and general system use, the system allows dynamic sharing where memory can be allocated to VGPU when needed and reclaimed for general use when not needed, eliminating the need for static reservation and reducing memory fragmentation.
2Ease of operation
If guest graphics driver manages static guest memory pool, then video memory management is improved, but device complexity deteriorates due to complicated memory management requirements
Solution Approach 1:
The patent introduces the VGPU as an intermediary layer between the guest graphics driver and the host graphics hardware. The VGPU provides a simplified interface to the guest driver while handling the complex memory management and translation to physical video memory. The guest driver interacts with the VGPU using simplified commands, and the VGPU handles the complexity of mapping guest memory objects to host video memory, reducing the burden on the guest driver.
Solution Approach 2:
The patent implements a memory object copying mechanism where the VGPU maintains copies of graphics data in its managed memory pool. When the guest driver needs to access graphics data, the VGPU provides access to the appropriate copy, handling the complexity of memory location tracking and data synchronization. This copying approach simplifies the guest driver's task while maintaining efficient memory utilization.
3Adaptability or versatility
If guest graphics driver provides graphics data directly to VGPU, then memory allocation flexibility is improved, but reliability deteriorates due to difficulty in enforcing host memory limits
Solution Approach 1:
The patent implements a feedback mechanism where the hypervisor continuously monitors the memory usage of the VGPU memory pool and provides feedback to enforce host memory limits. The system tracks the amount of host memory allocated to the VGPU pool and can prevent further allocations when limits are approached, ensuring that performance guarantees are maintained while still allowing flexible memory allocation within the allocated bounds.
Solution Approach 2:
The patent performs preliminary allocation of a VGPU memory pool from host memory before guest applications need to allocate graphics resources. The hypervisor pre-allocates a portion of host memory to the VGPU, establishing memory limits in advance. This preliminary action allows the guest graphics driver to flexibly allocate memory objects from the pre-allocated pool without risking host memory exhaustion, as the limits have already been established and enforced by the hypervisor.
Data Source
AI summary
Techniques for dynamically using system (i.e., VM guest) memory as video memory for virtual graphics processing units (VGPUs) are provided. In one embodiment, a guest graphics driver running within a virtual machine (VM) of a host system can receive, from a guest application of the VM, a request to create a graphics resource. The guest graphics driver can then dynamically allocate, in response to the request, a memory object for the graphics resource in a guest memory space of the VM.


