[go: up one dir, main page]

CN115080183A - VGPU acceleration method, equipment and storage medium - Google Patents

VGPU acceleration method, equipment and storage medium Download PDF

Info

Publication number
CN115080183A
CN115080183A CN202210658098.4A CN202210658098A CN115080183A CN 115080183 A CN115080183 A CN 115080183A CN 202210658098 A CN202210658098 A CN 202210658098A CN 115080183 A CN115080183 A CN 115080183A
Authority
CN
China
Prior art keywords
mmio
vgpu
microprocessor
address
address space
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210658098.4A
Other languages
Chinese (zh)
Other versions
CN115080183B (en
Inventor
吴晓光
郑晓
龙欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210658098.4A priority Critical patent/CN115080183B/en
Publication of CN115080183A publication Critical patent/CN115080183A/en
Application granted granted Critical
Publication of CN115080183B publication Critical patent/CN115080183B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45587Isolation or security of virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请实施例提供一种VGPU加速方法、设备及存储介质。可在宿主机中引入定制的微处理器,并为微处理器配置与VGPU相同规格且互相映射的MMIO地址空间。基于此,在发生针对VGPU的MMIO请求时,将由微处理器感知并接管该MMIO请求,而原本的虚拟机监测器将不再感知及接管MMIO请求,这样,虚拟机监测器将不再会因MMIO请求而控制虚拟机进入退出模式,也即是,MMIO请求的处理过程中将不再发生虚拟机退出问题,这可避免虚拟机退出问题给VGPU带来的性能影响。而微处理器可代替虚拟机监测器准确地计算出MMIO请求对应的地址偏移量,从而可基于地址偏移量而正常执行原有的硬件模拟,以响应MMIO请求,这个过程相比于虚拟机退出问题的耗时大大降低,从而可有效提升VGPU的性能。

Figure 202210658098

Embodiments of the present application provide a VGPU acceleration method, device, and storage medium. A customized microprocessor can be introduced into the host, and the microprocessor can be configured with the same MMIO address space as the VGPU and mapped to each other. Based on this, when an MMIO request for 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. The virtual machine is controlled to enter the exit mode by requesting, 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 replace the virtual machine monitor to accurately calculate the address offset corresponding to the MMIO request, so that the original hardware simulation can be normally performed based on the address offset to respond to the MMIO request. The time-consuming of the machine exit problem is greatly reduced, which can effectively improve the performance of the VGPU.

Figure 202210658098

Description

一种VGPU加速方法、设备及存储介质A VGPU acceleration method, device and storage medium

技术领域technical field

本申请涉及虚拟技术领域,尤其涉及一种VGPU加速方法、设备及存储介质。The present application relates to the field of virtual technology, and in particular, to a VGPU acceleration method, device and storage medium.

背景技术Background technique

在云计算领域,GPU(Graphics Processing Unit,图像处理单元)在渲染、AI训练和推理、大数据、编解码等领域扮演越来越重要的角色。VGPU(virtual GPU,虚拟的GPU)技术应运而生,VGPU技术可将一块物理GPU虚拟化分为多个VGPU,实现了多个虚拟机同时使用1块物理GPU的功能。In the field of cloud computing, GPU (Graphics Processing Unit, image processing unit) plays an increasingly important role in rendering, AI training and reasoning, big data, encoding and decoding and other fields. VGPU (virtual GPU, virtual GPU) technology came into being. VGPU technology can virtualize a physical GPU into multiple VGPUs, and realize the function of multiple virtual machines using one physical GPU at the same time.

但是,目前VGPU需要触发大量的MMIO(Memory mapping I/O,即内存映射I/O)陷阱来模拟硬件行为,这导致VGPU所在的虚拟机VM中频繁发生VM退出(VM Exit)事件,严重影响了VGPU的性能。However, at present, VGPU needs to trigger a large number of MMIO (Memory mapping I/O, memory mapping I/O) traps to simulate hardware behavior, which leads to frequent occurrence of VM Exit events in the virtual machine VM where the VGPU is located, which seriously affects the performance of the VGPU.

发明内容SUMMARY OF THE INVENTION

本申请的多个方面提供一种VGPU加速方法、设备及存储介质,用以改善VGPU的性能。Various aspects of the present application provide a VGPU acceleration method, device and storage medium to improve the performance of the VGPU.

本申请实施例提供一种VGPU加速方法,所述VGPU所在的宿主机上装配有定制的微处理器,所述微处理器配置有与所述VGPU相同规格且互相映射的MMIO地址空间,所述方法包括:An embodiment of the present application provides a VGPU acceleration method. The host where the VGPU is located is equipped with a customized microprocessor, and the microprocessor is configured with an MMIO address space that has the same specifications as the VGPU and is mapped to each other. Methods include:

基于所述微处理器与所述VGPU之间的MMIO地址空间映射关系,利用所述微处理器感知针对所述VGPU的MMIO请求,所述MMIO请求中包含所需的目标MMIO地址;Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, utilize the microprocessor to perceive the MMIO request for the VGPU, where the MMIO request includes the required target MMIO address;

利用所述微处理器根据所述目标MMIO地址在其MMIO地址空间中的映射位置,计算所述MMIO请求对应的地址偏移量;Using 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;

调用所述地址偏移量所指向的物理GPU资源以响应所述MMIO请求;calling the physical GPU resource pointed to by the address offset in response to the MMIO request;

在响应完成后,利用所述微处理器通知所述VGPU,以使所述VGPU继续工作。After the response is completed, the VGPU is notified by the microprocessor, so that the VGPU continues to work.

本申请实施例还提供一种VGPU加速方法,适用于装配在宿主机上的定制的微处理器,所述微处理器配置有与所述VGPU相同规格且互相映射的MMIO地址空间,所述方法包括:The embodiment of the present application also provides a VGPU acceleration method, which is suitable for a customized microprocessor installed on a host computer, where the microprocessor is configured with an MMIO address space of the same specification as the VGPU and mapped to each other, the method include:

基于所述微处理器与所述VGPU之间的MMIO地址空间映射关系,感知针对所述VGPU的MMIO请求,所述MMIO请求中包含所需的目标MMIO地址;Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, perceive the MMIO request for the VGPU, where the MMIO request includes the required target MMIO address;

根据所述目标MMIO地址在所述微处理器的MMIO地址空间中的映射位置,计算所述MMIO请求对应的地址偏移量;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;

将所述地址偏移量提供给所述宿主机中的GPU驱动,以供所述GPU驱动调用所述地址偏移量所指向的物理GPU资源以响应所述MMIO请求;providing the address offset to the GPU driver in the host, for the GPU driver to call the physical GPU resource pointed to by the address offset in response to the MMIO request;

在响应完成后,通知所述VGPU,以使所述VGPU继续工作。After the response is completed, the VGPU is notified so that the VGPU can continue to work.

本申请实施例还提供一种计算设备,作为宿主机,其上装配有定制的微处理器并创建有VGPU,所述微处理器配置有与所述VGPU相同规格且互相映射的MMIO地址空间,所述计算设备包括存储器、处理器和通信组件;The embodiment of the present application also provides a computing device, as a host, on which a customized microprocessor is equipped 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;

所述存储器用于存储一条或多条计算机指令;the memory for storing one or more computer instructions;

所述处理器与所述存储器和所述通信组件耦合,用于执行所述一条或多条计算机指令,以用于:The processor is coupled to the memory and the communication component for executing the one or more computer instructions for:

基于所述微处理器与所述VGPU之间的MMIO地址空间映射关系,利用所述微处理器感知针对所述VGPU的MMIO请求,所述MMIO请求中包含所需的目标MMIO地址;Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, utilize the microprocessor to perceive the MMIO request for the VGPU, where the MMIO request includes the required target MMIO address;

利用所述微处理器根据所述目标MMIO地址在其MMIO地址空间中的映射位置,计算所述MMIO请求对应的地址偏移量;Using 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;

调用所述地址偏移量所指向的物理GPU资源以响应所述MMIO请求;calling the physical GPU resource pointed to by the address offset in response to the MMIO request;

在响应完成后,利用所述微处理器通知所述VGPU,以使所述VGPU继续工作。After the response is completed, the VGPU is notified by the microprocessor, so that the VGPU continues to work.

本申请实施例还提供一种微处理器,装配在宿主机上,所述微处理器配置有与所述宿主机上创建的VGPU相同规格且互相映射的MMIO地址空间,所述微处理器包括存储器、处理器和通信组件;An embodiment of the present application further provides a microprocessor, which is assembled on a host computer, the microprocessor is configured with an MMIO address space of the same specification as the VGPU created on the host computer and is mapped to each other, and the microprocessor includes memory, processors and communication components;

所述存储器用于存储一条或多条计算机指令;the memory for storing one or more computer instructions;

所述处理器与所述存储器和所述通信组件耦合,用于执行所述一条或多条计算机指令,以用于:The processor is coupled to the memory and the communication component for executing the one or more computer instructions for:

基于所述微处理器与所述VGPU之间的MMIO地址空间映射关系,感知针对所述VGPU的MMIO请求,所述MMIO请求中包含所需的目标MMIO地址;Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, perceive the MMIO request for the VGPU, where the MMIO request includes the required target MMIO address;

根据所述目标MMIO地址在所述微处理器的MMIO地址空间中的映射位置,计算所述MMIO请求对应的地址偏移量;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;

将所述地址偏移量提供给所述宿主机中的GPU驱动,以供所述GPU驱动调用所述地址偏移量所指向的物理GPU资源以响应所述MMIO请求;providing the address offset to the GPU driver in the host, for the GPU driver to call the physical GPU resource pointed to by the address offset in response to the MMIO request;

在响应完成后,通知所述VGPU,以使所述VGPU继续工作。After the response is completed, the VGPU is notified so that the VGPU can continue to work.

本申请实施例还提供一种存储计算机指令的计算机可读存储介质,当所述计算机指令被一个或多个处理器执行时,致使所述一个或多个处理器执行前述的VGPU加速方法。Embodiments of the present application further provide a computer-readable storage medium storing computer instructions, and when the computer instructions are executed by one or more processors, cause the one or more processors to execute the aforementioned VGPU acceleration method.

在本申请实施例中,可在宿主机中引入定制的微处理器,并为微处理器配置与VGPU相同规格且互相映射的MMIO地址空间。基于此,在发生针对VGPU的MMIO请求时,将由微处理器感知并接管该MMIO请求,而原本的虚拟机监测器将不再感知及接管MMIO请求,这样,虚拟机监测器将不再会因MMIO请求而控制虚拟机进入退出模式,也即是,MMIO请求的处理过程中将不再发生虚拟机退出问题,这可避免虚拟机退出问题给VGPU带来的性能影响。而微处理器可代替虚拟机监测器准确地计算出MMIO请求对应的地址偏移量,从而可基于地址偏移量而正常执行原有的硬件模拟,以响应MMIO请求,这个过程相比于虚拟机退出问题的耗时大大降低,从而可有效提升VGPU的性能。In this embodiment of the present application, a customized microprocessor may be introduced into the host, 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 sense and take over the MMIO request, and the original virtual machine monitor will no longer sense and take over the MMIO request. The virtual machine is controlled to enter the exit mode by requesting, 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 replace the virtual machine monitor to accurately calculate the address offset corresponding to the MMIO request, so that the original hardware simulation can be normally performed based on the address offset to respond to the MMIO request. The time-consuming of the machine exit problem is greatly reduced, which can effectively improve the performance of the VGPU.

附图说明Description of drawings

此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The schematic embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the attached image:

图1为本申请一示例性实施例提供的一种VGPU加速方法的流程示意图;1 is a schematic flowchart of a VGPU acceleration method provided by an exemplary embodiment of the present application;

图2为本申请一示例性实施例提供的一种VGPU加速方案的逻辑示意图;2 is a schematic logical diagram of a VGPU acceleration solution provided by an exemplary embodiment of the present application;

图3为本申请一示例性实施例提供的一种传统方案下的VGPU实现逻辑示意图;3 is a schematic diagram of a VGPU implementation logic under a traditional solution provided by an exemplary embodiment of the present application;

图4为本申请一示例性实施例提供的加速方案下的VGPU实现逻辑示意图;FIG. 4 is a schematic diagram of the implementation logic of VGPU under the acceleration scheme provided by an exemplary embodiment of the present application;

图5为本申请一示例性实施例提供的另一种VGPU加速方法的流程示意图;5 is a schematic flowchart of another VGPU acceleration method provided by an exemplary embodiment of the present application;

图6为本申请又一示例性实施例提供的一种微处理器的结构示意图。FIG. 6 is a schematic structural diagram of a microprocessor according to another exemplary embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the objectives, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below with reference to the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

目前,针对VGPU的MMIO请求经常导致虚拟机退出问题,严重影响VGPU的性能。为此,本申请的一些实施例中:可在宿主机中引入定制的微处理器,并为微处理器配置与VGPU相同规格且互相映射的MMIO地址空间。基于此,在发生针对VGPU的MMIO请求时,将由微处理器感知并接管该MMIO请求,而原本的虚拟机监测器将不再感知及接管MMIO请求,这样,虚拟机监测器将不再会因MMIO请求而控制虚拟机进入退出模式,也即是,MMIO请求的处理过程中将不再发生虚拟机退出问题,这可避免虚拟机退出问题给VGPU带来的性能影响。而微处理器可代替虚拟机监测器准确地计算出MMIO请求对应的地址偏移量,从而可基于地址偏移量而正常执行原有的硬件模拟,以响应MMIO请求,这个过程相比于虚拟机退出问题的耗时大大降低,从而可有效提升VGPU的性能。At present, MMIO requests for VGPU often cause virtual machine exit problems, which seriously affects the performance of VGPU. To this end, in some embodiments of the present application, a customized microprocessor may be introduced into the host, and an MMIO address space that has the same specifications as the VGPU and is mapped to each other is configured for the microprocessor. Based on this, when an MMIO request for 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. The virtual machine is controlled to enter the exit mode by requesting, 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 replace the virtual machine monitor to accurately calculate the address offset corresponding to the MMIO request, so that the original hardware simulation can be normally performed based on the address offset to respond to the MMIO request. The time-consuming of the machine exit problem is greatly reduced, which can effectively improve the performance of the VGPU.

在描述本申请各实施例提供的技术方案前,先对本申请可能涉及到的技术术语进行简单说明,如下:Before describing the technical solutions provided by the various embodiments of this application, the technical terms that may be involved in this application are briefly explained, as follows:

GPU:Graphics Processing Unit,图像处理单元,是宿主机上的物理资源。GPU: Graphics Processing Unit, an image processing unit, is a physical resource on the host.

VM:Virtual Machine,虚拟机,是在宿主机上使用软件模拟出的计算机,一台宿主机上可模拟出多台虚拟机。VM: Virtual Machine, a virtual machine, is a computer simulated by software on a host machine, and multiple virtual machines can be simulated on one host machine.

VGPU,是通过VGPU技术虚拟出的virtual GPU(虚拟GPU),VGPU技术可将宿主机上一块物理GPU虚拟化分为多个虚拟的GPU,实现了宿主机上的多个虚拟机同时使用一块物理GPU的功能。其中,每个虚拟机可配套一个VGPU。VGPU is a virtual GPU (virtual GPU) virtualized by VGPU technology. VGPU technology can virtualize a physical GPU on the host into multiple virtual GPUs, enabling multiple virtual machines on the host to use a physical GPU at the same time. capabilities of the GPU. Among them, each virtual machine can be equipped with one VGPU.

虚拟监测器,virtual machine monitor,缩写为VMM,是用来建立和执行虚拟机的软件、固件或硬件。虚拟监测器有时也翻译作:Hypervisor。Virtual monitor, virtual machine monitor, abbreviated as VMM, is the software, firmware or hardware used to create and execute virtual machines. Virtual monitor is sometimes translated as: Hypervisor.

MMIO:Memory mapping I/O,即内存映射I/O,它是PCI规范的一部分,I/O设备被放置在内存空间而不是I/O空间。从处理器的角度看,内存映射I/O后系统设备访问起来和内存一样。这样访问AGP/PCI-E显卡上的帧缓存,BIOS,PCI设备就可以使用读写内存一样的汇编指令完成,简化了程序设计的难度和接口的复杂性。MMIO: Memory mapping I/O, that is, memory mapped 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 point of view, system devices are accessed like memory after memory-mapped I/O. In this way, the frame buffer, BIOS, and PCI devices on the AGP/PCI-E graphics card can be accessed using the same assembly instructions as reading and writing memory, which simplifies the difficulty of programming and the complexity of the interface.

MMIO TRAP:MMIO陷阱,在VM中,为了模拟硬件的行为,需要有VMM通过陷阱trap来接管MMIO请求,控制VM从NON-ROOT模式陷入到ROOT模式中,从而完成对硬件的模拟。MMIOTRAP将导致VM Exit问题。MMIO TRAP: MMIO trap. In the VM, in order to simulate the behavior of the hardware, the VMM needs to take over the MMIO request through the trap trap, and control the VM to fall into the ROOT mode from the NON-ROOT mode, thereby completing the hardware simulation. MMIOTRAP will cause VM Exit issues.

微处理器,是一种物理硬件,能够提供范围广泛的多种逻辑能力、特性、速度和电压特性的成品部件,其内的处理逻辑可编辑。A microprocessor is a physical piece of hardware that provides an off-the-shelf component with a wide variety of logic capabilities, characteristics, speed, and voltage characteristics, within which the processing logic can be programmed.

以下结合附图,详细说明本申请各实施例提供的技术方案。The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

图1为本申请一示例性实施例提供的一种VGPU加速方法的流程示意图,图2为本申请一示例性实施例提供的一种VGPU加速方案的逻辑示意图。FIG. 1 is a schematic flowchart of a VGPU acceleration method provided by an exemplary embodiment of the present application, and FIG. 2 is a logical schematic diagram of a VGPU acceleration solution provided by an exemplary embodiment of the present application.

参考图2,宿主机上可装配有GPU和定制的微处理器。其中,微处理器可采用可编程阵列逻辑器FPGA或复杂可编程逻辑器件CPLD等可编程器件,本实施例并不限于此。宿主机上可创建有多个虚拟机VM,并可对GPU进行虚拟化以创建多个VGPU,本实施例中,可为宿主机上的VM配套VGPU。其中,各个VGPU的工作流程类似,为了便于描述,本实施例中将从单个VGPU的角度来进行技术方案的说明,但应当理解的是,本实施例提供的加速方案可适用于对宿主机上的任意一个VGPU进行加速。另外,本实施例中,同共用同一GPU一样,多个VGPU可共用同一微处理器,当然,本实施例并不限于此,在VGPU数量有限的情况下,也可为不同VGPU分配提供独立的微处理器。Referring to Figure 2, the host computer may be equipped with a GPU and a custom microprocessor. The microprocessor may use programmable devices such as a programmable array logic device FPGA or a complex programmable logic device CPLD, which is not limited in this embodiment. Multiple virtual machine VMs can be created on the host, and the GPU can be virtualized to create multiple VGPUs. In this embodiment, the VMs on the host can be matched with VGPUs. The workflow of each VGPU is similar. For the convenience 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 can be applied to the host computer. Any one of the VGPU for acceleration. In addition, in this embodiment, as with sharing the same GPU, multiple VGPUs can share the same microprocessor. Of course, this embodiment is not limited to this. In the case where the number of VGPUs is limited, independent VGPU allocation can also be provided. microprocessor.

在引入微处理器之后,本实施例中,可为微处理器配置与VGPU相同规格且互相映射的MMIO地址空间。其中,基于VGPU的MMIO地址空间可将VGPU可使用的物理GPU资源映射至内存空间,同样,基于微处理器的MMIO地址空间可将可编程空间映射至内存空间。可选地,本实施例中,可采用扩展页表EPT(Extended Page Table)、嵌套页表NPT(Nested pagetable)或类似技术,预先将VGPU的MMIO地址空间映射至微处理器的MMIO地址空间。EPT、NPT等为CPU虚拟化中的页表虚拟化硬件支持技术,这些技术的详细逻辑在此不再赘述。应当理解的是,本实施例中还可采用其他映射方式在硬件的微处理器与虚拟的VGPU之间建立起感知关系,并从地址维度建立起映射关系。这里需要强调的是,可编程硬件的MMIO地址空间的规格需与VGPU的MMIO地址空间的规格一致,以保证微处理器对MMIO请求中的地址信息进行正确感知。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 VGPU-based MMIO address space can map the physical GPU resources that can be used by the VGPU to the memory space, and similarly, the microprocessor-based MMIO address space can map the programmable space to the memory space. Optionally, in this embodiment, extended page table EPT (Extended Page Table), nested page table NPT (Nested page table) or similar technologies may be used to map the MMIO address space of the VGPU to the MMIO address space of the microprocessor in advance . 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 manners may also be used to establish a perceptual relationship between the hardware microprocessor and the virtual VGPU, and to establish a mapping relationship from the address dimension. It should be emphasized here that the specification of the MMIO address space of the programmable hardware must be consistent with the specification of the MMIO address space of the VGPU to ensure that the microprocessor can correctly perceive the address information in the MMIO request.

另外,需要说明的是,正如上文提及的,可能存在多个VGPU共用同一微处理器的情况,对此,本实施例中,可为微处理器配置相互独立的多个MMIO地址空间以服务不同的VGPU。In addition, it should be noted that, as mentioned above, there may be a situation where multiple VGPUs share the same microprocessor. For this, in this embodiment, multiple independent MMIO address spaces can be configured for the microprocessor to Serve different VGPUs.

在此基础上,参考图1,本实施例提供的VGPU加速方法可包括:On this basis, with reference to FIG. 1 , the VGPU acceleration method provided in this embodiment may include:

步骤100、基于微处理器与VGPU之间的MMIO地址空间映射关系,利用微处理器感知针对VGPU的MMIO请求,MMIO请求中包含所需的目标MMIO地址;Step 100, based on the MMIO address space mapping relationship between the microprocessor and the VGPU, utilize the microprocessor to perceive the MMIO request for the VGPU, and the MMIO request includes the required target MMIO address;

步骤101、利用微处理器根据目标MMIO地址在其MMIO地址空间中的映射位置,计算MMIO请求对应的地址偏移量;Step 101, utilize 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;

步骤102、调用地址偏移量所指向的物理GPU资源以响应MMIO请求;Step 102, calling the physical GPU resource pointed to by the address offset to respond to the MMIO request;

步骤103、在响应完成后,利用微处理器通知VGPU,以使VGPU继续工作。Step 103: After the response is completed, use the microprocessor to notify the VGPU, so that the VGPU continues to work.

应当理解的是,本实施例中,由于将VGPU的MMIO地址空间映射到了虚拟机上微处理器对应的MMIO地址空间,这天然地就会导致VGPU不再需要发生TRAP,而是会被微处理器所感知。微处理器可通过总线方式感知到针对VGPU的MMIO请求。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 will naturally cause the VGPU to no longer need to generate TRAP, but will be processed by the microprocessor. perceived by the device. The microprocessor can sense the MMIO request for the VGPU through the bus.

实际应用中,在VM中发生需要物理GPU资源参与的图像处理任务时,VM中的VGPU驱动可访问VGPU的MMIO地址空间,以发起针对VGPU的MMIO请求,并在MMIO请求中设定所需的目标MMIO地址。应当理解的是,MMIO地址实质可看作是一种标识,更具体地,可看作是为某物理GPU资源定义的标识,这样,在MMIO请求中指定目标MMIO地址实质是在指定所需调用的物理GPU资源,但是,由于宿主机是按照宿主机物理地址空间来管理其上的物理GPU资源的,因此,还需要将MMIO请求中的目标MMIO地址转换为宿主机物理地址才能真正找到所需的物理GPU资源。In practical applications, when an image processing task that requires physical GPU resources occurs in the 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 value in the MMIO request. Target MMIO address. It should be understood that the MMIO address can be regarded as a kind of identification, and more specifically, it can be regarded as an identification defined for a certain physical GPU resource. In this way, specifying the target MMIO address in the MMIO request is essentially specifying the required call. However, since the host manages the physical GPU resources on it according to the host's physical address space, it is also necessary to convert the target MMIO address in the MMIO request to the host's physical address to really find the required physical GPU resources.

为此,在步骤101中,可利用微处理器根据目标MMIO地址在其MMIO地址空间中的映射位置,计算MMIO请求对应的地址偏移量。To this end, in step 101, the microprocessor may calculate the address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in its MMIO address space.

正如前文提及的,本实施例中,微处理器的MMIO地址空间与VGPU的MMIO地址空间的规格一致,且相互映射,因此,微处理器在感知到MMIO请求中的目标MMIO地址后,可根据映射关系确定出目标MMIO地址在微处理器的MMIO地址空间中的映射位置,从而计算出MMIO请求对应的地址偏移量。例如,若VGPU的MMIO地址空间为4000-5000,而MMIO请求中指定的目标MMIO地址为4100,则基于映射关系,微处理器可确定目标MMIO地址4100在微处理器的MMIO地址空间6000-7000中的映射位置为地址6100,从而可该计算映射位置与微处理器的MMIO地址空间的起始地址6000之间的偏移量为100,作为MMIO请求对应的地址偏移量。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 with each other, and they are mapped to each other. Therefore, after sensing the target MMIO address in the MMIO request, the microprocessor can The mapping position of the target MMIO address in the MMIO address space of the microprocessor is determined 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 target MMIO address 4100 is in the microprocessor's MMIO address space 6000-7000 The mapping position in is address 6100, so the offset between the calculated mapping position and the starting address 6000 of the MMIO address space of the microprocessor is 100, which is used as the address offset corresponding to the MMIO request.

实际应用中,在步骤101中,微处理器在感知到MMIO请求时,可计算映射位置与微处理器的MMIO地址空间的起始地址之间的偏移量,作为地址偏移量。其中,微处理器驱动可工作于宿主机的内核空间,用于驱动微处理器运行。In practical applications, in step 101, when the microprocessor senses the MMIO request, it can calculate the offset between the mapping position and the start address of the MMIO address space of the microprocessor as the address offset. Among them, the microprocessor driver can work in the kernel space of the host, and is used to drive the microprocessor to run.

应当理解的是,本实施例中,微处理器的核心工作既是计算出MMIO请求对应的地址偏移量,通过该地址偏移量可支持在虚拟机监测器不干预的情况下依然能够正常执行原有的硬件模拟工作。为此,本实施例中,微处理器的MMIO地址空间并无需关联至VGPU可使用的物理GPU资源,这主要是由于,本实施例中的微处理器主要用于承担地址映射功能即可,具体的硬件模拟操作还是由宿主机上的GPU驱动来主导即可,这可避免微处理器的工作负载过重的问题,保证微处理器的轻量化。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 without the intervention of the virtual machine monitor. The original hardware emulation works. 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. The specific hardware simulation operation can still be dominated by the GPU driver on the host computer, which can avoid the problem of heavy workload of the microprocessor and ensure the lightweight of the microprocessor.

参考图1和图2,在步骤102中,可调用地址偏移量所指向的物理GPU资源以响应MMIO请求。Referring to FIG. 1 and FIG. 2, in step 102, the physical GPU resource pointed to by the address offset may be invoked in response to the MMIO request.

正如前文提及的,需要将MMIO请求中的目标MMIO地址转换为宿主机物理地址才能真正找到所需的物理GPU资源,而本实施例中虽然改由可编程硬件来接管MMIO请求,但是可保留VGPU的MMIO地址空间在宿主机物理地址空间中的原有映射空间,作为VGPU的MMIO地址空间对应的物理地址空间。在此基础上,在步骤102中,可利用微处理器将地址偏移量提供给宿主机上的GPU驱动;宿主机GPU驱动通过地址偏移量,查找对应的目标物理地址;调用目标物理地址所指向的物理GPU资源以响应MMIO请求。其中,宿主机中的GPU驱动工作于宿主机的内核空间中,用于驱动宿主机上的物理GPU资源工作。可选地,可由GPU驱动唤醒VGPU管控,再由VGPU管控来查找目标物理地址。As mentioned above, the target MMIO address in the MMIO request needs to be converted into the host physical address to actually find the required physical GPU resources. In this embodiment, although programmable hardware is used to take over the MMIO request, it can be reserved The original mapping space of the VGPU's MMIO address space in the host's physical address space is used 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; the host GPU driver searches for the corresponding target physical address through the address offset; calls the target physical address The physical GPU resource pointed to in response to MMIO requests. The GPU driver in the host machine works in the kernel space of the host machine, and is used to drive the work of physical GPU resources on the host machine. Optionally, the VGPU control can be awakened by the GPU driver, and then the VGPU control can be used to find the target physical address.

承接前文中的示例,VGPU的MMIO地址空间为为4000-5000,微处理器计算出的地址偏移量为100,根据保留的VGPU的MMIO地址空间在宿主机物理地址空间中的原有映射空间2000-3000,则确定出MMIO请求所需的目标物理地址为宿主机物理地址空间中的2100。这样,GPU驱动可调用物理地址为2100的物理GPU资源以响应MMIO请求。Following 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 of the reserved VGPU MMIO address space in the physical address space of the host machine 2000-3000, then it is determined that the target physical address required by 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 at physical address 2100 in response to the MMIO request.

本实施例中,在微处理器计算地址偏移量,GPU驱动调用相关物理GPU资源响应MMIO请求的过程中,VGPU可保持在等待状态,而不会发生MMIO TRAP,也不会发生虚拟机退出问题,而相比于虚拟机退出导致的耗时,本实施例中所导致等待过程非常的短暂,在对MMIO请求的响应处理结束后,VGPU可结束等待而进入正常的工作状态。In this embodiment, in the process that 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 the waiting state, and no MMIO TRAP occurs, and no virtual machine exit occurs. Compared with the time-consuming caused 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 and enter a normal working state.

参考图1和图2,在步骤103中,可在响应完成后,利用微处理器通知VGPU,以使VGPU继续工作。Referring to FIG. 1 and FIG. 2 , in step 103 , after the response is completed, the microprocessor may be used to notify the VGPU, so that the VGPU continues to work.

本实施例中,微处理器可采用总线方式通知VGPU驱动已完成响应,已使虚拟机继续执行下去。具体地,微处理器可基于TLP包将通知提供给VGPU驱动。In this embodiment, the microprocessor may use a bus to notify the VGPU driver that the response has been completed, so that the virtual machine continues to execute. Specifically, the microprocessor may provide notifications to the VGPU driver based on the TLP packets.

据此,本实施例中,可在宿主机中引入定制的微处理器,并为微处理器配置与VGPU相同规格且互相映射的MMIO地址空间。基于此,在发生针对VGPU的MMIO请求时,将由微处理器感知并接管该MMIO请求,而原本的虚拟机监测器将不再感知及接管MMIO请求,这样,虚拟机监测器将不再会因MMIO请求而控制虚拟机进入退出模式,也即是,MMIO请求的处理过程中将不再发生虚拟机退出问题,这可避免虚拟机退出问题给VGPU带来的性能影响。而微处理器可代替虚拟机监测器准确地计算出MMIO请求对应的地址偏移量,从而可基于地址偏移量而正常执行原有的硬件模拟,以响应MMIO请求,这个过程相比于虚拟机退出问题的耗时大大降低,从而可有效提升VGPU的性能。Accordingly, in this embodiment, a customized microprocessor can be introduced into the host, and an MMIO address space of the same specification as the VGPU and mapped to each other is configured for the microprocessor. Based on this, when an MMIO request for 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. The virtual machine is controlled to enter the exit mode by requesting, 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 replace the virtual machine monitor to accurately calculate the address offset corresponding to the MMIO request, so that the original hardware simulation can be normally performed based on the address offset to respond to the MMIO request. The time-consuming of the machine exit problem is greatly reduced, which can effectively improve the performance of the VGPU.

图3为本申请一示例性实施例提供的一种传统方案下的VGPU实现逻辑示意图。图4为本申请一示例性实施例提供的加速方案下的VGPU实现逻辑示意图。以下将通过对比图3和图4中的VGPU实现逻辑来说明本实施例提供的VGPU加速方案的技术优势。FIG. 3 is a schematic diagram of the implementation logic of VGPU under a conventional solution provided by an exemplary embodiment of the present application. FIG. 4 is a schematic diagram of the implementation logic of the VGPU under the acceleration solution provided by an exemplary embodiment of the present application. The technical advantages of the VGPU acceleration solution provided by this embodiment will be described below by comparing the VGPU implementation logic in FIG. 3 and FIG. 4 .

参考图3和图4,两套实现逻辑中宿主机上军创建有2个虚拟机VM1和VM2,以在VM1上创建的VGPU为例进行实现逻辑的说明。Referring to FIG. 3 and FIG. 4 , two virtual machines VM1 and VM2 are created on the host machine in the two sets of implementation logic, and the implementation logic is described by taking the VGPU created on VM1 as an example.

参考图3,传统方案下的VGPU实现逻辑可包括:Referring to Figure 3, the VGPU implementation logic under the traditional solution may include:

1、VM1中的VGPU驱动访问VGPU的MMIO地址空间,并产生MMIO请求;1. The VGPU driver in VM1 accesses the MMIO address space of the VGPU and generates an MMIO request;

2、发生MMIO TRAP,MMIO请求被hypervisor拦截,hypervisor控制VM进入Root模式,以避免VM通过MMIO请求越权访问宿主机上的硬件资源;此时发生VM Exit;2. An MMIO TRAP occurs, the MMIO request is intercepted by the hypervisor, and the hypervisor controls the VM to enter Root mode to prevent the VM from accessing hardware resources on the host through MMIO request unauthorized access; VM Exit occurs at this time;

3、将MMIO TRAP的目标MMIO地址转换为地址偏移量(GPA offset)传给宿主机中的GPU驱动;3. Convert the target MMIO address of the MMIO TRAP into an address offset (GPA offset) and pass it to the GPU driver in the host;

4、宿主机GPU驱动唤醒VGPU manager(VGPU管控),将地址偏移量转换为目标物理地址,并调用对应的硬件GPU资源进行软件模拟,以响应MMIO请求;4. The host GPU driver wakes up the VGPU manager (VGPU control), converts the address offset into the target physical address, and calls the corresponding hardware GPU resources for software simulation to respond to MMIO requests;

5、VGPU manager模拟结束,通知到GPU驱动;5. The VGPU manager simulation is over, and the GPU driver is notified;

6、GPU Host驱动通知hypervisor模拟结束;6. The GPU Host driver notifies the hypervisor that the simulation is over;

7、Hypervisor控制VM返回Non-Root模式;7. Hypervisor controls VM to return to Non-Root mode;

8、VM中的VGPU驱动继续开始运行。8. The VGPU driver in the VM continues to run.

可知,在图3提供的VGPU实现逻辑中,hypervisor接管了MMIO请求,并控制VM在Root模式和Non-Root模式之间切换,这个过程中发生了虚拟机退出(VM Exit)问题,而这需要VM付出非常大的性能代价,严重影响了VGPU的性能。It can be seen that in the VGPU implementation logic provided in Figure 3, 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 VM pays a very large performance price, which seriously affects the performance of VGPU.

参考图4,与图3不同的是,引入了定制的FPGA,并为该FPGA配置了与VGPU相同规格的MMIO地址空间,在启动VM的时候,不再配置VGPU的MMIO地址空间与宿主机物理地址空间之间的映射关系,而是把VGPU的MMIO地址空间通过EPT映射至FPGA的MMIO地址空间,而VGPU的MMIO地址空间在宿主机物理地址空间中的原有映射空间可予以保留。Referring to Figure 4, the difference from Figure 3 is that a customized FPGA is introduced, and the MMIO address space of the same specification as the VGPU is configured for the FPGA. When the VM is started, the MMIO address space of the VGPU and the host physics are no longer configured. The mapping relationship between the address spaces is to map the MMIO address space of the VGPU to the MMIO address space of the FPGA through EPT, and the original mapping space of the MMIO address space of the VGPU in the physical address space of the host can be reserved.

基于此,参考图4,加速方案下的VGPU实现逻辑可包括:Based on this, with reference to Figure 4, the VGPU implementation logic under the acceleration scheme may include:

1、VM1中的VGPU驱动访问VGPU的MMIO地址空间,并产生MMIO请求;1. The VGPU driver in VM1 accesses the MMIO address space of the VGPU and generates an MMIO request;

2、FPGA可感知到MMIO请求,并计算MMIO请求对应的地址偏移量;2. The FPGA can perceive the MMIO request and calculate the address offset corresponding to the MMIO request;

3、FPGA驱动将MMIO的地址偏移量通过中断方式传给宿主机中的GPU驱动;3. The FPGA driver transmits the address offset of MMIO to the GPU driver in the host through an interrupt;

4、宿主机GPU驱动唤醒VGPU manager(VGPU管控),将地址偏移量转换为目标物理地址,并调用对应的硬件GPU资源进行软件模拟,以响应MMIO请求4. The host GPU driver wakes up the VGPU manager (VGPU control), converts the address offset into the target physical address, and calls the corresponding hardware GPU resources for software simulation to respond to MMIO requests

5、VGPU manager模拟结束,通知到GPU驱动;5. The VGPU manager simulation is over, and the GPU driver is notified;

6、GPU Host驱动通知FPGA驱动模拟结束;6. The GPU Host driver informs the FPGA driver that the simulation is over;

7、FPGA驱动更新模拟结果到硬件FPGA,使其可以被VGPU驱动读取,同时必要的话,宿主机FPGA驱动可通过post interrupt方式向VM注入中断;7. The FPGA driver updates the simulation results to the hardware FPGA so that it can be read by the VGPU driver. At the same time, if necessary, the host FPGA driver can inject interrupts into the VM through post interrupt;

8、FPGA执行结束导致VGPU驱动MMIO结束,VM继续运行。8. The end of FPGA execution leads to the end of VGPU driving MMIO, and the VM continues to run.

参考图4可知,本实施例提供的VGPU加速方案中,完全避免了虚拟机退出问题,而且,FPGA计算地址偏移量所占用的耗时也非常短暂,这有效提升了VGPU的性能。Referring to FIG. 4 , in the VGPU acceleration solution provided in this embodiment, the virtual machine exit problem is completely avoided, and the time occupied by the FPGA to calculate the address offset is also very short, which effectively improves the performance of the VGPU.

需要说明的是,上述实施例所提供方法的各步骤的执行主体均可以是同一设备,或者,该方法也由不同设备作为执行主体。另外,在上述实施例及附图中的描述的一些流程中,包含了按照特定顺序出现的多个操作,但是应该清楚了解,这些操作可以不按照其在本文中出现的顺序来执行或并行执行,操作的序号如101、102等,仅仅是用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作可以按顺序执行或并行执行。It should be noted that, the execution subject of each step of the method provided by the above embodiments may be the same device, or the method may also be executed by different devices. In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations appearing in a specific order are included, but it should be clearly understood that these operations may be performed out of the order in which they appear in this document or performed in parallel , the sequence numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the sequence numbers themselves do not represent any execution order. Additionally, these flows may include more or fewer operations, and these operations may be performed sequentially or in parallel.

图5为本申请一示例性实施例提供的另一种VGPU加速方法的流程示意图。前述图1中的VGPU加速方法主要是以宿主机作为执行主体而描述的加速逻辑,这里,图5中,是以微处理器作为执行主体而描述的加速逻辑。参考图5,该方法适用于装配在宿主机上的定制的微处理器,微处理器配置有与VGPU相同规格且互相映射的MMIO地址空间,该方法可包括:FIG. 5 is a schematic flowchart of another VGPU acceleration method provided by an exemplary embodiment of the present application. The VGPU acceleration method in the aforementioned FIG. 1 is mainly the acceleration logic described with the host as the execution body. Here, in FIG. 5 , the acceleration logic described with the microprocessor as the execution body. Referring to FIG. 5 , the method is applicable to a customized microprocessor installed on the host computer. The microprocessor is configured with the same specification as the VGPU and is mapped to each other with MMIO address spaces. The method may include:

500、基于微处理器与VGPU之间的MMIO地址空间映射关系,感知针对VGPU的MMIO请求,MMIO请求中包含所需的目标MMIO地址;500. Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, perceive the MMIO request for the VGPU, and the MMIO request contains the required target MMIO address;

501、根据目标MMIO地址在微处理器的MMIO地址空间中的映射位置,计算MMIO请求对应的地址偏移量;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;

502、将地址偏移量提供给宿主机中的GPU驱动,以供GPU驱动调用地址偏移量所指向的物理GPU资源以响应MMIO请求;502. Provide the address offset to the GPU driver in the host, so that the GPU driver can call the physical GPU resource pointed to by the address offset to respond to the MMIO request;

503、在响应完成后,通知VGPU,以使VGPU继续工作。503. After the response is completed, notify the VGPU so that the VGPU continues to work.

在一可选实施例中,可采用扩展页表EPT或NPT技术,预先将VGPU的MMIO地址空间映射至微处理器的MMIO地址空间;并断开VGPU的MMIO地址空间与其在宿主机物理地址空间中的原有映射空间之间的映射关系。In an optional embodiment, the extended page table EPT or NPT technology can be used to map the MMIO address space of the VGPU to the MMIO address space of the microprocessor in advance; and disconnect the MMIO address space of the VGPU from the physical address space of the host machine. The mapping relationship between the original mapping spaces in .

在一可选实施例中,根据目标MMIO地址在其MMIO地址空间中的映射位置,计算MMIO请求对应的地址偏移量的过程,可包括:In an optional embodiment, according to the mapping position of the target MMIO address in its MMIO address space, the process of calculating the address offset corresponding to the MMIO request may include:

通过微处理器计算映射位置与微处理器的MMIO地址空间的起始地址之间的偏移量,作为地址偏移量。The offset between the mapping position and the starting address of the MMIO address space of the microprocessor is calculated by the microprocessor as an address offset.

在一可选实施例中,在响应完成后,通知VGPU的过程,可包括:In an optional embodiment, after the response is completed, the process of notifying the VGPU may include:

利用微处理器通过总线的方式通知VGPU。Use the microprocessor to notify the VGPU through the bus.

在一可选实施例中,微处理器包括可编程阵列逻辑器FPGA或复杂可编程逻辑器件CPLD。In an alternative embodiment, the microprocessor includes a programmable array logic device FPGA or a complex programmable logic device CPLD.

值得说明的是,上述图5相关实施例中的技术细节,可参考前述图1相关实施例中关于微处理器的相关描述,为节省篇幅,在此不再赘述,但这不应造成本申请保护范围的损失。It is worth noting that, for the technical details in the above-mentioned embodiment of FIG. 5 , reference may be made to the relevant description of the microprocessor in the above-mentioned embodiment of FIG. 1 . loss of protection.

图5为本申请另一示例性实施例提供的一种计算设备的结构示意图,该计算设备可作为前述的宿主机,其上装配有定制的微处理器53并创建有VGPU,微处理器53配置有与VGPU相同规格且互相映射的MMIO地址空间,如图5所示,该计算设备可包括:存储器50、处理器51以及通信组件52。FIG. 5 is a schematic structural diagram of a computing device provided by another exemplary embodiment of the present application. The computing device can be used as the aforementioned host computer, and is equipped with a customized microprocessor 53 and created with a VGPU. The microprocessor 53 Configured with MMIO address spaces of the same specifications as the VGPU and mapped to each other, as shown in FIG. 5 , the computing device may include: a memory 50 , a processor 51 and a communication component 52 .

处理器51,与存储器50和通信组件52耦合,用于执行存储器50中的计算机程序,以用于:A processor 51, coupled to the memory 50 and the communication component 52, executes a computer program in the memory 50 for:

基于微处理器与VGPU之间的MMIO地址空间映射关系,利用微处理器感知针对VGPU的MMIO请求,MMIO请求中包含所需的目标MMIO地址;Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, the microprocessor senses the MMIO request for the VGPU, and the MMIO request contains the required target MMIO address;

利用微处理器根据目标MMIO地址在其MMIO地址空间中的映射位置,计算MMIO请求对应的地址偏移量;Use 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;

调用地址偏移量所指向的物理GPU资源以响应MMIO请求;Call the physical GPU resource pointed to by the address offset in response to an MMIO request;

在响应完成后,利用微处理器通知VGPU,以使VGPU继续工作。After the response is completed, the microprocessor is used to notify the VGPU, so that the VGPU continues to work.

在一可选实施例中,处理器51还可用于:In an optional embodiment, the processor 51 may also be used to:

采用扩展页表EPT或NPT技术,预先将VGPU的MMIO地址空间映射至微处理器的MMIO地址空间;Using the extended page table EPT or NPT technology, the MMIO address space of the VGPU is mapped to the MMIO address space of the microprocessor in advance;

断开VGPU的MMIO地址空间与其在宿主机物理地址空间中的原有映射空间之间的映射关系。Disconnect the mapping relationship between the VGPU's MMIO address space and its original mapping space in the host's physical address space.

在一可选实施例中,处理器51在调用地址偏移量所指向的物理GPU资源以响应MMIO请求过程中,可用于:In an optional embodiment, in the process of invoking the physical GPU resource pointed to by the address offset in response to the MMIO request, the processor 51 may be used to:

利用微处理器将地址偏移量提供给宿主机上的GPU驱动;Use the microprocessor to provide the address offset to the GPU driver on the host;

利用GPU驱动在VGPU的MMIO地址空间对应的物理地址空间中,查找地址偏移量所对应的目标物理地址;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;

调用目标物理地址所指向的物理GPU资源以响应MMIO请求。Call the physical GPU resource pointed to by the target physical address in response to an MMIO request.

在一可选实施例中,处理器51还可用于:In an optional embodiment, the processor 51 may also be used to:

保留VGPU的MMIO地址空间在宿主机物理地址空间中的原有映射空间,作为VGPU的MMIO地址空间对应的物理地址空间。The original mapping space of the VGPU's MMIO address space in the host's physical address space is reserved as the physical address space corresponding to the VGPU's MMIO address space.

在一可选实施例中,处理器51利用微处理器根据目标MMIO地址在其MMIO地址空间中的映射位置,计算MMIO请求对应的地址偏移量过程中,可用于:In an optional embodiment, the processor 51 utilizes 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, and can be used for:

利用微处理器计算映射位置与微处理器的MMIO地址空间的起始地址之间的偏移量,作为地址偏移量。Use the microprocessor to calculate the offset between the mapping position and the starting address of the MMIO address space of the microprocessor as the address offset.

在一可选实施例中,处理器51在响应完成后,利用微处理器通知VGPU的过程中,可用于:In an optional embodiment, after the response is completed, the processor 51 may use the microprocessor to notify the VGPU in the process of:

通过总线的方式通知VGPU。Notify the VGPU through the bus.

在一可选实施例中,微处理器包括可编程阵列逻辑器FPGA或复杂可编程逻辑器件CPLD。In an alternative embodiment, the microprocessor includes a programmable array logic device FPGA or a complex programmable logic device CPLD.

进一步,如图5所示,该计算设备还包括:GPU54、显示组件55、电源组件56等其它组件。图5中仅示意性给出部分组件,并不意味着计算设备只包括图5所示组件。Further, as shown in FIG. 5 , the computing device further includes: a GPU 54 , a display component 55 , a power supply component 56 and other components. Only some components are schematically shown in FIG. 5 , which does not mean that the computing device only includes the components shown in FIG. 5 .

值得说明的是,上述关于计算设备各实施例中的技术细节,可参考前述的图1相关方法实施例中的相关描述,为节省篇幅,在此不再赘述,但这不应造成本申请保护范围的损失。It is worth noting that, for the technical details in the above-mentioned embodiments of the computing device, reference may be made to the relevant descriptions in the foregoing related method embodiments in FIG. loss of range.

图6为本申请又一示例性实施例提供的一种微处理器的结构示意图,该装配在宿主机上,微处理器配置有与宿主机上创建的VGPU相同规格且互相映射的MMIO地址空间,该微处理器可包括:存储器60、处理器61以及通信组件62。FIG. 6 is a schematic structural diagram of a microprocessor provided by another exemplary embodiment of the present application, which is assembled on a host computer, and the microprocessor is configured with MMIO address spaces of the same specifications and mapped to each other as the VGPU created on the host computer. , the microprocessor may include: a memory 60 , a processor 61 and a communication component 62 .

处理器61与存储器60和通信组件62耦合,用于执行一条或多条计算机指令,以用于:Processor 61 is coupled to memory 60 and communication component 62 for executing one or more computer instructions for:

基于微处理器与VGPU之间的MMIO地址空间映射关系,感知针对VGPU的MMIO请求,MMIO请求中包含所需的目标MMIO地址;Based on the MMIO address space mapping relationship between the microprocessor and the VGPU, the MMIO request for the VGPU is perceived, and the MMIO request contains the required target MMIO address;

根据目标MMIO地址在微处理器的MMIO地址空间中的映射位置,计算MMIO请求对应的地址偏移量;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;

将地址偏移量提供给宿主机中的GPU驱动,以供GPU驱动调用地址偏移量所指向的物理GPU资源以响应MMIO请求;Provide the address offset to the GPU driver in the host, so that the GPU driver can call the physical GPU resource pointed to by the address offset in response to the MMIO request;

在响应完成后,通知VGPU,以使VGPU继续工作。After the response is complete, notify the VGPU so that the VGPU can continue to work.

在一可选实施例中,可采用扩展页表EPT技术,预先将VGPU的MMIO地址空间映射至微处理器的MMIO地址空间;并断开VGPU的MMIO地址空间与其在宿主机物理地址空间中的原有映射空间之间的映射关系。In an optional embodiment, the extended page table EPT technology can be used to map the MMIO address space of the VGPU to the MMIO address space of the microprocessor in advance; and disconnect the MMIO address space of the VGPU from its connection in the host physical address space. The mapping relationship between the original mapping spaces.

在一可选实施例中,处理器61在根据目标MMIO地址在其MMIO地址空间中的映射位置,计算MMIO请求对应的地址偏移量的过程中,可用于: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 can be used to:

通过微处理器计算映射位置与微处理器的MMIO地址空间的起始地址之间的偏移量,作为地址偏移量。The offset between the mapping position and the starting address of the MMIO address space of the microprocessor is calculated by the microprocessor as an address offset.

在一可选实施例中,处理器61在响应完成后,通知VGPU的过程中,可用于:In an optional embodiment, in the process of notifying the VGPU after the response is completed, the processor 61 may be used to:

通过总线的方式通知VGPU。Notify the VGPU through the bus.

在一可选实施例中,微处理器包括可编程阵列逻辑器FPGA或复杂可编程逻辑器件CPLD。In an alternative embodiment, the microprocessor includes a programmable array logic device FPGA or a complex programmable logic device CPLD.

进一步,如图6所示,该微处理器还包括:电源组件63等其它组件。图6中仅示意性给出部分组件,并不意味着微处理器只包括图6所示组件。Further, as shown in FIG. 6 , the microprocessor also includes: a power supply component 63 and other components. Only some components are schematically shown in FIG. 6 , which does not mean that the microprocessor only includes the components shown in FIG. 6 .

值得说明的是,上述关于微处理器各实施例中的技术细节,可参考前述的图1相关方法实施例中关于微处理器的相关描述,为节省篇幅,在此不再赘述,但这不应造成本申请保护范围的损失。It is worth noting that, for the technical details of the above-mentioned embodiments of the microprocessor, reference may be made to the relevant description of the microprocessor in the foregoing related method embodiments of FIG. The loss of the protection scope of this application shall be caused.

相应地,本申请实施例还提供一种存储有计算机程序的计算机可读存储介质,计算机程序被执行时能够实现上述方法实施例中可由计算设备/微处理器执行的各步骤。Correspondingly, the embodiments of the present application further provide a computer-readable storage medium storing a computer program, and when the computer program is executed, each step that can be executed by a computing device/microprocessor in the foregoing method embodiments can be implemented.

上述图5和6中的存储器,用于存储计算机程序,并可被配置为存储其它各种数据以支持在计算平台上的操作。这些数据的示例包括用于在计算平台上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memories in FIGS. 5 and 6 described above are used to store computer programs and may 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, phonebook data, messages, pictures, videos, etc. 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 or Optical Disk.

上述图5和6中的通信组件,被配置为便于通信组件所在设备和其他设备之间有线或无线方式的通信。通信组件所在设备可以接入基于通信标准的无线网络,如WiFi,2G、3G、4G/LTE、5G等移动通信网络,或它们的组合。在一个示例性实施例中,通信组件经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。The above-mentioned communication components in FIGS. 5 and 6 are 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, a mobile communication network such as 2G, 3G, 4G/LTE, 5G, or a combination thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication assembly further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

上述图5中的显示组件,包括屏幕,其屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。The above-mentioned display assembly in FIG. 5 includes a screen, and the screen 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, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action.

上述图5和6中的电源组件,为电源组件所在设备的各种组件提供电力。电源组件可以包括电源管理系统,一个或多个电源,及其他与为电源组件所在设备生成、管理和分配电力相关联的组件。The power supply assemblies in Figures 5 and 6 above provide power for various components of the equipment in which the power supply assemblies are located. A power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the equipment in which the power supply assembly is located.

本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by those skilled in the art, the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-persistent memory in computer readable media, random access memory (RAM) and/or non-volatile memory in the form of, for example, read only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带式磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes both persistent and non-permanent, removable and non-removable media, and storage of information may be implemented by any method or technology. Information may be computer readable instructions, data structures, modules of programs, 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 Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridges, tape-based disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, excludes transitory computer-readable media, such as modulated data signals and carrier waves.

还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device comprising a series of elements includes not only those elements, but also Other elements not expressly listed, or which are inherent to such a process, method, article of manufacture, or apparatus are also included. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article of manufacture, or device that includes the element.

以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are merely examples of the present application, and are not intended to limit the present application. Various modifications and variations of this application are possible for those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included within the protection scope of this application.

Claims (13)

1. A VGPU acceleration method, the VGPU is equipped with a customized microprocessor on a host computer, the microprocessor is configured with MMIO address space which has the same specification with the VGPU and is mapped with each other, the method comprises the following steps:
sensing an MMIO request aiming at the VGPU by utilizing the microprocessor based on the MMIO address space mapping relation between the microprocessor and the VGPU, wherein the MMIO request comprises a required target MMIO address;
utilizing the microprocessor to calculate address offset corresponding to the MMIO request according to the mapping position of the target MMIO address in the MMIO address space;
calling the physical GPU resource pointed by the address offset to respond to the MMIO request;
and after the response is finished, informing the VGPU by the microprocessor so that the VGPU continues to work.
2. The method of claim 1, further comprising:
mapping the MMIO address space of the VGPU to the MMIO address space of the microprocessor in advance;
and disconnecting the mapping relation between the MMIO address space of the VGPU and the original mapping space of the VGPU in the physical address space of the host machine.
3. The method of claim 1, the invoking the physical GPU resource pointed to by the address offset to respond to the MMIO request, comprising:
providing, with the microprocessor, the address offset to a GPU driver on the host;
searching a target physical address corresponding to the address offset in a physical address space corresponding to the MMIO address space of the VGPU by using the GPU driver according to the address offset;
and calling the physical GPU resource pointed by the target physical address to respond to the MMIO request.
4. The method of claim 3, further comprising:
and reserving the original mapping space of the MMIO address space of the VGPU in the physical address space of the host machine, and using the mapping space as the physical address space corresponding to the MMIO address space of the VGPU.
5. The method of claim 1, wherein said calculating, by the microprocessor, an address offset corresponding to the MMIO request according to a mapping location of the target MMIO address in its MMIO address space comprises:
and calculating the offset between the mapping position and the initial address of the MMIO address space of the microprocessor by using the microprocessor as the address offset.
6. The method of claim 1, said notifying the VGPU with the microprocessor after the response is complete, comprising:
and informing the VGPU by the microprocessor through a bus.
7. The method of claim 1, the microprocessor comprising a programmable array logic (FPGA) or a Complex Programmable Logic Device (CPLD).
8. A VGPU acceleration method, which is applicable to a customized microprocessor assembled on a host machine, wherein the microprocessor is configured with an MMIO address space which has the same specification as the VGPU and is mutually mapped, and the method comprises the following steps:
sensing an MMIO request aiming at the VGPU based on an MMIO address space mapping relation between the microprocessor and the VGPU, wherein the MMIO request comprises a required target MMIO address;
calculating 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;
providing the address offset to a GPU driver in the host machine, so that the GPU driver calls a physical GPU resource pointed by the address offset to respond to the MMIO request;
and after the response is completed, notifying the VGPU to enable the VGPU to continue to work.
9. A computing device as a host, having a custom microprocessor assembled thereon and created with a VGPU, the microprocessor configured with 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 to store one or more computer instructions;
the processor, coupled with the memory and the communication component, to execute the one or more computer instructions to:
sensing an MMIO request aiming at the VGPU by utilizing the microprocessor based on the MMIO address space mapping relation between the microprocessor and the VGPU, wherein the MMIO request comprises 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 the MMIO address space;
calling the physical GPU resource pointed by the address offset to respond to the MMIO request;
and after the response is finished, informing the VGPU by the microprocessor so that the VGPU continues to work.
10. The computing device of claim 9, the processor further to:
adopting an Extended Page Table (EPT) technology to map the MMIO address space of the VGPU to the MMIO address space of the microprocessor in advance;
and disconnecting the mapping relation between the MMIO address space of the VGPU and the original mapping space of the VGPU in the physical address space of the host machine.
11. A microprocessor mounted on a host, said microprocessor configured with MMIO address space of the same specification as a VGPU created on said host and mapped to each other, said microprocessor comprising a memory, a processor and a communication component;
the memory is to store one or more computer instructions;
the processor, coupled with the memory and the communication component, to execute the one or more computer instructions to:
sensing an MMIO request aiming at the VGPU based on an MMIO address space mapping relation between the microprocessor and the VGPU, wherein the MMIO request comprises a required target MMIO address;
calculating 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;
providing the address offset to a GPU driver in the host machine, so that the GPU driver calls a physical GPU resource pointed by the address offset to respond to the MMIO request;
and after the response is completed, notifying the VGPU to enable the VGPU to continue to work.
12. The microprocessor of claim 11, comprising a programmable array logic (FPGA) or a Complex Programmable Logic Device (CPLD).
13. A computer-readable storage medium storing computer instructions that, when executed by one or more processors, cause the one or more processors to perform the VGPU acceleration method of any one of claims 1-8.
CN202210658098.4A 2022-06-10 2022-06-10 A VGPU acceleration method, device and storage medium Active CN115080183B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210658098.4A CN115080183B (en) 2022-06-10 2022-06-10 A VGPU acceleration method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210658098.4A CN115080183B (en) 2022-06-10 2022-06-10 A VGPU acceleration method, device and storage medium

Publications (2)

Publication Number Publication Date
CN115080183A true CN115080183A (en) 2022-09-20
CN115080183B CN115080183B (en) 2024-12-06

Family

ID=83250635

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210658098.4A Active CN115080183B (en) 2022-06-10 2022-06-10 A VGPU acceleration method, device and storage medium

Country Status (1)

Country Link
CN (1) CN115080183B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024098594A1 (en) * 2022-11-07 2024-05-16 海光信息技术股份有限公司 Code protection system and method, virtual system architecture, chip and electronic device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130181998A1 (en) * 2012-01-17 2013-07-18 Microsoft Corporation Para-virtualized high-performance computing and gdi acceleration
CN106406977A (en) * 2016-08-26 2017-02-15 山东乾云启创信息科技股份有限公司 Virtualization implementation system and method of GPU (Graphics Processing Unit)
US20180373570A1 (en) * 2015-12-22 2018-12-27 Intel Corporation Apparatus and method for cloud-based graphics validation
CN109690505A (en) * 2016-09-26 2019-04-26 英特尔公司 Device and method for the mixed layer address of cache for virtualization input/output embodiment
CN111309649A (en) * 2020-02-11 2020-06-19 支付宝(杭州)信息技术有限公司 Data transmission and task processing method, device and equipment
CN113312206A (en) * 2020-04-09 2021-08-27 阿里巴巴集团控股有限公司 Data storage fault processing method and device, storage medium and processor

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130181998A1 (en) * 2012-01-17 2013-07-18 Microsoft Corporation Para-virtualized high-performance computing and gdi acceleration
US20180373570A1 (en) * 2015-12-22 2018-12-27 Intel Corporation Apparatus and method for cloud-based graphics validation
CN106406977A (en) * 2016-08-26 2017-02-15 山东乾云启创信息科技股份有限公司 Virtualization implementation system and method of GPU (Graphics Processing Unit)
CN109690505A (en) * 2016-09-26 2019-04-26 英特尔公司 Device and method for the mixed layer address of cache for virtualization input/output embodiment
CN111309649A (en) * 2020-02-11 2020-06-19 支付宝(杭州)信息技术有限公司 Data transmission and task processing method, device and equipment
CN113312206A (en) * 2020-04-09 2021-08-27 阿里巴巴集团控股有限公司 Data storage fault processing method and device, storage medium and processor

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MOCHI XUE ET.AL: "Scalable GPU Virtualization with Dynamic Sharing of Graphics Memory Space", IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, 5 January 2018 (2018-01-05) *
李伟男: "应用差异化更新技术实现GPU虚拟化场景性能优化", 中国优秀硕士学位论文全文数据库, 15 January 2020 (2020-01-15) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024098594A1 (en) * 2022-11-07 2024-05-16 海光信息技术股份有限公司 Code protection system and method, virtual system architecture, chip and electronic device

Also Published As

Publication number Publication date
CN115080183B (en) 2024-12-06

Similar Documents

Publication Publication Date Title
JP5706036B2 (en) Compound virtual graphics device
US20180121366A1 (en) Read/write request processing method and apparatus
US8239610B2 (en) Asynchronous page faults for virtual machines
US20240330199A1 (en) Secure memory access in a virtualized computing environment
US10078603B2 (en) MSI events using dynamic memory monitoring
US11157302B2 (en) Idle processor management in virtualized systems via paravirtualization
CN103064796B (en) virtual machine memory sharing method and computer system
US20140229647A1 (en) Direct mapping of msi-x registers using paravirtualized memory monitoring
TWI783034B (en) System and method for implementing drive
US9639393B2 (en) Virtual processor state management based on time values
US10521259B2 (en) Device and method for monitoring resources in full virtualization system
US9841985B2 (en) Storage block deallocation in virtual environments
US9898307B2 (en) Starting application processors of a virtual machine
US9606825B2 (en) Memory monitor emulation for virtual machines
CN103383650A (en) Management method and system thereof
KR20110095051A (en) Data processing method and driver in virtual environment
CN114461290A (en) Data processing method, example and system
CN115080183A (en) VGPU acceleration method, equipment and storage medium
CN105556461A (en) Techniques for pre-OS image rewriting to provide cross-architecture support, security introspection, and performance optimization
CN108196945A (en) A kind of communication method between cores, device and virtual equipment
US9684529B2 (en) Firmware and metadata migration across hypervisors based on supported capabilities
CN105335228A (en) Memory change processing method and operating systems
US10671425B2 (en) Lazy timer programming for virtual machines
RU2780973C2 (en) Response with processor function identifier for virtualization
CN114741194B (en) I/O request processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant