A VGPU acceleration method, device and storage medium

By introducing a customized microprocessor into the host and configuring the mapped MMIO address spaces to perceive and process the VGPU MMIO requests, the VGPU virtual machine exit problem is solved and performance is improved.

CN115080183BActive Publication Date: 2024-12-06ALIBABA (CHINA) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202210658098.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-10
Publication Date
2024-12-06
Estimated Expiration
2042-06-10

AI Technical Summary

Technical Problem

VGPU frequently experiences virtual machine exit events when processing MMIO requests, which seriously affects performance.

Method used

Introduce a customized microprocessor in the host and configure it with the same specifications as the VGPU and mapped MMIO address space. The microprocessor senses and takes over MMIO requests, calculates the address offset in response to the request, and avoids the virtual machine exit.

Benefits of technology

It effectively improves the performance of VGPU, reduces the time-consuming process of MMIO requests, and avoids the performance impact caused by virtual machine exit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115080183B_ABST
    Figure CN115080183B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a VGPU acceleration method, device and storage medium. A customized microprocessor can be introduced into the host machine, and the microprocessor can be configured with an MMIO address space of the same specification as the VGPU and mapped to each other. Based on this, when an MMIO request for the VGPU occurs, the microprocessor will sense and take over the MMIO request, and the original virtual machine monitor will no longer sense and take over the MMIO request. In this way, the virtual machine monitor will no longer control the virtual machine to enter the exit mode due to the MMIO request, that is, the virtual machine exit problem will no longer occur during the processing of the MMIO request, which can avoid the performance impact of the virtual machine exit problem on the VGPU. The microprocessor can accurately calculate the address offset corresponding to the MMIO request instead of the virtual machine monitor, so that the original hardware simulation can be normally executed based on the address offset to respond to the MMIO request. This process is much less time-consuming than the virtual machine exit problem, thereby effectively improving the performance of the VGPU.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtualization technology, and in particular to a VGPU acceleration method, device and storage medium. Background Art

[0002] In the field of cloud computing, GPU (Graphics Processing Unit) plays an increasingly important role in rendering, AI training and reasoning, big data, encoding and decoding, etc. VGPU (virtual GPU) technology has emerged. VGPU technology can virtualize a physical GPU into multiple VGPUs, enabling multiple virtual machines to use one physical GPU at the same time.

[0003] However, currently VGPU needs to trigger a large number of MMIO (Memory Mapping I / O) traps to simulate hardware behavior, which leads to frequent VM Exit events in the virtual machine VM where VGPU is located, seriously affecting the performance of VGPU. Summary of the invention

[0004] Multiple aspects of the present application provide a VGPU acceleration method, device, and storage medium to improve the performance of a VGPU.

[0005] The embodiment of the present application provides a VGPU acceleration method, wherein a host machine where the VGPU is located is equipped with a customized microprocessor, and the microprocessor is configured with an MMIO address space of the same specification as the VGPU and mapped to each other, and the method includes:

[0006] Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, the microprocessor is used to sense an MMIO request for the VGPU, wherein the MMIO request includes a required target MMIO address;

[0007] Utilizing the microprocessor to calculate the address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in its MMIO address space;

[0008] Invoke the physical GPU resource pointed to by the address offset to respond to the MMIO request;

[0009] After the response is completed, the microprocessor is used to notify the VGPU so that the VGPU continues to work.

[0010] The embodiment of the present application further provides a VGPU acceleration method, which is applicable to a customized microprocessor mounted on a host machine, wherein the microprocessor is configured with an MMIO address space of the same specification as the VGPU and mapped to each other, and the method comprises:

[0011] Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, sensing an MMIO request for the VGPU, the MMIO request including a required target MMIO address;

[0012] Calculating an address offset corresponding to the MMIO request according to a mapping position of the target MMIO address in the MMIO address space of the microprocessor;

[0013] Providing the address offset to a GPU driver in the host machine, so that the GPU driver calls the physical GPU resource pointed to by the address offset to respond to the MMIO request;

[0014] After the response is completed, the VGPU is notified so that the VGPU continues to work.

[0015] The embodiment of the present application also provides a computing device, as a host machine, on which a customized microprocessor is installed and a VGPU is created, the microprocessor is configured with an MMIO address space of the same specification as the VGPU and mapped to each other, the computing device includes a memory, a processor and a communication component;

[0016] The memory is used to store one or more computer instructions;

[0017] The processor is coupled to the memory and the communication component and is configured to execute the one or more computer instructions for:

[0018] Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, the microprocessor is used to sense an MMIO request for the VGPU, wherein the MMIO request includes a required target MMIO address;

[0019] Utilizing the microprocessor to calculate the address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in its MMIO address space;

[0020] Invoke the physical GPU resource pointed to by the address offset to respond to the MMIO request;

[0021] After the response is completed, the microprocessor is used to notify the VGPU so that the VGPU continues to work.

[0022] The embodiment of the present application also provides a microprocessor, which is mounted on a host machine, wherein the microprocessor is configured with an MMIO address space of the same specification as that of a VGPU created on the host machine and mapped to each other, and the microprocessor includes a memory, a processor, and a communication component;

[0023] The memory is used to store one or more computer instructions;

[0024] The processor is coupled to the memory and the communication component and is configured to execute the one or more computer instructions for:

[0025] Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, sensing an MMIO request for the VGPU, the MMIO request including a required target MMIO address;

[0026] Calculating an address offset corresponding to the MMIO request according to a mapping position of the target MMIO address in the MMIO address space of the microprocessor;

[0027] Providing the address offset to a GPU driver in the host machine, so that the GPU driver calls the physical GPU resource pointed to by the address offset to respond to the MMIO request;

[0028] After the response is completed, the VGPU is notified so that the VGPU continues to work.

[0029] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the aforementioned VGPU acceleration method.

[0030] In an embodiment of the present application, a customized microprocessor can be introduced into the host machine, and the microprocessor can be configured with an MMIO address space of the same specification as the VGPU and mapped to each other. Based on this, when an MMIO request for the VGPU occurs, the microprocessor will sense and take over the MMIO request, and the original virtual machine monitor will no longer sense and take over the MMIO request. In this way, the virtual machine monitor will no longer control the virtual machine to enter the exit mode due to the MMIO request, that is, the virtual machine exit problem will no longer occur during the processing of the MMIO request, which can avoid the performance impact of the virtual machine exit problem on the VGPU. The microprocessor can accurately calculate the address offset corresponding to the MMIO request instead of the virtual machine monitor, so that the original hardware simulation can be normally executed based on the address offset to respond to the MMIO request. This process is much less time-consuming than the virtual machine exit problem, which can effectively improve the performance of the VGPU. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0032] Figure 1 A flowchart of a VGPU acceleration method provided by an exemplary embodiment of the present application;

[0033] Figure 2 A logical schematic diagram of a VGPU acceleration solution provided for an exemplary embodiment of the present application;

[0034] Figure 3 A logic diagram of VGPU implementation under a traditional solution provided for an exemplary embodiment of the present application;

[0035] Figure 4 A logical diagram of VGPU implementation under an acceleration solution provided by an exemplary embodiment of the present application;

[0036] Figure 5 A flowchart of another VGPU acceleration method provided for an exemplary embodiment of the present application;

[0037] Figure 6 A schematic diagram of the structure of a microprocessor is provided for yet another exemplary embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0039] At present, MMIO requests for VGPU often lead to virtual machine exit problems, which seriously affect the performance of VGPU. To this end, in some embodiments of the present application: a customized microprocessor can be introduced into the host machine, and the microprocessor is configured with an MMIO address space of the same specification as the VGPU and mapped to each other. Based on this, when an MMIO request for VGPU occurs, the microprocessor will perceive and take over the MMIO request, and the original virtual machine monitor will no longer perceive and take over the MMIO request. In this way, the virtual machine monitor will no longer control the virtual machine to enter the exit mode due to the MMIO request, that is, the virtual machine exit problem will no longer occur during the processing of the MMIO request, which can avoid the performance impact of the virtual machine exit problem on the VGPU. The microprocessor can accurately calculate the address offset corresponding to the MMIO request instead of the virtual machine monitor, so that the original hardware simulation can be normally executed based on the address offset to respond to the MMIO request. This process is much less time-consuming than the virtual machine exit problem, thereby effectively improving the performance of the VGPU.

[0040] Before describing the technical solutions provided by the embodiments of the present application, a brief description of the technical terms that may be involved in the present application is given as follows:

[0041] GPU: Graphics Processing Unit, image processing unit, is a physical resource on the host machine.

[0042] VM: Virtual Machine, a computer simulated by software on a host machine. Multiple virtual machines can be simulated on one host machine.

[0043] VGPU is a virtual GPU virtualized by VGPU technology. VGPU technology can virtualize a physical GPU on the host machine into multiple virtual GPUs, enabling multiple virtual machines on the host machine to use a physical GPU at the same time. Each virtual machine can be equipped with one VGPU.

[0044] Virtual machine monitor, abbreviated as VMM, is software, firmware or hardware used to create and execute virtual machines. Virtual monitor is sometimes translated as: Hypervisor.

[0045] MMIO: Memory mapping I / O, which is part of the PCI specification. I / O devices are placed in memory space instead of I / O space. From the processor's perspective, after memory mapping I / O, system devices are accessed just like memory. In this way, access to the frame buffer, BIOS, and PCI devices on the AGP / PCI-E graphics card can be completed using the same assembly instructions as reading and writing memory, simplifying the difficulty of program design and the complexity of the interface.

[0046] MMIO TRAP: MMIO trap. In order to simulate the behavior of hardware in VM, VMM needs to take over MMIO request through trap, and control VM to fall into ROOT mode from NON-ROOT mode, so as to complete the simulation of hardware. MMIOTRAP will cause VM Exit problem.

[0047] A microprocessor is a physical piece of hardware that is a finished component that offers a wide range of logic capabilities, features, speeds, and voltage characteristics, and in which the processing logic is programmable.

[0048] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0049] Figure 1 A flowchart of a VGPU acceleration method provided by an exemplary embodiment of the present application is shown below. Figure 2 A logical schematic diagram of a VGPU acceleration solution provided for an exemplary embodiment of the present application.

[0050] refer to Figure 2 , the host machine may be equipped with a GPU and a customized microprocessor. Among them, the microprocessor may adopt a programmable device such as a programmable array logic device FPGA or a complex programmable logic device CPLD, but the present embodiment is not limited to this. Multiple virtual machines VM may be created on the host machine, and the GPU may be virtualized to create multiple VGPUs. In this embodiment, a VGPU may be provided for the VM on the host machine. Among them, the workflows of each VGPU are similar. For the sake of ease of description, the technical solution will be described from the perspective of a single VGPU in this embodiment, but it should be understood that the acceleration solution provided in this embodiment may be applicable to accelerating any VGPU on the host machine. In addition, in this embodiment, as with sharing the same GPU, multiple VGPUs may share the same microprocessor. Of course, the present embodiment is not limited to this. In the case where the number of VGPUs is limited, independent microprocessors may also be allocated to different VGPUs.

[0051] After the microprocessor is introduced, in this embodiment, the microprocessor can be configured with an MMIO address space of the same specification as the VGPU and mapped to each other. Among them, the MMIO address space based on the VGPU can map the physical GPU resources that can be used by the VGPU to the memory space. Similarly, the MMIO address space based on the microprocessor can map the programmable space to the memory space. Optionally, in this embodiment, an extended page table EPT (Extended Page Table), a nested page table NPT (Nested pagetable) or similar technology can be used to pre-map the MMIO address space of the VGPU to the MMIO address space of the microprocessor. EPT, NPT, etc. are page table virtualization hardware support technologies in CPU virtualization, and the detailed logic of these technologies will not be repeated here. It should be understood that in this embodiment, other mapping methods can also be used to establish a perception relationship between the hardware microprocessor and the virtual VGPU, and establish a mapping relationship from the address dimension. It should be emphasized here that the specifications of the MMIO address space of the programmable hardware must be consistent with the specifications of the MMIO address space of the VGPU to ensure that the microprocessor correctly perceives the address information in the MMIO request.

[0052] In addition, it should be noted that, as mentioned above, there may be a situation where multiple VGPUs share the same microprocessor. In this regard, in this embodiment, multiple independent MMIO address spaces can be configured for the microprocessor to serve different VGPUs.

[0053] On this basis, reference Figure 1 The VGPU acceleration method provided in this embodiment may include:

[0054] Step 100: Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, the microprocessor is used to sense the MMIO request for the VGPU, where the MMIO request includes the required target MMIO address;

[0055] Step 101, using a microprocessor to calculate an address offset corresponding to an MMIO request according to a mapping position of a target MMIO address in its MMIO address space;

[0056] Step 102: Call the physical GPU resource pointed to by the address offset to respond to the MMIO request;

[0057] Step 103: After the response is completed, the microprocessor is used to notify the VGPU so that the VGPU continues to work.

[0058] It should be understood that in this embodiment, since the MMIO address space of the VGPU is mapped to the MMIO address space corresponding to the microprocessor on the virtual machine, this naturally results in the VGPU no longer needing to be TRAPed, but being sensed by the microprocessor. The microprocessor can sense the MMIO request for the VGPU through the bus.

[0059] In actual applications, when an image processing task that requires the participation of physical GPU resources occurs in a VM, the VGPU driver in the VM can access the MMIO address space of the VGPU to initiate an MMIO request for the VGPU and set the required target MMIO address in the MMIO request. It should be understood that the MMIO address can actually be regarded as an identifier, more specifically, as an identifier defined for a physical GPU resource. In this way, specifying the target MMIO address in the MMIO request is actually specifying the physical GPU resource to be called. However, since the host manages the physical GPU resources on it according to the host physical address space, it is also necessary to convert the target MMIO address in the MMIO request into the host physical address in order to actually find the required physical GPU resource.

[0060] To this end, in step 101, the microprocessor may be used to calculate the address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in its MMIO address space.

[0061] As mentioned above, in this embodiment, the specifications of the MMIO address space of the microprocessor and the MMIO address space of the VGPU are consistent and mapped to each other. Therefore, after the microprocessor senses the target MMIO address in the MMIO request, it can determine the mapping position of the target MMIO address in the MMIO address space of the microprocessor according to the mapping relationship, thereby calculating the address offset corresponding to the MMIO request. For example, if the MMIO address space of the VGPU is 4000-5000, and the target MMIO address specified in the MMIO request is 4100, then based on the mapping relationship, the microprocessor can determine that the mapping position of the target MMIO address 4100 in the MMIO address space 6000-7000 of the microprocessor is address 6100, so that the offset between the calculated mapping position and the starting address 6000 of the MMIO address space of the microprocessor can be 100, which is used as the address offset corresponding to the MMIO request.

[0062] In actual application, in step 101, when the microprocessor senses the MMIO request, it can calculate the offset between the mapping position and the starting address of the MMIO address space of the microprocessor as the address offset. The microprocessor driver can work in the kernel space of the host machine to drive the microprocessor to run.

[0063] It should be understood that in this embodiment, the core work of the microprocessor is to calculate the address offset corresponding to the MMIO request, and the address offset can support the normal execution of the original hardware simulation work without the intervention of the virtual machine monitor. For this reason, in this embodiment, the MMIO address space of the microprocessor does not need to be associated with the physical GPU resources that can be used by the VGPU. This is mainly because the microprocessor in this embodiment is mainly used to undertake the address mapping function, and the specific hardware simulation operation is still dominated by the GPU driver on the host machine. This can avoid the problem of excessive workload of the microprocessor and ensure the lightweight of the microprocessor.

[0064] refer to Figure 1 and Figure 2 In step 102, the physical GPU resource pointed to by the address offset may be called to respond to the MMIO request.

[0065] As mentioned above, the target MMIO address in the MMIO request needs to be converted into the host machine physical address in order to actually find the required physical GPU resources. Although the MMIO request is taken over by programmable hardware in this embodiment, the original mapping space of the VGPU's MMIO address space in the host machine's physical address space can be retained as the physical address space corresponding to the VGPU's MMIO address space. On this basis, in step 102, the microprocessor can be used to provide the address offset to the GPU driver on the host machine; the host machine GPU driver uses the address offset to find the corresponding target physical address; and calls the physical GPU resource pointed to by the target physical address to respond to the MMIO request. Among them, the GPU driver in the host machine works in the kernel space of the host machine, and is used to drive the physical GPU resources on the host machine to work. Optionally, the GPU driver can wake up the VGPU control, and then the VGPU control can find the target physical address.

[0066] Continuing with the previous example, the MMIO address space of the VGPU is 4000-5000, and the address offset calculated by the microprocessor is 100. According to the original mapping space 2000-3000 of the reserved MMIO address space of the VGPU in the physical address space of the host, it is determined that the target physical address required for the MMIO request is 2100 in the physical address space of the host. In this way, the GPU driver can call the physical GPU resource with the physical address of 2100 to respond to the MMIO request.

[0067] In this embodiment, while the microprocessor calculates the address offset and the GPU driver calls the relevant physical GPU resources to respond to the MMIO request, the VGPU can remain in a waiting state without causing an MMIO TRAP or a virtual machine exit problem. Compared with the time consumed by the virtual machine exit, the waiting process in this embodiment is very short. After the response processing to the MMIO request is completed, the VGPU can end the waiting process and enter a normal working state.

[0068] refer to Figure 1 and Figure 2 In step 103, after the response is completed, the microprocessor can be used to notify the VGPU so that the VGPU continues to work.

[0069] In this embodiment, the microprocessor can use a bus method to notify the VGPU driver that the response has been completed and the virtual machine has continued to execute. Specifically, the microprocessor can provide the notification to the VGPU driver based on the TLP packet.

[0070] Accordingly, in this embodiment, a customized microprocessor can be introduced into the host machine, and the microprocessor can be configured with an MMIO address space of the same specification as the VGPU and mapped to each other. Based on this, when an MMIO request for the VGPU occurs, the microprocessor will sense and take over the MMIO request, and the original virtual machine monitor will no longer sense and take over the MMIO request. In this way, the virtual machine monitor will no longer control the virtual machine to enter the exit mode due to the MMIO request, that is, the virtual machine exit problem will no longer occur during the processing of the MMIO request, which can avoid the performance impact of the virtual machine exit problem on the VGPU. The microprocessor can accurately calculate the address offset corresponding to the MMIO request instead of the virtual machine monitor, so that the original hardware simulation can be normally executed based on the address offset to respond to the MMIO request. This process is much less time-consuming than the virtual machine exit problem, which can effectively improve the performance of the VGPU.

[0071] Figure 3 A logical diagram of VGPU implementation under a traditional solution provided for an exemplary embodiment of the present application. Figure 4 This is a VGPU implementation logic diagram for an acceleration solution provided by an exemplary embodiment of the present application. Figure 3 and Figure 4 The VGPU implementation logic in the embodiment is used to illustrate the technical advantages of the VGPU acceleration solution provided by this embodiment.

[0072] refer to Figure 3 and Figure 4 In the two sets of implementation logic, two virtual machines VM1 and VM2 are created on the host machine. The implementation logic is explained by taking the VGPU created on VM1 as an example.

[0073] refer to Figure 3 , the VGPU implementation logic under the traditional solution may include:

[0074] 1. The VGPU driver in VM1 accesses the MMIO address space of the VGPU and generates an MMIO request;

[0075] 2. MMIO TRAP occurs, and the MMIO request is intercepted by the hypervisor. The hypervisor controls the VM to enter the root mode to prevent the VM from unauthorized access to the hardware resources on the host through MMIO requests. At this time, the VM exit occurs;

[0076] 3. Convert the target MMIO address of MMIO TRAP into an address offset (GPA offset) and pass it to the GPU driver in the host machine;

[0077] 4. The host GPU driver wakes up the VGPU manager (VGPU management), converts the address offset to the target physical address, and calls the corresponding hardware GPU resource for software simulation to respond to the MMIO request;

[0078] 5. The VGPU manager simulation ends and notifies the GPU driver;

[0079] 6. The GPU Host driver notifies the hypervisor that the simulation is over.

[0080] 7. Hypervisor controls the VM to return to Non-Root mode;

[0081] 8. The VGPU driver in the VM continues to run.

[0082] It is known that in Figure 3 In the VGPU implementation logic provided, the hypervisor takes over the MMIO request and controls the VM to switch between Root mode and Non-Root mode. During this process, the VM Exit problem occurs, which requires the VM to pay a very high performance cost, seriously affecting the performance of the VGPU.

[0083] refer to Figure 4 ,and Figure 3The difference is that a customized FPGA is introduced, and an MMIO address space of the same specification as that of the VGPU is configured for the FPGA. When the VM is started, the mapping relationship between the MMIO address space of the VGPU and the physical address space of the host is no longer configured. Instead, the MMIO address space of the VGPU is mapped to the MMIO address space of the FPGA through the EPT, and the original mapping space of the MMIO address space of the VGPU in the physical address space of the host can be retained.

[0084] Based on this, reference Figure 4 , the VGPU implementation logic under the acceleration scheme may include:

[0085] 1. The VGPU driver in VM1 accesses the MMIO address space of the VGPU and generates an MMIO request;

[0086] 2. FPGA can sense the MMIO request and calculate the address offset corresponding to the MMIO request;

[0087] 3. The FPGA driver transmits the MMIO address offset to the GPU driver in the host machine through an interrupt;

[0088] 4. The host GPU driver wakes up the VGPU manager (VGPU management), converts the address offset to the target physical address, and calls the corresponding hardware GPU resource for software simulation to respond to the MMIO request.

[0089] 5. The VGPU manager simulation ends and notifies the GPU driver;

[0090] 6. GPU Host driver notifies FPGA driver that simulation is finished;

[0091] 7. The FPGA driver updates the simulation results to the hardware FPGA so that it can be read by the VGPU driver. If necessary, the host FPGA driver can inject interrupts to the VM through post interrupt mode;

[0092] 8. The end of FPGA execution causes the VGPU driver MMIO to end, and the VM continues to run.

[0093] refer to Figure 4 It can be seen that the VGPU acceleration solution provided in this embodiment completely avoids the virtual machine exit problem, and the time taken by the FPGA to calculate the address offset is also very short, which effectively improves the performance of the VGPU.

[0094] It should be noted that the execution subject of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. In addition, in some processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed or executed in parallel in the order in which they appear in this article, and the sequence numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel.

[0095] Figure 5 A flowchart of another VGPU acceleration method provided by an exemplary embodiment of the present application. Figure 1 The VGPU acceleration method in the main description is the acceleration logic with the host as the execution subject. Here, Figure 5 In the example above, the acceleration logic is described with the microprocessor as the execution subject. Figure 5 The method is applicable to a customized microprocessor mounted on a host machine, the microprocessor is configured with an MMIO address space of the same specification as the VGPU and mapped to each other, and the method may include:

[0096] 500. Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, perceive an MMIO request for the VGPU, where the MMIO request includes a required target MMIO address;

[0097] 501. Calculate the address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in the MMIO address space of the microprocessor;

[0098] 502. Provide the address offset to a GPU driver in the host machine, so that the GPU driver calls the physical GPU resource pointed to by the address offset to respond to the MMIO request;

[0099] 503. After the response is completed, notify the VGPU so that the VGPU continues to work.

[0100] In an optional embodiment, the extended page table EPT or NPT technology can be used to pre-map the MMIO address space of the VGPU to the MMIO address space of the microprocessor; and disconnect the mapping relationship between the MMIO address space of the VGPU and its original mapping space in the physical address space of the host.

[0101] In an optional embodiment, the process of calculating the address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in its MMIO address space may include:

[0102] The microprocessor calculates the offset between the mapping position and the starting address of the MMIO address space of the microprocessor as the address offset.

[0103] In an optional embodiment, after the response is completed, the process of notifying the VGPU may include:

[0104] The microprocessor notifies the VGPU via the bus.

[0105] In an alternative embodiment, the microprocessor includes a programmable array logic device (FPGA) or a complex programmable logic device (CPLD).

[0106] It is worth noting that the above Figure 5 For technical details in the relevant embodiments, please refer to the aforementioned Figure 1 In order to save space, the relevant descriptions about the microprocessor in the relevant embodiments will not be repeated here, but this should not cause any loss in the scope of protection of this application.

[0107] Figure 5 A schematic diagram of a computing device provided by another exemplary embodiment of the present application, the computing device can be used as the aforementioned host, on which a customized microprocessor 53 is installed and a VGPU is created, and the microprocessor 53 is configured with an MMIO address space of the same specification as the VGPU and mapped to each other, such as Figure 5 As shown, the computing device may include: a memory 50 , a processor 51 , and a communication component 52 .

[0108] The processor 51 is coupled to the memory 50 and the communication component 52, and is used to execute the computer program in the memory 50, so as to:

[0109] Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, the microprocessor is used to perceive the MMIO request for the VGPU, and the MMIO request contains the required target MMIO address;

[0110] The microprocessor calculates the address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in its MMIO address space;

[0111] Call the physical GPU resource pointed to by the address offset to respond to the MMIO request;

[0112] After the response is completed, the microprocessor is used to notify the VGPU so that the VGPU continues to work.

[0113] In an optional embodiment, the processor 51 may also be configured to:

[0114] Using the extended page table EPT or NPT technology, the MMIO address space of the VGPU is pre-mapped to the MMIO address space of the microprocessor;

[0115] Disconnect the mapping relationship between the VGPU's MMIO address space and its original mapping space in the host's physical address space.

[0116] In an optional embodiment, the processor 51, in the process of calling the physical GPU resource pointed to by the address offset to respond to the MMIO request, may be configured to:

[0117] Using the microprocessor to provide the address offset to the GPU driver on the host machine;

[0118] Use the GPU driver to find the target physical address corresponding to the address offset in the physical address space corresponding to the MMIO address space of the VGPU;

[0119] Calls the physical GPU resource pointed to by the target physical address in response to the MMIO request.

[0120] In an optional embodiment, the processor 51 may also be configured to:

[0121] The original mapping space of the VGPU's MMIO address space in the host's physical address space is retained as the physical address space corresponding to the VGPU's MMIO address space.

[0122] In an optional embodiment, the processor 51 uses the microprocessor to calculate the address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in its MMIO address space, which can be used to:

[0123] The microprocessor is used to calculate the offset between the mapping position and the start address of the MMIO address space of the microprocessor as the address offset.

[0124] In an optional embodiment, after the response is completed, the processor 51 can be used to notify the VGPU using the microprocessor:

[0125] Notify the VGPU via the bus.

[0126] In an alternative embodiment, the microprocessor includes a programmable array logic device (FPGA) or a complex programmable logic device (CPLD).

[0127] Further, if Figure 5 As shown, the computing device also includes: GPU54, display component 55, power supply component 56 and other components. Figure 5 Only some components are shown schematically, and it does not mean that the computing device only includes Figure 5 Components shown.

[0128] It is worth noting that the technical details of the above-mentioned computing device embodiments can be referred to the aforementioned Figure 1 To save space, the relevant descriptions in the relevant method embodiments will not be repeated here, but this should not cause any loss in the protection scope of this application.

[0129] Figure 6 A structural schematic diagram of a microprocessor provided for another exemplary embodiment of the present application, which is mounted on a host machine, is configured with an MMIO address space of the same specification as a VGPU created on the host machine and mapped to each other, and the microprocessor may include: a memory 60, a processor 61, and a communication component 62.

[0130] The processor 61 is coupled to the memory 60 and the communication component 62 for executing one or more computer instructions for:

[0131] Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, the MMIO request for the VGPU is sensed, and the MMIO request includes the required target MMIO address;

[0132] Calculate the address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in the MMIO address space of the microprocessor;

[0133] Provide the address offset to the GPU driver in the host machine, so that the GPU driver can call the physical GPU resource pointed to by the address offset to respond to the MMIO request;

[0134] After the response is completed, the VGPU is notified so that the VGPU continues to work.

[0135] In an optional embodiment, the extended page table EPT technology can be used to pre-map the MMIO address space of the VGPU to the MMIO address space of the microprocessor; and disconnect the mapping relationship between the MMIO address space of the VGPU and its original mapping space in the physical address space of the host.

[0136] In an optional embodiment, in the process of calculating the address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in its MMIO address space, the processor 61 may be configured to:

[0137] The microprocessor calculates the offset between the mapping position and the starting address of the MMIO address space of the microprocessor as the address offset.

[0138] In an optional embodiment, after the response is completed, the processor 61 notifies the VGPU and can be used to:

[0139] Notify the VGPU via the bus.

[0140] In an alternative embodiment, the microprocessor includes a programmable array logic device (FPGA) or a complex programmable logic device (CPLD).

[0141] Further, if Figure 6 As shown, the microprocessor also includes: a power supply component 63 and other components. Figure 6 Only some components are shown schematically, which does not mean that the microprocessor only includes Figure 6 Components shown.

[0142] It is worth noting that the technical details of the above-mentioned microprocessor embodiments can be referred to the aforementioned Figure 1 In order to save space, the relevant description of the microprocessor in the relevant method embodiment will not be repeated here, but this should not cause any loss in the scope of protection of this application.

[0143] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be executed by a computing device / microprocessor in the above method embodiment.

[0144] Above Figure 5 and 6 The memory in the computer is used to store computer programs and can be configured to store various other data to support operations on the computing platform. Examples of such data include instructions for any application or method operating on the computing platform, contact data, phone book data, messages, pictures, videos, etc. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0145] Above Figure 5 and 6 The communication component in is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0146] Above Figure 5 The display component in the display device includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0147] Above Figure 5 and 6 The power supply component in the device provides power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.

[0148] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0149] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0150] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0151] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0152] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0153] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0154] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0155] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0156] The above is only the embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A VGPU acceleration method, wherein a host machine where the VGPU is located is equipped with a customized microprocessor, and the microprocessor is configured with an MMIO address space of the same specification as the VGPU and mapped to each other, the method comprising: Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, the microprocessor is used to sense an MMIO request for the VGPU, wherein the MMIO request includes a required target MMIO address; Utilizing the microprocessor to calculate the address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in its MMIO address space; Invoke the physical GPU resource pointed to by the address offset to respond to the MMIO request; After the response is completed, the microprocessor is used to notify the VGPU so that the VGPU continues to work.

2. The method according to claim 1, further comprising: Pre-mapping the MMIO address space of the VGPU to the MMIO address space of the microprocessor; The mapping relationship between the MMIO address space of the VGPU and its original mapping space in the physical address space of the host machine is disconnected.

3. The method according to claim 1, wherein calling the physical GPU resource pointed to by the address offset to respond to the MMIO request comprises: Providing the address offset to a GPU driver on the host machine using the microprocessor; Using the GPU driver to search for a target physical address corresponding to the address offset in a physical address space corresponding to the MMIO address space of the VGPU according to the address offset; The physical GPU resource pointed to by the target physical address is called to respond to the MMIO request.

4. The method according to claim 3, further comprising: The original mapping space of the MMIO address space of the VGPU in the physical address space of the host is retained as the physical address space corresponding to the MMIO address space of the VGPU.

5. The method according to claim 1, wherein the microprocessor is used to calculate the address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in its MMIO address space, comprising: The microprocessor is used to calculate an offset between the mapping position and a start address of an MMIO address space of the microprocessor as the address offset.

6. The method according to claim 1, wherein after the response is completed, notifying the VGPU using the microprocessor comprises: The microprocessor is utilized to notify the VGPU via a bus. 7 . The method according to claim 1 , wherein the microprocessor comprises a field-programmable logic device (FPGA) or a complex programmable logic device (CPLD).

8. A VGPU acceleration method, applicable to a customized microprocessor mounted on a host machine, wherein the microprocessor is configured with an MMIO address space of the same specification as the VGPU and mapped to each other, the method comprising: Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, sensing an MMIO request for the VGPU, the MMIO request including a required target MMIO address; Calculating an address offset corresponding to the MMIO request according to a mapping position of the target MMIO address in the MMIO address space of the microprocessor; Providing the address offset to a GPU driver in the host machine, so that the GPU driver calls the physical GPU resource pointed to by the address offset to respond to the MMIO request; After the response is completed, the VGPU is notified so that the VGPU continues to work.

9. A computing device, as a host, on which a customized microprocessor is installed and a VGPU is created, the microprocessor is configured with an MMIO address space of the same specification as the VGPU and mapped to each other, the computing device comprising a memory, a processor and a communication component; The memory is used to store one or more computer instructions; The processor is coupled to the memory and the communication component and is configured to execute the one or more computer instructions for: Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, the microprocessor is used to sense an MMIO request for the VGPU, wherein the MMIO request includes a required target MMIO address; Utilizing the microprocessor to calculate the address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in its MMIO address space; Invoke the physical GPU resource pointed to by the address offset to respond to the MMIO request; After the response is completed, the microprocessor is used to notify the VGPU so that the VGPU continues to work.

10. The computing device of claim 9, wherein the processor is further configured to: Using extended page table (EPT) technology, the MMIO address space of the VGPU is pre-mapped to the MMIO address space of the microprocessor; The mapping relationship between the MMIO address space of the VGPU and its original mapping space in the physical address space of the host machine is disconnected.

11. A microprocessor mounted on a host machine, the microprocessor being configured with an MMIO address space of the same specification as a VGPU created on the host machine and mapped to each other, the microprocessor comprising a memory, a processor and a communication component; The memory is used to store one or more computer instructions; The processor is coupled to the memory and the communication component and is configured to execute the one or more computer instructions for: Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, sensing an MMIO request for the VGPU, the MMIO request including a required target MMIO address; Calculating an address offset corresponding to the MMIO request according to a mapping position of the target MMIO address in the MMIO address space of the microprocessor; Providing the address offset to a GPU driver in the host machine, so that the GPU driver calls the physical GPU resource pointed to by the address offset to respond to the MMIO request; After the response is completed, the VGPU is notified so that the VGPU continues to work. 12 . The microprocessor according to claim 11 , wherein the microprocessor comprises a programmable array logic device (FPGA) or a complex programmable logic device (CPLD).

13. A computer-readable storage medium storing computer instructions, which, when executed by one or more processors, causes the one or more processors to execute the VGPU acceleration method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Virtualization implementation system and method of GPU (Graphics Processing Unit)

    CN106406977A

  • Apparatus and method for hybrid layer of address mapping for virtualized input / output implementation

    CN109690505A

  • Data transmission and task processing method, device and equipment

    CN111309649A

  • Data storage fault processing method and device, storage medium and processor

    CN113312206A

  • Para-virtualized high-performance computing and GDI acceleration

    US20130181998A1