[go: up one dir, main page]

CN108897601A - A kind of FPGA application method, system and relevant apparatus based on virtualization - Google Patents

A kind of FPGA application method, system and relevant apparatus based on virtualization Download PDF

Info

Publication number
CN108897601A
CN108897601A CN201810697707.0A CN201810697707A CN108897601A CN 108897601 A CN108897601 A CN 108897601A CN 201810697707 A CN201810697707 A CN 201810697707A CN 108897601 A CN108897601 A CN 108897601A
Authority
CN
China
Prior art keywords
vfpga
fpga
container
allocated
pool
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.)
Pending
Application number
CN201810697707.0A
Other languages
Chinese (zh)
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201810697707.0A priority Critical patent/CN108897601A/en
Publication of CN108897601A publication Critical patent/CN108897601A/en
Pending legal-status Critical Current

Links

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/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • 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/45554Instruction set architectures of guest OS and hypervisor or native processor differ, e.g. Bochs or VirtualPC on PowerPC MacOS

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Design And Manufacture Of Integrated Circuits (AREA)

Abstract

本申请公开了一种基于虚拟化的FPGA使用方法,利用SR‑IOV技术将单个物理的FPGA虚拟为多个VFPGA,并为每个创建好的容器分配一个VFPGA,在借助挂载工具将每个已分配的VFPGA挂载至对应的容器后,每个容器即可通过挂载于自身的VFPGA进行后续操作,区别于传统每个容器需要占用一整个物理FPGA的方式,本申请可借由SR‑IOV的硬件虚拟化技术实现多个容器对应一个物理FPGA,在减少FGPA使用数量的同时还能够提升FPGA的性能使用率。本申请还同时公开了一种基于虚拟化的FPGA使用系统、FPGA及计算机可读存储介质,具有上述有益效果。

This application discloses a method for using FPGA based on virtualization, using SR‑IOV technology to virtualize a single physical FPGA into multiple VFPGAs, and assigning a VFPGA to each created container, and then attaching each After the allocated VFPGA is mounted to the corresponding container, each container can carry out subsequent operations by mounting its own VFPGA, which is different from the traditional way that each container needs to occupy an entire physical FPGA. This application can use SR‑ IOV's hardware virtualization technology realizes that multiple containers correspond to a physical FPGA, which can improve the performance utilization rate of FPGA while reducing the number of FPGAs used. The present application also discloses a virtualization-based FPGA application system, FPGA and computer-readable storage medium, which have the above-mentioned beneficial effects.

Description

一种基于虚拟化的FPGA使用方法、系统及相关装置A virtualization-based FPGA usage method, system and related devices

技术领域technical field

本申请涉及容器化技术领域,特别涉及一种基于虚拟化的FPGA使用方法、系统、FPGA及计算机可读存储介质。The present application relates to the technical field of containerization, and in particular to a virtualization-based FPGA usage method, system, FPGA, and computer-readable storage medium.

背景技术Background technique

随着人工智能的兴起,对数据运算量和运算速度提出了更高的要求,这也导致了FPGA(Field-Programmable Gate Array,现场可编程门阵列)在加速运算领域扮演着越来越重要的角色,很多应用和服务借助FPGA提供的支持可以显著提升运算速度和效率。With the rise of artificial intelligence, higher requirements are put forward for the amount of data calculation and calculation speed, which also leads to FPGA (Field-Programmable Gate Array, Field Programmable Gate Array) playing an increasingly important role in the field of accelerated computing. Many applications and services can significantly improve computing speed and efficiency with the support provided by FPGA.

Docker作为一个开源的应用容器引擎,可以让开发者打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何运行Linux(一种流行的操作系统)的机器上,相比于传统方式,由于采用基于Docker的容器化技术无需依赖外界环境,拥有更高的安全性和更低的系统软件耦合性。Docker, as an open source application container engine, allows developers to package their applications and dependencies into a portable container, and then publish it to any machine running Linux (a popular operating system), compared to traditional In this way, because the Docker-based containerization technology does not need to rely on the external environment, it has higher security and lower system software coupling.

在PAAS平台(Platform-as-a-Service,平台即服务,即把服务器平台作为一种服务提供的商业模式)中,现有技术采用基于PassThrough的方式建立每个FPGA与容器间的连接,但在这种实现方式下每个容器都需要通过PassThrough与一个单独的FPGA建立连接,以实现后续操作,但实际情况下每个单一的容器都无法完全利用每个FPGA的完整性能,性价比(FPGA已使用性能与实现成本间的比例)较低。In the PAAS platform (Platform-as-a-Service, platform as a service, that is, a business model in which the server platform is provided as a service), the existing technology adopts a PassThrough-based method to establish the connection between each FPGA and the container, but In this implementation, each container needs to establish a connection with a separate FPGA through PassThrough to achieve subsequent operations, but in reality, each single container cannot fully utilize the full performance of each FPGA, cost-effective (FPGA has been The ratio between performance and implementation cost) is low.

因此,如何克服现有FPGA与容器间使用机制中存在的各项技术缺陷,提供一种实现成本更低、每个FPGA性能利用率更高的FPGA与容器间使用机制是本领域技术人员亟待解决的问题。Therefore, it is urgent for those skilled in the art to solve various technical defects in the existing mechanism for using between FPGA and container, and to provide a mechanism for using between FPGA and container with lower implementation cost and higher performance utilization of each FPGA. The problem.

发明内容Contents of the invention

本申请的目的是提供一种基于虚拟化的FPGA使用方法,利用SR-IOV技术将单个物理的FPGA虚拟为多个VFPGA,并为每个创建好的容器分配一个VFPGA,在借助挂载工具将每个已分配的VFPGA挂载至对应的容器后,每个容器即可通过挂载于自身的VFPGA进行后续操作,区别于传统每个容器需要占用一整个物理FPGA的方式,本申请可借由SR-IOV的硬件虚拟化技术实现多个容器对应一个物理FPGA,在减少FGPA使用数量的同时还能够提升FPGA的性能使用率。The purpose of this application is to provide a virtualization-based FPGA usage method, using SR-IOV technology to virtualize a single physical FPGA into multiple VFPGAs, and assign a VFPGA to each created container, and use the mounting tool to After each allocated VFPGA is mounted to the corresponding container, each container can carry out subsequent operations by mounting its own VFPGA, which is different from the traditional way that each container needs to occupy an entire physical FPGA. This application can use The hardware virtualization technology of SR-IOV realizes that multiple containers correspond to a physical FPGA, which can improve the performance utilization rate of FPGA while reducing the number of FPGAs used.

本申请的另一目的在于提供了一种基于虚拟化的FPGA使用系统、FPGA及计算机可读存储介质。Another object of the present application is to provide a virtualization-based FPGA application system, FPGA and computer-readable storage medium.

为实现上述目的,本申请提供一种基于虚拟化的FPGA使用方法,包括:In order to achieve the above object, the application provides a virtualization-based FPGA usage method, including:

利用SR-IOV技术将单个FPGA虚拟为预设数量的VFPGA;Use SR-IOV technology to virtualize a single FPGA into a preset number of VFPGAs;

为每个创建好的容器分别分配一个所述VFPGA,并将每个已被分配的VFPGA挂载至对应的容器上,以使每个所述容器通过挂载于自身的VFPGA执行后续操作。A VFPGA is allocated to each created container, and each allocated VFPGA is mounted to a corresponding container, so that each container performs subsequent operations through the VFPGA mounted on itself.

可选的,在为每个创建好的容器分别分配一个所述VFPGA之前,还包括:Optionally, before assigning a VFPGA to each created container, further include:

为每个所述VFPGA进行命名,得到各VFPGA ID;Name each VFPGA to obtain each VFPGA ID;

统计各所述VFPGA ID,生成包含各所述VFPGA ID的VFGPA待分配池;Counting each of the VFPGA IDs, generating a VFGPA pool to be allocated that includes each of the VFPGA IDs;

对应的,为每个创建好的容器分别分配一个所述VFPGA具体包括;Correspondingly, assigning one VFPGA to each created container specifically includes;

为每个创建好的容器分别从所述VFGPA待分配池中任选一个VFPGA ID;Select a VFPGA ID from the VFGPA pool to be allocated for each created container;

将每个选取出的VFPGA ID对应的VFPGA分配给相应的容器。Allocate the VFPGA corresponding to each selected VFPGA ID to the corresponding container.

可选的,在将每个选取出的VFPGA ID对应的VFPGA分配给相应的容器之后,还包括:Optionally, after allocating the VFPGA corresponding to each selected VFPGA ID to the corresponding container, further include:

为已分配给一个所述容器的VFPGA附加已分配标记,并将附加有所述已分配标记的VFPGA的VFPGA ID从所述VFGPA待分配池中移除。Add an allocated mark to the VFPGA allocated to one of the containers, and remove the VFPGA ID of the VFPGA with the allocated mark from the VFGPA pool to be allocated.

可选的,该基于虚拟化的FPGA使用方法还包括:Optionally, the method for using FPGA based on virtualization also includes:

当目标容器不再需要挂载于自身的VFPGA时,解除目标VFPGA与所述目标容器间存在的挂载关系,并去除附加于所述目标VFPGA上的已分配标记,得到待分配VFPGA;其中,所述目标VFPGA为之前与所述目标容器间存在所述挂载关系的VFPGA;When the target container no longer needs to be mounted on its own VFPGA, the mounting relationship between the target VFPGA and the target container is released, and the assigned mark attached to the target VFPGA is removed to obtain the VFPGA to be allocated; wherein, The target VFPGA is the VFPGA that has the mount relationship with the target container before;

将所述待分配VFPGA的VFPGA ID补充进所述VFPGA待分配池。The VFPGA ID of the VFPGA to be allocated is supplemented into the VFPGA pool to be allocated.

为实现上述目的,本申请还提供了一种基于虚拟化的FPGA使用系统,该基于虚拟化的FPGA使用系统包括:In order to achieve the above object, the application also provides a virtualization-based FPGA usage system, which includes:

SR-IOV虚拟化单元,用于利用SR-IOV技术将单个FPGA虚拟为预设数量的VFPGA;The SR-IOV virtualization unit is used to virtualize a single FPGA into a preset number of VFPGAs using SR-IOV technology;

VFPGA分配及挂载单元,用于为每个创建好的容器分别分配一个所述VFPGA,并将每个已被分配的VFPGA挂载至对应的容器上,以使每个所述容器通过挂载于自身的VFPGA执行后续操作。The VFPGA allocation and mounting unit is used to allocate one VFPGA to each created container, and mount each allocated VFPGA to the corresponding container, so that each container can be mounted by Perform subsequent operations on its own VFPGA.

可选的,该基于虚拟化的FPGA使用系统还包括:Optionally, the virtualization-based FPGA usage system also includes:

VFPGA命名单元,用于为每个所述VFPGA进行命名,得到各VFPGA ID;The VFPGA naming unit is used to name each VFPGA to obtain each VFPGA ID;

VFGPA待分配池生成单元,用于统计各所述VFPGA ID,生成包含各所述VFPGA ID的VFGPA待分配池;The VFGPA pool to be allocated generating unit is used to count each of the VFPGA IDs, and generate a VFGPA pool to be allocated that includes each of the VFPGA IDs;

对应的,所述VFPGA分配及挂载单元具体包括;Correspondingly, the VFPGA allocation and mounting unit specifically includes;

任一选取子单元,用于为每个创建好的容器分别从所述VFGPA待分配池中任选一个VFPGA ID;Any selection subunit is used to select a VFPGA ID from the VFGPA pool to be allocated for each created container;

分配子单元,用于将每个选取出的VFPGA ID对应的VFPGA分配给相应的容器。The allocation subunit is configured to allocate the VFPGA corresponding to each selected VFPGA ID to the corresponding container.

可选的,该基于虚拟化的FPGA使用系统还包括:Optionally, the virtualization-based FPGA usage system also includes:

已分配标记附加及已分配VFPGA移出单元,用于为已分配给一个所述容器的VFPGA附加已分配标记,并将附加有所述已分配标记的VFPGA的VFPGA ID从所述VFGPA待分配池中移除。Assigned tag addition and assigned VFPGA removal unit, used to add assigned tags to the VFPGA assigned to one of the containers, and add the VFPGA ID of the assigned tag's VFPGA from the VFGPA pool to be allocated remove.

可选的,该基于虚拟化的FPGA使用系统还包括:Optionally, the virtualization-based FPGA usage system also includes:

挂载关系解除及已分配标记去除单元,用于当目标容器不再需要挂载于自身的VFPGA时,解除目标VFPGA与所述目标容器间存在的挂载关系,并去除附加于所述目标VFPGA上的已分配标记,得到待分配VFPGA;其中,所述目标VFPGA为之前与所述目标容器间存在所述挂载关系的VFPGA;The mounting relationship release and assigned mark removal unit is used to release the mounting relationship between the target VFPGA and the target container when the target container no longer needs to be mounted on its own VFPGA, and remove the attachment attached to the target VFPGA. The assigned mark on the above, to obtain the VFPGA to be allocated; wherein, the target VFPGA is the VFPGA that has the mount relationship with the target container before;

待分配VFPGA池补充单元,用于将所述待分配VFPGA的VFPGA ID补充进所述VFPGA待分配池。The VFPGA pool to be allocated supplementary unit is used to supplement the VFPGA ID of the VFPGA to be allocated into the VFPGA pool to be allocated.

为实现上述目的,本申请还提供了一种FPGA,该FPGA包括:In order to achieve the above object, the application also provides a kind of FPGA, and this FPGA comprises:

存储器,用于存储计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序时实现如上述内容所描述的FPGA使用方法的步骤。The processor is configured to implement the steps of the method for using the FPGA as described above when executing the computer program.

为实现上述目的,本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上述内容所描述的FPGA使用方法的步骤。To achieve the above object, the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for using FPGA as described above is realized A step of.

显然,本申请所提供的一种基于虚拟化的FPGA使用方法,该方法利用SR-IOV技术将单个物理的FPGA虚拟为多个VFPGA,并为每个创建好的容器分配一个VFPGA,在借助挂载工具将每个已分配的VFPGA挂载至对应的容器后,每个容器即可通过挂载于自身的VFPGA进行后续操作,区别于传统每个容器需要占用一整个物理FPGA的方式,本申请可借由SR-IOV的硬件虚拟化技术实现多个容器对应一个物理FPGA,在减少FGPA使用数量的同时还能够提升FPGA的性能使用率。本申请同时还提供了一种基于虚拟化的FPGA使用系统、FPGA及计算机可读存储介质,具有上述有益效果,在此不再赘述。Obviously, this application provides a virtualization-based FPGA usage method, which uses SR-IOV technology to virtualize a single physical FPGA into multiple VFPGAs, and assigns a VFPGA to each created container. After the loading tool mounts each allocated VFPGA to the corresponding container, each container can carry out subsequent operations by mounting its own VFPGA, which is different from the traditional way that each container needs to occupy an entire physical FPGA. This application The hardware virtualization technology of SR-IOV can be used to realize that multiple containers correspond to a physical FPGA, which can improve the performance utilization rate of FPGA while reducing the number of FGPA used. At the same time, the present application also provides a virtualization-based FPGA application system, FPGA and computer-readable storage medium, which have the above-mentioned beneficial effects and will not be repeated here.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present application, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.

图1为本申请实施例提供的一种基于虚拟化的FPGA使用方法的流程图;Fig. 1 is the flow chart of a kind of FPGA using method based on virtualization that the embodiment of the present application provides;

图2为本申请实施例提供的另一种基于虚拟化的FPGA使用方法的流程图;Fig. 2 is a flow chart of another virtualization-based FPGA usage method provided by the embodiment of the present application;

图3为一种现有FPGA与容器间连接关系的示意图;FIG. 3 is a schematic diagram of a connection relationship between an existing FPGA and a container;

图4为本申请实施例提供的一种FPGA与容器间连接关系的示意图;Fig. 4 is a schematic diagram of a connection relationship between an FPGA and a container provided by the embodiment of the present application;

图5为本申请实施例提供的一种基于虚拟化的FPGA使用系统的结构框图。FIG. 5 is a structural block diagram of a virtualization-based FPGA utilization system provided by an embodiment of the present application.

具体实施方式Detailed ways

本申请的核心是提供一种基于虚拟化的FPGA使用方法,该方法利用SR-IOV技术将单个物理的FPGA虚拟为多个VFPGA,并为每个创建好的容器分配一个VFPGA,在借助挂载工具将每个已分配的VFPGA挂载至对应的容器后,每个容器即可通过挂载于自身的VFPGA进行后续操作,区别于传统每个容器需要占用一整个物理FPGA的方式,本申请可借由SR-IOV的硬件虚拟化技术实现多个容器对应一个物理FPGA,在减少FGPA使用数量的同时还能够提升FPGA的性能使用率。本申请的另一核心是提供一种基于虚拟化的FPGA使用系统、FPGA及计算机可读存储介质,具有上述有益效果。The core of this application is to provide a virtualization-based FPGA usage method, which uses SR-IOV technology to virtualize a single physical FPGA into multiple VFPGAs, and assigns a VFPGA to each created container. After the tool mounts each allocated VFPGA to the corresponding container, each container can carry out subsequent operations by mounting its own VFPGA, which is different from the traditional way that each container needs to occupy an entire physical FPGA. This application can With the hardware virtualization technology of SR-IOV, multiple containers correspond to a physical FPGA, which can improve the performance utilization of FPGA while reducing the number of FPGAs used. Another core of the present application is to provide a virtualization-based FPGA application system, FPGA and computer-readable storage medium, which have the above-mentioned beneficial effects.

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

以下结合图1,图1为本申请实施例提供的一种基于虚拟化的FPGA使用方法的流程图,具体包括以下步骤:Below in conjunction with Fig. 1, Fig. 1 is a flow chart of a virtualization-based FPGA usage method provided by the embodiment of the present application, specifically comprising the following steps:

S101:利用SR-IOV技术将单个FPGA虚拟为预设数量的VFPGA;S101: Using SR-IOV technology to virtualize a single FPGA into a preset number of VFPGAs;

本步骤旨在利用硬件虚拟化技术将单个物理的FPGA虚拟成逻辑上的、可识别的多个VFPGA(Virtual-FPGA,虚拟FPGA),以将现有技术中FPGA与容器间一对一的对应关系改变为一对多的对应关系,从而大幅度提升FPGA的性能使用率和降低实现成本。This step aims to use hardware virtualization technology to virtualize a single physical FPGA into logically identifiable multiple VFPGAs (Virtual-FPGA, virtual FPGA), so as to make the one-to-one correspondence between FPGA and container in the prior art The relationship is changed to a one-to-many relationship, thereby greatly improving the performance utilization of the FPGA and reducing the implementation cost.

其中,SR-IOV技术是一种基于硬件的虚拟化解决方案,可提高性能和可伸缩性,SR-IOV标准允许在虚拟机之间高效共享PCIe(Peripheral Component InterconnectExpress,快速外设组件互连)设备,并且它是在硬件中实现的,可以获得能够与本机性能媲美的I/O性能。SR-IOV规范定义了新的标准,根据该标准,创建的新设备可允许将虚拟机直接连接到I/O设备。Among them, SR-IOV technology is a hardware-based virtualization solution that can improve performance and scalability, and the SR-IOV standard allows efficient sharing of PCIe (Peripheral Component InterconnectExpress, fast peripheral component interconnection) between virtual machines device, and it is implemented in hardware to achieve I/O performance comparable to native performance. The SR-IOV specification defines a new standard by which new devices are created that allow virtual machines to connect directly to I/O devices.

利用SR-IOV技术可以将实体数量为一个的FPGA虚拟为逻辑上的、可识别的多个VFPGA,虽然这些VFPGA实际上都是同一个FPGA,但每个不同的VFPGA实际上只是一个完整FPGA的一部分,就好像原先一个8核心处理器被一个任务独占,但实际上这个任务用不了这个8核心处理器的全部性能,很大一部分性能都处于未使用、浪费的状态,但没办法,这是基于上层协议固定的,而本申请在通过使用不同的上层协议,利用虚拟化技术将这个8核心处理器虚拟为8个虚拟处理器,当然这8个虚拟处理器中的每个虚拟处理器的性能都比不上原先的8核心处理器,一种性能分配方式为均分,即8个虚拟处理器都拥有原先8核心处理器总性能的1/8,进一步的,还可以通过有效的复用手段使得每个虚拟处理器拥有大于原先8核心处理器总性能的1/8的性能。Using SR-IOV technology, one FPGA can be virtualized into logically identifiable multiple VFPGAs. Although these VFPGAs are actually the same FPGA, each different VFPGA is actually just a part of a complete FPGA. Part of it is as if an 8-core processor was monopolized by a task, but in fact this task cannot use the full performance of the 8-core processor, and a large part of the performance is unused and wasted, but there is no way, this is It is fixed based on the upper-layer protocol, and the present application uses virtualization technology to virtualize the 8-core processor into 8 virtual processors by using different upper-layer protocols. Of course, each virtual processor in the 8 virtual processors The performance is not as good as that of the original 8-core processors. One way of performance distribution is equal sharing, that is, the 8 virtual processors all have 1/8 of the total performance of the original 8-core processors. Use means to make each virtual processor have a performance greater than 1/8 of the total performance of the original 8-core processor.

借由SR-IOV虚拟出来的VFPGA也会像原先的FPGA一样拥有自己的身份识别标识,因此可被操作系统正常识别到,就好像真的存在多个FPGA一样,但实际上无论对哪个VFPGA执行操作实际上也是由原先的FPGA真正执行。The VFPGA virtualized by SR-IOV will also have its own identification mark like the original FPGA, so it can be recognized by the operating system normally, as if there are multiple FPGAs, but in fact no matter which VFPGA is executed The operation is actually performed by the original FPGA.

S102:为每个创建好的容器分别分配一个VFPGA,并将每个已被分配的VFPGA挂载至对应的容器上,以使每个容器通过挂载于自身的VFPGA执行后续操作。S102: Allocating a VFPGA to each created container, and mounting each allocated VFPGA to a corresponding container, so that each container performs subsequent operations through the VFPGA mounted on itself.

在S101的基础上,本步骤旨在将借由SR-IOV技术虚拟出来的多个VFPGA分配给各个已经创建好的容器,即为每个创建好的容器分别分配一个VFPGA,在分配好后,还需将每个已被分配的VFPGA挂载至对应的容器上才能够使每个容器通过挂载于自身的VFPGA执行后续操作,即才能使每个容器对应的服务或应用享受到FPGA带来的运算加速效果。On the basis of S101, this step aims to assign multiple VFPGAs virtualized by SR-IOV technology to each created container, that is, assign a VFPGA to each created container, and after the allocation, It is also necessary to mount each assigned VFPGA to the corresponding container to enable each container to perform subsequent operations through the VFPGA mounted on itself, that is, to enable the services or applications corresponding to each container to enjoy the benefits brought by the FPGA. operation acceleration effect.

此处的容器是指利用对服务或应用采用容器化技术进行容器化处理后得到的服务或应用的一种表现形式,对容器化技术更具体解释可参见背景技术部分,在此不再赘述。The container here refers to a form of expression of the service or application obtained by using the containerization technology to containerize the service or application. For a more detailed explanation of the containerization technology, please refer to the background technology section, and will not repeat it here.

进一步的,具体如何为每个容器分配VFPGA,方式多种多样,在串行处理分配方式下,可以按照一定的顺序对多个同时处于待分配VFPGA的容器进行排序,已根据排序结果确定先为哪些容器分配VFPGA,更进一步的,还可以对同时虚拟出来的多个VFPFA也按照一定的顺序进行排序,以根据排序结果确定先将哪个VFPGA分配给容器,例如,可以按照一定的命名规则对各VFPGA进行命名,之后就可以对各VFPGA按照编号的大小进行排序等,此处并不做具体限定,本领域技术人员可在本步骤思想的指导下得到多种具体实现方式,只要能够实现为每个容器分配一个VFPGA的目的即可,可根据实际情况的不同,灵活选择最合适的分配方式。Furthermore, how to allocate VFPGA to each container has a variety of methods. In the serial processing allocation mode, multiple containers that are simultaneously in the VFPGA to be allocated can be sorted in a certain order, and the first is determined according to the sorting result. Which containers are assigned VFPGAs? Further, multiple VFPGAs virtualized at the same time can also be sorted in a certain order, so as to determine which VFPGA is allocated to the container first according to the sorting results. VFPGA is named, and then each VFPGA can be sorted according to the size of the number, etc., and there is no specific limitation here. Those skilled in the art can obtain multiple specific implementation methods under the guidance of this step thought, as long as it can be realized for each The purpose of allocating one VFPGA per container is sufficient, and the most appropriate allocation method can be flexibly selected according to the actual situation.

在挂载步骤中,可以借助通用的挂载工具实现将一个VFPGA挂载至一个容器上的目的,实际上就是建立两者间的一个绑定关系,以使该容器对应的应的服务或应用可通过与自身绑定的VFPGA最终实现运算加速的目的。In the mounting step, the purpose of mounting a VFPGA to a container can be achieved with the help of a general mounting tool. In fact, it is to establish a binding relationship between the two, so that the corresponding service or application of the container The purpose of computing acceleration can be finally realized through the VFPGA bound to itself.

更进一步的,根据操作系统运行状况的不同、实时功能的变动,有些应用或服务可能不再使用,此时还可以解除其与已挂载在自身的VFPGA间的挂载关系,即释放这个VFPGA,使得这个释放的VFPGA可以重新被分配和挂载至另一个需要的服务或应用的容器上。Furthermore, depending on the operating status of the operating system and changes in real-time functions, some applications or services may no longer be used. At this time, the mounting relationship with the VFPGA that has been mounted on itself can be released, that is, the VFPGA can be released. , so that the released VFPGA can be redistributed and mounted to another required service or application container.

具体实现过程中,为了区别各VFPGA的不同状态(已被分配、未被分配)还可以通过附加不同状态下对应的识别标识来进行区分。In the specific implementation process, in order to distinguish the different states of each VFPGA (allocated, not allocated), it can also be distinguished by adding corresponding identification marks in different states.

基于上述技术方案,本申请实施例提供的一种基于虚拟化的FPGA使用方法,利用SR-IOV技术将单个物理的FPGA虚拟为多个VFPGA,并为每个创建好的容器分配一个VFPGA,在借助挂载工具将每个已分配的VFPGA挂载至对应的容器后,每个容器即可通过挂载于自身的VFPGA进行后续操作,区别于传统每个容器需要占用一整个物理FPGA的方式,本申请可借由SR-IOV的硬件虚拟化技术实现多个容器对应一个物理FPGA,在减少FGPA使用数量的同时还能够提升FPGA的性能使用率。Based on the above technical solution, the embodiment of the present application provides a virtualization-based FPGA usage method, using SR-IOV technology to virtualize a single physical FPGA into multiple VFPGAs, and assigning a VFPGA to each created container. After mounting each allocated VFPGA to the corresponding container with the help of the mounting tool, each container can carry out subsequent operations by mounting its own VFPGA, which is different from the traditional way that each container needs to occupy an entire physical FPGA. This application can use the hardware virtualization technology of SR-IOV to realize that multiple containers correspond to one physical FPGA, which can improve the performance utilization rate of FPGA while reducing the number of FGPA used.

以下结合图2,图2为本申请实施例提供的另一种基于虚拟化的FPGA使用方法的流程图,本实施例在实施例一的基础上,通过为各VFPGA进行命名以及生成包含各VFPGA ID的VFGPA待分配池,每次从该VFGPA待分配池任选一个VFPGA分配给需要的容器,并通过为已分配的VFPGA附加已分配标记来区别不同状态的VFPGA,进而将附加有该标记的VFPGA对应的VFPGA ID从待分配池中移除,使得实际效果更佳,具体实施步骤如下:Below in conjunction with Fig. 2, Fig. 2 is a flow chart of another FPGA usage method based on virtualization provided by the embodiment of the present application. On the basis of Embodiment 1, this embodiment, by naming each VFPGA and generating ID’s VFGPA pool to be allocated, select a VFPGA from the VFGPA pool to be allocated each time to the required container, and distinguish VFPGAs in different states by attaching allocated marks to the allocated VFPGAs, and then assign the marked VFPGAs The VFPGA ID corresponding to the VFPGA is removed from the pool to be allocated to make the actual effect better. The specific implementation steps are as follows:

S201:利用SR-IOV技术将单个FPGA虚拟为预设数量的VFPGA;S201: Using SR-IOV technology to virtualize a single FPGA into a preset number of VFPGAs;

S202:为每个VFPGA进行命名,得到各VFPGA ID;S202: Naming each VFPGA to obtain each VFPGA ID;

S203:统计各VFPGA ID,生成包含各VFPGA ID的VFGPA待分配池;S203: Count each VFPGA ID, and generate a VFGPA pool to be allocated including each VFPGA ID;

S204:为每个创建好的容器分别从VFGPA待分配池中任选一个VFPGA ID;S204: Select a VFPGA ID from the VFGPA pool to be allocated for each created container;

S205:将每个选取出的VFPGA ID对应的VFPGA分配给相应的容器;S205: Allocate the VFPGA corresponding to each selected VFPGA ID to the corresponding container;

S206:为已分配给一个容器的VFPGA附加已分配标记,并将附加有已分配标记的VFPGA的VFPGA ID从VFGPA待分配池中移除;S206: Add an allocated mark to the VFPGA allocated to a container, and remove the VFPGA ID of the VFPGA with the allocated mark from the VFGPA pool to be allocated;

S207:将每个已被分配的VFPGA挂载至对应的容器上,以使每个容器通过挂载于自身的VFPGA执行后续操作。S207: Mount each allocated VFPGA on a corresponding container, so that each container performs subsequent operations through the VFPGA mounted on itself.

进一步的,当目标容器不再需要挂载于自身的VFPGA时,解除目标VFPGA与目标容器间存在的挂载关系,并去除附加于目标VFPGA上的已分配标记,得到待分配VFPGA;Further, when the target container no longer needs to be mounted on its own VFPGA, release the mounting relationship between the target VFPGA and the target container, and remove the assigned mark attached to the target VFPGA to obtain the VFPGA to be allocated;

将待分配VFPGA的VFPGA ID补充进VFPGA待分配池,以重新为该待分配VFPGA分配给并挂载至需要的容器。其中,目标VFPGA为之前与目标容器间存在挂载关系的VFPGA。Add the VFPGA ID of the VFPGA to be allocated to the VFPGA pool to be allocated, so as to re-allocate and mount the VFPGA to the required container. Among them, the target VFPGA is the VFPGA that has a mounting relationship with the target container before.

实施例三Embodiment three

在基于上述实施例的基础上,本实施例结合实际场景,分别结合图3所示的现有技术和图4所示的本申请对本申请发明点进行阐述:On the basis of the above-mentioned embodiments, this embodiment combines the actual scene and respectively combines the prior art shown in FIG. 3 and the present application shown in FIG. 4 to illustrate the invention points of the present application:

如图3所示,现有技术中的每个容器需要通过MMU(Memory Management Unit,内存管理单元)与对应FPGA建立连接,即一个容器对应一个实体FPGA的方式;As shown in Figure 3, each container in the prior art needs to establish a connection with the corresponding FPGA through an MMU (Memory Management Unit, memory management unit), that is, a container corresponds to a physical FPGA;

如图4所示,仅使用一个物理FPGA设备,利用SR-IOV技术虚拟化成多个VFPGA设备,并配合相应的挂载工具可以动态的建立和取消各VFPGA和容器之间的挂载关系,能够显著的改善FPGA在云环境中的使用效率,极大的减少了使用FPGA的成本。As shown in Figure 4, only one physical FPGA device is used, and multiple VFPGA devices are virtualized by using SR-IOV technology, and the corresponding mounting tools can be used to dynamically establish and cancel the mounting relationship between each VFPGA and the container. Significantly improve the use efficiency of FPGA in cloud environment and greatly reduce the cost of using FPGA.

具体实施方式如下:The specific implementation is as follows:

首先对FPGA的驱动进行改写,使得FPGA支持SRIOV技术:First, rewrite the FPGA driver so that the FPGA supports SRIOV technology:

(1)PF驱动:PF驱动可以直接访问PF的所有的资源,并负责管理和配置所有VF;(1) PF driver: PF driver can directly access all resources of PF, and is responsible for managing and configuring all VFs;

(2)VF驱动:像普通的PCIE驱动一样运行在客户机上,直接访问特定的VF设备完成数据的搬移,期间不需要VMM的参与;(2) VF driver: It runs on the client computer like a normal PCIE driver, and directly accesses a specific VF device to complete the data transfer without the participation of VMM;

(3)IOVM:IOVM为每个VF分配完整的虚拟配置空间,因此客户机能够像普通设备一样模仿和配置VF。(3) IOVM: IOVM allocates a complete virtual configuration space for each VF, so clients can emulate and configure VFs like ordinary devices.

其中,PF就是物理网卡所支持的一项PCI(Peripheral Component Interconnect,外设部件互连标准,它是目前个人电脑中使用最为广泛的接口,几乎所有的主板产品上都带有这种插槽)功能,PF可以扩展出若干个VF;Among them, PF is a PCI (Peripheral Component Interconnect, peripheral component interconnection standard, which is currently the most widely used interface in personal computers, and almost all motherboard products have this slot) supported by the physical network card. Function, PF can expand several VFs;

VF是支持SR-IOV的物理网卡所虚拟出的一个“网卡”或者说虚出来的一个实例,它会以一个独立网卡的形式呈现出来,每一个VF有它自己独享的PCI配置区域,并且可能与其他VF共享着同一个物理资源(公用同一个物理网口);VF is a "network card" virtualized by a physical network card that supports SR-IOV or a virtual instance. It will be presented as an independent network card. Each VF has its own exclusive PCI configuration area, and It may share the same physical resource (share the same physical network port) with other VFs;

PF驱动是工作于虚拟化平台父区域的,并在VF之前最先加载;The PF driver works in the parent area of the virtualization platform and is loaded first before the VF;

VF驱动是工作于虚拟化平台子区域的;The VF driver works in the virtualization platform sub-area;

需要注意的是,VF及PF之间是隔离的,任何经由VF驱动或所执行的结果都不会影响到其他的VF或PF。It should be noted that VF and PF are isolated, and any results driven or executed by VF will not affect other VF or PF.

接下来通过上层接口创建N个VFPGA,并将这些VFPGA通过挂载工具分别挂载至不同的已创建容器中,此时会在容器内的相应目录下看到VFPGA的设备描述符,通过该描述符我们就可以像操作物理FPGA那样操作VFPGA,所有操作VFPGA的操作都会经过驱动从容操作真正的物理FPGA:Next, create N VFPGAs through the upper interface, and mount these VFPGAs to different created containers through the mounting tool. At this time, you will see the device descriptor of the VFPGA in the corresponding directory in the container. Through this description We can operate VFPGA like a physical FPGA, and all operations on VFPGA will be driven to operate the real physical FPGA calmly:

(1)创建需要使用虚拟FPGA的容器,容器内包含相应的应用或服务;(1) Create a container that needs to use a virtual FPGA, and the container contains corresponding applications or services;

(2)使用挂载工具动态的挂载VFPGA到容器内,可以在容器内看到相应的设备描述符;(2) Use the mounting tool to dynamically mount VFPGA into the container, and you can see the corresponding device descriptor in the container;

(3)当该容器不再需要使用VFPGA进行异构加速时,还可通过该挂载工具随时解绑,动态的把该VFPGA分配给其他容器使用。(3) When the container no longer needs to use VFPGA for heterogeneous acceleration, it can also be unbound at any time through the mounting tool, and the VFPGA can be dynamically allocated to other containers for use.

本实施例使用从实体FPGA借由SR-IOV基础虚拟出来的VFPGA做为容器的外接设备,能够充分利用FPGA设备的性能,提高物理FPGA的性能使用率,同时可以有效加速容器内的应用或服务,提高PAAS平台对异构计算的支持。This embodiment uses the VFPGA virtualized from the physical FPGA through the SR-IOV foundation as the external device of the container, which can make full use of the performance of the FPGA device, improve the performance utilization rate of the physical FPGA, and effectively accelerate the application or service in the container , to improve the PAAS platform's support for heterogeneous computing.

因为情况复杂,无法一一列举进行阐述,本领域技术人员应能意识到根据本申请提供的基本方法原理结合实际情况可以存在很多的例子,在不付出足够的创造性劳动下,应均在本申请的保护范围内。Because of the complexity of the situation, it is impossible to list and explain them one by one. Those skilled in the art should be able to realize that there may be many examples based on the basic method principles provided by this application combined with actual situations. within the scope of protection.

下面请参见图5,图5为本申请实施例提供的一种基于虚拟化的FPGA使用系统的结构框图,该基于虚拟化的FPGA使用系统可以包括:Please refer to FIG. 5 below. FIG. 5 is a structural block diagram of a virtualization-based FPGA usage system provided by an embodiment of the present application. The virtualization-based FPGA usage system may include:

SR-IOV虚拟化单元100,用于利用SR-IOV技术将单个FPGA虚拟为预设数量的VFPGA;SR-IOV virtualization unit 100, for utilizing SR-IOV technology to virtualize a single FPGA into a preset number of VFPGAs;

VFPGA分配及挂载单元200,用于为每个创建好的容器分别分配一个所述VFPGA,并将每个已被分配的VFPGA挂载至对应的容器上,以使每个所述容器通过挂载于自身的VFPGA执行后续操作。The VFPGA allocation and mounting unit 200 is configured to allocate one VFPGA to each created container, and mount each allocated VFPGA to the corresponding container, so that each container can The subsequent operations are carried out on the VFPGA itself.

进一步的,该基于虚拟化的FPGA使用系统还可以包括:Further, the virtualization-based FPGA usage system may also include:

VFPGA命名单元,用于为每个所述VFPGA进行命名,得到各VFPGA ID;The VFPGA naming unit is used to name each VFPGA to obtain each VFPGA ID;

VFGPA待分配池生成单元,用于统计各所述VFPGA ID,生成包含各所述VFPGA ID的VFGPA待分配池;The VFGPA pool to be allocated generating unit is used to count each of the VFPGA IDs, and generate a VFGPA pool to be allocated that includes each of the VFPGA IDs;

对应的,所述VFPGA分配及挂载单元200具体包括;Correspondingly, the VFPGA allocation and mounting unit 200 specifically includes;

任一选取子单元,用于为每个创建好的容器分别从所述VFGPA待分配池中任选一个VFPGA ID;Any selection subunit is used to select a VFPGA ID from the VFGPA pool to be allocated for each created container;

分配子单元,用于将每个选取出的VFPGA ID对应的VFPGA分配给相应的容器。The allocation subunit is configured to allocate the VFPGA corresponding to each selected VFPGA ID to the corresponding container.

进一步的,该基于虚拟化的FPGA使用系统还可以包括:Further, the virtualization-based FPGA usage system may also include:

已分配标记附加及已分配VFPGA移出单元,用于为已分配给一个所述容器的VFPGA附加已分配标记,并将附加有所述已分配标记的VFPGA的VFPGA ID从所述VFGPA待分配池中移除。Assigned tag addition and assigned VFPGA removal unit, used to add assigned tags to the VFPGA assigned to one of the containers, and add the VFPGA ID of the assigned tag's VFPGA from the VFGPA pool to be allocated remove.

进一步的,该基于虚拟化的FPGA使用系统还可以包括:Further, the virtualization-based FPGA usage system may also include:

挂载关系解除及已分配标记去除单元,用于当目标容器不再需要挂载于自身的VFPGA时,解除目标VFPGA与所述目标容器间存在的挂载关系,并去除附加于所述目标VFPGA上的已分配标记,得到待分配VFPGA;其中,所述目标VFPGA为之前与所述目标容器间存在所述挂载关系的VFPGA;The mounting relationship release and assigned mark removal unit is used to release the mounting relationship between the target VFPGA and the target container when the target container no longer needs to be mounted on its own VFPGA, and remove the attachment attached to the target VFPGA. The assigned mark on the above, to obtain the VFPGA to be allocated; wherein, the target VFPGA is the VFPGA that has the mount relationship with the target container before;

待分配VFPGA池补充单元,用于将所述待分配VFPGA的VFPGA ID补充进所述VFPGA待分配池。The VFPGA pool to be allocated supplementary unit is used to supplement the VFPGA ID of the VFPGA to be allocated into the VFPGA pool to be allocated.

基于上述实施例,本申请还提供了一种FPGA,该FPGA可以包括存储器和处理器,其中,该存储器中存有计算机程序,该处理器调用该存储器中的计算机程序时,可以实现上述实施例所提供的步骤。当然,该FPGA还可以包括各种必要的网络接口、电源以及其它零部件等。Based on the above embodiments, the present application also provides an FPGA, which may include a memory and a processor, wherein a computer program is stored in the memory, and when the processor invokes the computer program in the memory, the above embodiments can be realized provided steps. Of course, the FPGA may also include various necessary network interfaces, power supplies and other components.

本申请还提供了一种计算机可读存储介质,其上存有计算机程序,该计算机程序被执行终端或处理器执行时可以实现上述实施例所提供的步骤。该存储介质可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random AccessMemory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by an execution terminal or a processor, the steps provided in the above-mentioned embodiments can be realized. The storage medium may include various media capable of storing program codes such as a U disk, a removable hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk.

说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in the description is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for the related part, please refer to the description of the method part.

专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Professionals can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the possible For interchangeability, in the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.

本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。In this paper, specific examples are used to illustrate the principles and implementation methods of the present application, and the descriptions of the above embodiments are only used to help understand the methods and core ideas of the present application. For those of ordinary skill in the art, without departing from the principle of the application, some improvements and modifications can be made to the application, and these improvements and modifications also fall within the protection scope of the claims of the application.

还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其它变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其它要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that in this specification, relative terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations There is no such actual relationship or order between the operations. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

Claims (10)

1.一种基于虚拟化的FPGA使用方法,其特征在于,包括:1. A method for using FPGA based on virtualization, characterized in that, comprising: 利用SR-IOV技术将单个FPGA虚拟为预设数量的VFPGA;Use SR-IOV technology to virtualize a single FPGA into a preset number of VFPGAs; 为每个创建好的容器分别分配一个所述VFPGA,并将每个已被分配的VFPGA挂载至对应的容器上,以使每个所述容器通过挂载于自身的VFPGA执行后续操作。A VFPGA is allocated to each created container, and each allocated VFPGA is mounted to a corresponding container, so that each container performs subsequent operations through the VFPGA mounted on itself. 2.根据权利要求1所述的FPGA使用方法,其特征在于,在为每个创建好的容器分别分配一个所述VFPGA之前,还包括:2. FPGA using method according to claim 1, is characterized in that, before allocating a described VFPGA respectively for each created container, also comprises: 为每个所述VFPGA进行命名,得到各VFPGA ID;Name each VFPGA to obtain each VFPGA ID; 统计各所述VFPGA ID,生成包含各所述VFPGA ID的VFGPA待分配池;Counting each of the VFPGA IDs, generating a VFGPA pool to be allocated that includes each of the VFPGA IDs; 对应的,为每个创建好的容器分别分配一个所述VFPGA具体包括;Correspondingly, assigning one VFPGA to each created container specifically includes; 为每个创建好的容器分别从所述VFGPA待分配池中任选一个VFPGA ID;Select a VFPGA ID from the VFGPA pool to be allocated for each created container; 将每个选取出的VFPGA ID对应的VFPGA分配给相应的容器。Allocate the VFPGA corresponding to each selected VFPGA ID to the corresponding container. 3.根据权利要求2所述的FPGA使用方法,其特征在于,在将每个选取出的VFPGA ID对应的VFPGA分配给相应的容器之后,还包括:3. FPGA using method according to claim 2, is characterized in that, after the VFPGA corresponding to the VFPGA ID that each picks out is assigned to corresponding container, also comprise: 为已分配给一个所述容器的VFPGA附加已分配标记,并将附加有所述已分配标记的VFPGA的VFPGA ID从所述VFGPA待分配池中移除。Add an allocated mark to the VFPGA that has been allocated to one of the containers, and remove the VFPGA ID of the VFPGA with the allocated mark from the VFGPA pool to be allocated. 4.根据权利要求3所述的FPGA使用方法,其特征在于,还包括:4. FPGA using method according to claim 3, is characterized in that, also comprises: 当目标容器不再需要挂载于自身的VFPGA时,解除目标VFPGA与所述目标容器间存在的挂载关系,并去除附加于所述目标VFPGA上的已分配标记,得到待分配VFPGA;其中,所述目标VFPGA为之前与所述目标容器间存在所述挂载关系的VFPGA;When the target container no longer needs to be mounted on its own VFPGA, the mounting relationship between the target VFPGA and the target container is released, and the assigned mark attached to the target VFPGA is removed to obtain the VFPGA to be allocated; wherein, The target VFPGA is the VFPGA that has the mount relationship with the target container before; 将所述待分配VFPGA的VFPGA ID补充进所述VFPGA待分配池。The VFPGA ID of the VFPGA to be allocated is supplemented into the VFPGA pool to be allocated. 5.一种基于虚拟化的FPGA使用系统,其特征在于,包括:5. A virtualization-based FPGA application system, characterized in that, comprising: SR-IOV虚拟化单元,用于利用SR-IOV技术将单个FPGA虚拟为预设数量的VFPGA;The SR-IOV virtualization unit is used to virtualize a single FPGA into a preset number of VFPGAs using SR-IOV technology; VFPGA分配及挂载单元,用于为每个创建好的容器分别分配一个所述VFPGA,并将每个已被分配的VFPGA挂载至对应的容器上,以使每个所述容器通过挂载于自身的VFPGA执行后续操作。The VFPGA allocation and mounting unit is used to allocate one VFPGA to each created container, and mount each allocated VFPGA to the corresponding container, so that each container can be mounted by Perform subsequent operations on its own VFPGA. 6.根据权利要求5所述的FPGA使用系统,其特征在于,还包括:6. FPGA using system according to claim 5, is characterized in that, also comprises: VFPGA命名单元,用于为每个所述VFPGA进行命名,得到各VFPGA ID;The VFPGA naming unit is used to name each VFPGA to obtain each VFPGA ID; VFGPA待分配池生成单元,用于统计各所述VFPGA ID,生成包含各所述VFPGA ID的VFGPA待分配池;The VFGPA pool to be allocated generating unit is used to count each of the VFPGA IDs, and generate a VFGPA pool to be allocated that includes each of the VFPGA IDs; 对应的,所述VFPGA分配及挂载单元具体包括;Correspondingly, the VFPGA allocation and mounting unit specifically includes; 任一选取子单元,用于为每个创建好的容器分别从所述VFGPA待分配池中任选一个VFPGA ID;Any selection subunit is used to select a VFPGA ID from the VFGPA pool to be allocated for each created container; 分配子单元,用于将每个选取出的VFPGA ID对应的VFPGA分配给相应的容器。The allocation subunit is configured to allocate the VFPGA corresponding to each selected VFPGA ID to the corresponding container. 7.根据权利要求6所述的FPGA使用系统,其特征在于,还包括:7. FPGA using system according to claim 6, is characterized in that, also comprises: 已分配标记附加及已分配VFPGA移出单元,用于为已分配给一个所述容器的VFPGA附加已分配标记,并将附加有所述已分配标记的VFPGA的VFPGA ID从所述VFGPA待分配池中移除。Assigned tag addition and assigned VFPGA removal unit, used to add assigned tag to the VFPGA assigned to a container, and add the VFPGA ID of the assigned tag's VFPGA from the VFGPA pool to be allocated remove. 8.根据权利要求7所述的FPGA使用系统,其特征在于,还包括:8. FPGA using system according to claim 7, is characterized in that, also comprises: 挂载关系解除及已分配标记去除单元,用于当目标容器不再需要挂载于自身的VFPGA时,解除目标VFPGA与所述目标容器间存在的挂载关系,并去除附加于所述目标VFPGA上的已分配标记,得到待分配VFPGA;其中,所述目标VFPGA为之前与所述目标容器间存在所述挂载关系的VFPGA;The mounting relationship release and assigned mark removal unit is used to release the mounting relationship between the target VFPGA and the target container when the target container no longer needs to be mounted on its own VFPGA, and remove the attachment attached to the target VFPGA. The assigned mark on the above, to obtain the VFPGA to be allocated; wherein, the target VFPGA is the VFPGA that has the mount relationship with the target container before; 待分配VFPGA池补充单元,用于将所述待分配VFPGA的VFPGA ID补充进所述VFPGA待分配池。The VFPGA pool to be allocated supplementary unit is used to supplement the VFPGA ID of the VFPGA to be allocated into the VFPGA pool to be allocated. 9.一种FPGA,其特征在于,包括:9. A kind of FPGA, is characterized in that, comprises: 存储器,用于存储计算机程序;memory for storing computer programs; 处理器,用于执行所述计算机程序时实现如权利要求1至4任一项所述的FPGA使用方法的步骤。A processor, configured to implement the steps of the method for using FPGA according to any one of claims 1 to 4 when executing the computer program. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至4任一项所述的FPGA使用方法的步骤。10. A computer-readable storage medium, characterized in that, a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the FPGA according to any one of claims 1 to 4 is realized Steps to use the method.
CN201810697707.0A 2018-06-29 2018-06-29 A kind of FPGA application method, system and relevant apparatus based on virtualization Pending CN108897601A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810697707.0A CN108897601A (en) 2018-06-29 2018-06-29 A kind of FPGA application method, system and relevant apparatus based on virtualization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810697707.0A CN108897601A (en) 2018-06-29 2018-06-29 A kind of FPGA application method, system and relevant apparatus based on virtualization

Publications (1)

Publication Number Publication Date
CN108897601A true CN108897601A (en) 2018-11-27

Family

ID=64347129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810697707.0A Pending CN108897601A (en) 2018-06-29 2018-06-29 A kind of FPGA application method, system and relevant apparatus based on virtualization

Country Status (1)

Country Link
CN (1) CN108897601A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634720A (en) * 2018-12-13 2019-04-16 郑州云海信息技术有限公司 A kind of multi-dummy machine shares the method, system and device of FPGA board
CN109634627A (en) * 2019-01-23 2019-04-16 郑州云海信息技术有限公司 Method based on OpenStack platform management FPGA device
CN110597627A (en) * 2019-08-24 2019-12-20 中国电子科技集团公司第十五研究所 Database computing acceleration device and acceleration method based on virtual FPGA
CN111047505A (en) * 2019-12-20 2020-04-21 北京浪潮数据技术有限公司 GPU multiplexing method, device, equipment and readable storage medium
CN113326226A (en) * 2020-02-28 2021-08-31 安徽寒武纪信息科技有限公司 Virtualization method and device, board card and computer readable storage medium
CN113326092A (en) * 2020-02-28 2021-08-31 安徽寒武纪信息科技有限公司 Virtualization method, virtualization device, board card and computer-readable storage medium
CN113326091A (en) * 2020-02-28 2021-08-31 安徽寒武纪信息科技有限公司 Virtualization method, virtualization device, board card and computer-readable storage medium
CN113326109A (en) * 2020-02-28 2021-08-31 安徽寒武纪信息科技有限公司 Virtualization method, virtualization device, board card and computer-readable storage medium
WO2021170055A1 (en) * 2020-02-28 2021-09-02 安徽寒武纪信息科技有限公司 Virtualization method, device, board card and computer readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5511217A (en) * 1992-11-30 1996-04-23 Hitachi, Ltd. Computer system of virtual machines sharing a vector processor
US20140245295A1 (en) * 2013-02-26 2014-08-28 Red Hat Israel, Ltd. Providing Dynamic Topology Information in Virtualized Computing Environments
CN105242957A (en) * 2015-09-28 2016-01-13 广州云晫信息科技有限公司 Method and system for cloud computing system to allocate GPU resources to virtual machine
CN105630607A (en) * 2015-12-23 2016-06-01 联想(北京)有限公司 Resource pool management method, container creation method and electronic equipment
CN106569877A (en) * 2016-11-14 2017-04-19 中国石油化工股份有限公司 Method for sharing graphic workstation GPU by virtual machines in direct connection way
CN107632878A (en) * 2017-09-27 2018-01-26 山东渔翁信息技术股份有限公司 A kind of distribution method, system and the relevant apparatus of cipher card algorithm resource
US20180101486A1 (en) * 2016-10-06 2018-04-12 Vmware, Inc. Automatic System Service Resource Management for Virtualizing Low-Latency Workloads that are Input/Output Intensive
CN107924340A (en) * 2015-08-18 2018-04-17 日本电信电话株式会社 Resource configuration system, resource configuration method and resource configuration program

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5511217A (en) * 1992-11-30 1996-04-23 Hitachi, Ltd. Computer system of virtual machines sharing a vector processor
US20140245295A1 (en) * 2013-02-26 2014-08-28 Red Hat Israel, Ltd. Providing Dynamic Topology Information in Virtualized Computing Environments
CN107924340A (en) * 2015-08-18 2018-04-17 日本电信电话株式会社 Resource configuration system, resource configuration method and resource configuration program
CN105242957A (en) * 2015-09-28 2016-01-13 广州云晫信息科技有限公司 Method and system for cloud computing system to allocate GPU resources to virtual machine
CN105630607A (en) * 2015-12-23 2016-06-01 联想(北京)有限公司 Resource pool management method, container creation method and electronic equipment
US20180101486A1 (en) * 2016-10-06 2018-04-12 Vmware, Inc. Automatic System Service Resource Management for Virtualizing Low-Latency Workloads that are Input/Output Intensive
CN106569877A (en) * 2016-11-14 2017-04-19 中国石油化工股份有限公司 Method for sharing graphic workstation GPU by virtual machines in direct connection way
CN107632878A (en) * 2017-09-27 2018-01-26 山东渔翁信息技术股份有限公司 A kind of distribution method, system and the relevant apparatus of cipher card algorithm resource

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DUY VIET VU, OLIVER SANDER, TIMO SANDMANN, STEFFEN BAEHR, JAN HE: "Enabling Partial Reconfiguration for Coprocessors in Mixed Criticality Multicore Systems Using PCI Express Single-Root I/O Virtualization", 《IEEE XPLORE》 *
王春海: "《VMware虚拟化与云计算 vSphere运维卷》", 31 January 2018, 中国铁道出版社 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634720A (en) * 2018-12-13 2019-04-16 郑州云海信息技术有限公司 A kind of multi-dummy machine shares the method, system and device of FPGA board
CN109634720B (en) * 2018-12-13 2021-11-19 郑州云海信息技术有限公司 Method, system and device for sharing FPGA (field programmable Gate array) board card by multiple virtual machines
CN109634627A (en) * 2019-01-23 2019-04-16 郑州云海信息技术有限公司 Method based on OpenStack platform management FPGA device
CN109634627B (en) * 2019-01-23 2022-02-18 郑州云海信息技术有限公司 Method for managing FPGA (field programmable Gate array) equipment based on OpenStack platform
CN110597627A (en) * 2019-08-24 2019-12-20 中国电子科技集团公司第十五研究所 Database computing acceleration device and acceleration method based on virtual FPGA
CN110597627B (en) * 2019-08-24 2023-07-14 中国电子科技集团公司第十五研究所 Database operation acceleration device and acceleration method based on virtual FPGA
CN111047505A (en) * 2019-12-20 2020-04-21 北京浪潮数据技术有限公司 GPU multiplexing method, device, equipment and readable storage medium
CN113326226A (en) * 2020-02-28 2021-08-31 安徽寒武纪信息科技有限公司 Virtualization method and device, board card and computer readable storage medium
CN113326092A (en) * 2020-02-28 2021-08-31 安徽寒武纪信息科技有限公司 Virtualization method, virtualization device, board card and computer-readable storage medium
CN113326091A (en) * 2020-02-28 2021-08-31 安徽寒武纪信息科技有限公司 Virtualization method, virtualization device, board card and computer-readable storage medium
CN113326109A (en) * 2020-02-28 2021-08-31 安徽寒武纪信息科技有限公司 Virtualization method, virtualization device, board card and computer-readable storage medium
WO2021170055A1 (en) * 2020-02-28 2021-09-02 安徽寒武纪信息科技有限公司 Virtualization method, device, board card and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN108897601A (en) A kind of FPGA application method, system and relevant apparatus based on virtualization
US10936535B2 (en) Providing remote, reliant and high performance PCI express device in cloud computing environments
US10768862B2 (en) Extending existing storage devices in virtualized environments
US10768972B2 (en) Managing virtual machine instances utilizing a virtual offload device
US9424067B2 (en) Managing virtual machine instances utilizing an offload device
CN102932174B (en) A kind of physical network card management method, device and physical host
CN101976200B (en) Virtual machine system for input/output equipment virtualization outside virtual machine monitor
CN106250211A (en) A kind of virtualization implementation method based on SR_IOV
CN103645957B (en) A kind of resources of virtual machine management-control method and device
CN112905304B (en) Communication method and device between virtual machines, physical host and medium
US20160285970A1 (en) Network communication between virtual machine applications via direct memory access
CN103942087A (en) Virtual machine thermal migration method, related device and cluster computing system
CN101075198A (en) Method and system for providing two levels server virtualization
CN115913953B (en) A cloud resource acceleration method, device and medium thereof
CN106789363A (en) A kind of method and device to virtual machine configuration network interface card
CN106598696B (en) Method and device for data interaction between virtual machines
CN105556473A (en) I/O task processing method, device and system
US9697047B2 (en) Cooperation of hoarding memory allocators in a multi-process system
CN104468311A (en) Method and system for virtualizing physical network card into multiple virtual network cards
CN111858035A (en) A kind of FPGA device allocation method, device, device and storage medium
CN108667750A (en) virtual resource management method and device
TW202224395A (en) Methods for application deployment across multiple computing domains and devices thereof
CN109617720A (en) A method and device for allocating network resources
CN113760798A (en) RDMA device allocation method, computing device and storage medium
CN116069451B (en) Virtualization method, device, equipment, medium, accelerator and system

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181127