IP Library Granted Patent US 11,928,493
Granted Patent B2
US 11,928,493 · App. 17/281,593 · Granted Mar 12, 2024

Sharing of FPGA board by multiple virtual machines

Inventors: Jiaheng Fan (Henan, CN); Rui Hao (Henan, CN)
Assignee: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY CO., LTD.
G06F9/45558G06F2009/4557G06F2009/45579G06F2009/45595
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,928,493
App. No.
17/281,593
Granted
Mar 12, 2024
Kind
B2
Abstract

A method, system and apparatus for the sharing of an FPGA board by multiple virtual machines. Specifically, in the present application, a PCIE virtual layer (comprising a plurality of PCIE virtual sub-layers) and a virtual PCIE device are created; one virtual machine corresponds to one virtual PCIE device, multiple virtual PCIE devices correspond to one PCIE virtual sub-layer, and one PCIE virtual sub-layer corresponds to one FPGA board, thus enabling multiple virtual machines to share and use the FPGA board through one PCIE virtual sub-layer (that is, the multiple virtual machines share one PCIE bus, and same all access the FPGA board through the PCIE bus), thereby solving the problem of some of the virtual machines being unable to be started at the same time, and enhancing the experience effect of a user.

Claims (54)

1. A method for sharing a field-programmable gate array (FPGA) board among a plurality of virtual machines, comprising:

establishing a peripheral component interface express (PCIE) virtual layer in a host system of a cloud server in advance, wherein the PCIE virtual layer comprises one or more PCIE virtual sub-layers that are in first one-to-one correspondence with one or more FPGA boards, and each of the one or more FPGA boards is an acceleration card shared among virtual machines configured in the cloud server;

selecting, for each PCIE virtual sub-layer, virtual machines interacting with said PCIE virtual sub-layer, from the virtual machines configured in the cloud server in advance;

creating, in each PCIE virtual sub-layer, virtual PCIE devices that are in second one-to-one correspondence with the virtual machines interacting with said PCIE virtual sub-layer;

loading a first virtual PCIE device onto a first virtual machine of the virtual machines configured in the cloud server, after the first virtual machine is activated, wherein the first virtual PCIE device is in a first PCIE virtual sub-layer of the one or more PCIE virtual sub-layers, and corresponds to the first virtual machine in the second one-to-one correspondence;

receiving, via the first virtual PCIE device, to-be-processed data from the first virtual machine; and

sending, through the first PCIE virtual sub-layer, the to-be-processed data to a first FPGA board corresponding to the first PCIE virtual sub-layer;

wherein in response to more than one virtual machines comprising the first virtual machine sending respective to-be-processed data to the first FPGA board simultaneously, the method further comprises:

processing, by the first FPGA board according to a preset sharing mode, the to-be-processed data sent from the more than one virtual machines; and

returning, by the first FPGA board, the processed to-be-processed data correspondingly to the more than one virtual machines.

2. The method according to claim 1 , wherein before establishing the PCIE virtual layer in the host system of the cloud server in advance, the method further comprises:

acquiring a first quantity of FPGA boards provided for the virtual machines configured in the cloud server, and a second quantity of the virtual machines configured in the cloud server; and

allocating each of the virtual machines configured in the cloud server to one of the FPGA boards, in response to the first quantity being less than the second quantity;

wherein the allocating comprises:

determining, from all FPGA boards, the one or more FPGA boards, and

determining, from all virtual machines, virtual machines sharing each of the one or more FPGA boards; and

wherein the selecting comprises: determining, for each PCIE virtual sub-layer, the virtual machines interacting with said PCIE virtual sub-layer, according to a result of the allocating.

3. The method according to claim 1 , wherein before sending the to-be-processed data to the first FPGA board, the method further comprises:

writing the to-be-processed data into a shared memory in the first PCIE virtual sub-layer, wherein the shared memory is preset for the first virtual PCIE device.

4. The method according to claim 3 , wherein the preset sharing mode is set by:

setting a priority in advance for each virtual machine sharing the same FPGA board, and

performing, by the FPGA board, the data processing according to the priority, wherein the higher the priority of a virtual machine is, the earlier the to-be-processed data from the virtual machine is processed in the data processing.

5. The method according to claim 3 , wherein the preset sharing mode is set by:

performing, by the FPGA board, the data processing according to a first-in-first-out rule.

6. The method according to claim 1 , further comprising:

updating, in response to a sharing relationship among the virtual machines configured in the cloud server being changed, the PCIE virtual layer and the PCIE virtual devices according to the changed sharing relationship.

7. An apparatus for sharing a field-programmable gate array (FPGA) board among a plurality of virtual machines, comprising:

a memory, configured to store a computer program, and

a processor, configured to execute the computer program to perform:

establishing a peripheral component interface express (PCIE) virtual layer in a host system of a cloud server in advance, wherein the PCIE virtual layer comprises one or more PCIE virtual sub-layers that are in first one-to-one correspondence with one or more FPGA boards, and each of the one or more FPGA boards is an acceleration card shared among virtual machines configured in the cloud server;

selecting, for each PCIE virtual sub-layer, virtual machines interacting with said PCIE virtual sub-layer, from the virtual machines configured in the cloud server in advance;

creating, in each PCIE virtual sub-layer, virtual PCIE devices that are in second one-to-one correspondence with the virtual machines interacting with said PCIE virtual sub-layer;

loading a first virtual PCIE device onto a first virtual machine of the virtual machines configured in the cloud server, after the first virtual machine is activated, wherein the first virtual PCIE device is in a first PCIE virtual sub-layer of the one or more PCIE virtual sub-layers, and corresponds to the first virtual machine in the second one-to-one correspondence;

receiving, via the first virtual PCIE device, to-be-processed data from the first virtual machine; and

sending, through the first PCIE virtual sub-layer, the to-be-processed data to a first FPGA board corresponding to the first PCIE virtual sub-layer;

wherein the processor is further configured to execute the computer program to perform: in response to more than one virtual machines comprising the first virtual machine sending respective to-be-processed data to the first FPGA board simultaneously,

processing, by the first FPGA board according to a preset sharing mode, the to-be-processed data sent from the more than one virtual machines; and

returning, by the first FPGA board, the processed to-be-processed data correspondingly to the more than one virtual machines.

8. The apparatus according to claim 7 , wherein the processor is further configured to execute the computer program to perform:

before establishing the PCIE virtual layer in the host system of the cloud server in advance,

acquiring a first quantity of FPGA boards provided for the virtual machines configured in the cloud server, and a second quantity of the virtual machines configured in the cloud server; and

allocating each of the virtual machines configured in the cloud server to one of the FPGA boar s, in response to the first quantity being less than the second quantity;

wherein the allocating comprises:

determining, from all FPGA boards, the one or more FPGA boards, and

determining, from all virtual machines, virtual machines sharing each of the one or more FPGA boards; and

wherein the selecting comprises: determining, for each PCIE virtual sub-layer, the virtual machines interacting with said PCIE virtual sub-layer, according to a result of the allocating.

9. The apparatus according to claim 7 , wherein the processor is further configured to execute the computer program to perform:

before sending the to-be-processed data to the first FPGA board, writing the to-be-processed data into a shared memory in the first PCIE virtual sub-layer, wherein the shared memory is preset for the first virtual PCIE device.

10. The apparatus according to claim 9 , wherein the preset sharing mode is set by:

setting a priority in advance for each virtual machine sharing the same FPGA board, and performing, by the FPGA board, the data processing according to the priority, wherein the high r the priority of a virtual machine is, the earlier the to-be-processed data from the virtual machine is processed in the data processing.

11. The apparatus according to claim 9 , wherein the preset sharing mode is set by:

performing, by the FPGA board, the data processing according to a first-in-first-out rule.

12. The apparatus according to claim 7 , wherein the processor is further configured to execute the computer program to perform:

updating, in response to a sharing relationship among the virtual machines configured in the cloud server being changed, the PCIE virtual layer and the PCIE virtual devices according to the changed sharing relationship.

Assignments (2)
LICENSE Recorded Jun 30, 2026
From: IEIT SYSTEMS CO., LTD
To: AIVRES SYSTEMS INC.
Reel/Frame 075857/0939 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 31, 2021
From: FAN, JIAHENG; HAO, RUI
To: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY CO., LTD.
Reel/Frame 055776/0679 →
Priority Claims (1)
CN 201811527156.X · Dec 13, 2018 · national
Continuity (1)
Related Publication 20210373928A1 · Dec 2, 2021