Data processing method, device and server for graphics processor virtualization, and medium

By determining the execution status of command packets after the virtual machine time slice is used up in the graphics processor virtualization scenario, and retaining cached data if the execution is not completed, the problem of writing global cached data to video memory and then reading it is solved, thus improving the execution efficiency of the physics engine.

CN121300914BActive Publication Date: 2026-03-10RICUN TECH (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In a graphics processor virtualization scenario, the time consumed in writing global cache data to video memory and then reading it back leads to wasted video memory bandwidth, which affects the execution performance of the physics engine.

Method used

After the scheduler detects that the virtual machine time slice has been used up, it determines whether the command package has been executed. If it has not been executed, the global cache data is retained until the next virtual machine time slice is used up, thus avoiding data being written to the video memory.

Benefits of technology

It reduces the time spent writing global cache data to video memory and then reading it back, saves video memory bandwidth, and improves the performance of the physics engine in executing virtual machine tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121300914B_ABST
    Figure CN121300914B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method and device for graphic processor virtualization, a server and a medium, and comprises the following steps: in a single time unit, after detecting that a time slice corresponding to a first virtual machine is used up, it is judged whether a first command package of the first virtual machine is executed; if the first command package is not executed, execution data associated with the first command package in a global cache is reserved; a second command package of a second virtual machine is executed through a physical engine until a time slice corresponding to the second virtual machine is used up. The technical scheme of the application can reduce time consumption caused by writing global cache data into a display memory and reading back, save display memory bandwidth, and improve execution performance of the physical engine on a virtual machine task in a graphic processor virtualization scene.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a data processing method and device for graphics processor virtualization, a server and a medium. BACKGROUND

[0002] Graphics Processing Unit (GPU) virtualization technology is a technology of virtually outputting multiple lightweight graphics cards on a physical graphics card, and then distributing the lightweight graphics cards to multiple virtual machines for use. Specifically, in a cloud server, multiple virtual machines are installed on a host computer, and the multiple virtual machines can realize functions such as graphics rendering, general computing and artificial intelligence through the lightweight graphics cards. However, since the lightweight graphics cards do not have a physical engine and a display memory, the acceleration operations of the above-mentioned functions such as graphics rendering, general computing and artificial intelligence still need to be performed by the physical graphics card.

[0003] In this way, one physical graphics card needs to provide services for multiple virtual machines through time-sharing multiplexing. Taking graphics rendering as an example, an operating system will be installed on each virtual machine, and a graphics design program or an application such as a game will be run, and the application will generate a large number of rendering command packets through a graphics card driver. A scheduler will control the physical engine to execute the command packets generated by different virtual machines in different time slices according to the pre-divided time slices. In order to improve the acceleration performance, the physical graphics card usually has a large global cache that can store execution data associated with the command packets, such as instructions, vertices or texture images and the like. In addition, the calculation data required by other processors (including central processing units, video codecs or application specific integrated circuits and the like) in the cloud server can also be stored in the global cache. In order to ensure that this type of data can be correctly and quickly obtained, the execution data associated with the command packets of the virtual machine in the global cache needs to be written into the display memory in time, and the data in the cache needs to be invalidated.

[0004] In the prior art, when the scheduler detects that the time slice of a virtual machine A is used up, the physical engine can be controlled to execute the command packets generated by a next virtual machine B, and the execution data associated with the command packets of the virtual machine A in the global cache is written into the display memory and invalidated. This processing is relatively simple and direct, so that the physical engine and the global cache always serve only one virtual machine at any moment, but the disadvantage is also obvious. If the current command packets of the virtual machine A have not been executed completely, the next time the physical engine serves the virtual machine A, the execution data corresponding to the command packets needs to be read from the display memory to the global cache again, which wastes the time of the physical engine and the bandwidth of the display memory, and causes the execution performance of the physical engine to decrease. SUMMARY

[0005] The application provides a data processing method and device for graphics processor virtualization, a server and a medium, which can reduce time consumption caused by writing global cache data to a display memory and reading it back, save display memory bandwidth and improve the execution performance of a physical engine on a virtual machine task in a graphics processor virtualization scenario.

[0006] According to an aspect of the application, a data processing method for graphics processor virtualization is provided, which is applied to a graphics processor in a cloud server, the cloud server is deployed with a plurality of virtual machines, and the plurality of virtual machines at least include a first virtual machine and a second virtual machine; the method comprises the following steps:

[0007] In a single time unit, after detecting that a time slice corresponding to the first virtual machine is used up, it is judged whether a first command package of the first virtual machine is executed completely or not;

[0008] If the first command package is not executed completely, execution data associated with the first command package in a global cache is reserved;

[0009] The second command package of the second virtual machine is executed by a physical engine until a time slice corresponding to the second virtual machine is used up.

[0010] According to another aspect of the application, a data processing device for graphics processor virtualization is provided, which is applied to a graphics processor in a cloud server, the cloud server is deployed with a plurality of virtual machines, and the plurality of virtual machines at least include a first virtual machine and a second virtual machine; the device comprises the following steps:

[0011] A command package judging module is configured to, in a single time unit, after detecting that a time slice corresponding to the first virtual machine is used up, judge whether a first command package of the first virtual machine is executed completely or not;

[0012] A data reserving module is configured to, if the first command package is not executed completely, reserve execution data associated with the first command package in a global cache;

[0013] A command package executing module is configured to execute a second command package of the second virtual machine by a physical engine until a time slice corresponding to the second virtual machine is used up.

[0014] According to another aspect of the application, a server is provided, which comprises:

[0015] At least one graphics processor; at least one processor; and a memory connected with the at least one processor in communication;

[0016] The memory stores a computer program which can be executed by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the data processing method of virtualization of a graphics processor according to any one of the embodiments of the present application.

[0017] According to another aspect of the present application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to implement the data processing method of virtualization of a graphics processor according to any one of the embodiments of the present application when executed by the processor.

[0018] According to another aspect of the present application, a computer program product is provided, which comprises a computer program for implementing the data processing method of virtualization of a graphics processor according to any one of the embodiments of the present application when executed by a processor.

[0019] The technical solution provided by the present application can reduce the time consumption caused by writing data in a global cache to a display memory and then reading the data back, save the display memory bandwidth, and improve the execution performance of a physical engine on a virtual machine task in a graphics processor virtualization scenario.

[0020] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent through the following description. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the present application, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative effort.

[0022] Figure 1 is a flowchart of a data processing method of virtualization of a graphics processor according to an embodiment of the present application;

[0023] Figure 2 is a flowchart of another data processing method of virtualization of a graphics processor according to an embodiment of the present application;

[0024] Figure 3 is a flow chart of another data processing method of graphic processor virtualization provided according to the third embodiment of the present application;

[0025] Figure 4 is a structural schematic diagram of a data processing device of graphic processor virtualization provided according to the fourth embodiment of the present application;

[0026] Figure 5 is a server structural schematic diagram of the data processing method of graphic processor virtualization according to the fifth embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to make the personnel in the technical field better understand the present application scheme, the technical scheme in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by the person skilled in the art without creative labor should belong to the scope of protection of the present application.

[0028] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0029] The first embodiment provides a data processing method of graphic processor virtualization, Figure 1 For the flow chart of the data processing method of graphic processor virtualization, the present embodiment can be applicable to the case of processing global cache data in the graphic processor in the graphic processor virtualization scenario. The method can be executed by a data processing device of graphic processor virtualization, which can be realized in the form of hardware and / or software and configured in the scheduler of the graphic processor. The graphic processor is deployed in a cloud server, and the cloud server is deployed with a plurality of virtual machines, including at least a first virtual machine and a second virtual machine. As shown in the figure, the method comprises: Figure 1

[0030] ​Step 110: In a single time unit, after detecting that the time slice corresponding to the first virtual machine has been used up, determine whether the first command package of the first virtual machine has been executed.

[0031] In this embodiment, multiple lightweight graphics cards can be virtualized on the physical graphics card of the graphics processor. Each virtual machine can correspond to one or more lightweight graphics cards, which are used to implement functions such as graphics rendering, general computing, and artificial intelligence. Each virtual machine corresponds to a virtual packet queue. The scheduler divides a single time unit into multiple time slices, and then allocates the multiple time slices to multiple virtual machines, so that the physics engine executes the command packets from the virtual machine corresponding to that time slice in each time slice.

[0032] Optionally, the single time unit can be determined based on the frame rate of the physical graphics card in the graphics processor, with multiple time slices corresponding one-to-one with multiple virtual machines. The scheduler can allocate a single time unit evenly to multiple virtual machines, or it can allocate it using a non-average strategy based on the virtual machine task type; this embodiment does not impose any limitations on this.

[0033] In this step, after the scheduler detects that the time slice corresponding to the first virtual machine has been used up, it can determine whether the command packet (i.e., the first command packet) currently issued by the physical engine for the first virtual machine has been executed. Specifically, the scheduler can determine the execution status of the first command packet based on a preset command packet execution completion flag or the execution result of the first command packet. This embodiment does not impose any limitations on this.

[0034] Step 120: If the first command package has not been executed, retain the execution data associated with the first command package in the global cache.

[0035] In this embodiment, once the physics engine has finished executing the first command package, the execution data associated with the first command package in the global cache on the physical graphics card can be written into the video memory. Then, the execution data associated with the first command package in the global cache is invalidated. The invalidation process includes deleting or setting an invalidation status flag, etc.

[0036] Specifically, taking the command package corresponding to a graphics rendering task as an example, the execution data associated with the command package can be vertex data, texture image data, etc.

[0037] In this embodiment, if the physical engine has not finished executing the first command package, only the service object of the physical engine is switched, that is, the physical engine executes the command package of the next virtual machine through step 130, while retaining the execution data associated with the first command package in the global cache.

[0038] The advantage of this setup is that when it's the physics engine's turn to serve the first virtual machine next time, it can directly retrieve the execution data associated with the first command package from the global cache and continue executing the first command package. This reduces the time consumption caused by writing global cache data to video memory and then reading it back, saves video memory bandwidth, and improves the physics engine's execution performance for virtual machine tasks.

[0039] Step 130: Execute the second command package of the second virtual machine through the physical engine until the time slice corresponding to the second virtual machine is used up.

[0040] In this embodiment, after detecting that the time slice corresponding to the second virtual machine has been used up, the same data processing method as in steps 110-120 can be used to judge the second command package and process the execution data associated with the second command package in the global cache according to the judgment result.

[0041] The technical solution provided in this embodiment, by having the scheduler detect that the time slice corresponding to the first virtual machine has been used up in a single time unit, determines whether the first command package of the first virtual machine has been executed. If the first command package has not been executed, the execution data associated with the first command package in the global cache is retained, and the second command package of the second virtual machine is executed by the physics engine until the time slice corresponding to the second virtual machine is used up, can reduce the time consumption caused by writing global cache data to video memory and then reading it back in the graphics processor virtualization scenario, save video memory bandwidth, and improve the execution performance of the physics engine for virtual machine tasks.

[0042] Figure 2 This is a flowchart illustrating a data processing method for graphics processor virtualization according to Embodiment 2 of the present invention. This embodiment is a further refinement of the above embodiment. Figure 2 As shown, the method includes:

[0043] Step 210: In a single time unit, after detecting that the time slice corresponding to the first virtual machine has been used up, determine whether the first command package of the first virtual machine has been executed. If yes, proceed to step 220; otherwise, proceed to step 230.

[0044] Step 220: Write the execution data associated with the first command package in the global cache into the video memory, and invalidate the execution data associated with the first command package in the global cache.

[0045] Step 230: Retain the execution data associated with the first command package in the global cache.

[0046] In one embodiment of this example, if the first command package has not been completed, the execution status of the first command package is marked, and the marking result is written into the storage unit.

[0047] Specifically, the mapping relationship between the identification information of the first command package and the execution status labeling result can be written into the storage unit.

[0048] The advantage of this setup is that by marking the status of unfinished virtual machine command packages, the physical engine can quickly identify the execution status of the command package and continue executing it the next time it is the virtual machine's turn to serve it, thereby improving the physical engine's performance in executing virtual machine tasks.

[0049] Step 240: Determine whether the second command package of the second virtual machine is being executed for the first time. If yes, proceed to step 250; otherwise, proceed to step 260.

[0050] In this embodiment, determining whether the second command package is being executed for the first time includes: querying the status label result corresponding to the second command package in the storage unit, and determining whether the second command package is being executed for the first time based on the query result.

[0051] Step 250: Starting from the first task command in the second command package, execute multiple task commands sequentially through the physics engine until the time slice corresponding to the second virtual machine is used up.

[0052] In this embodiment, the task command can be the execution command corresponding to the virtual machine task, such as the graphics drawing command, the calculation command, the artificial intelligence acceleration command, etc.

[0053] Step 260: Using the physics engine, the second command package is executed according to the execution data associated with the second command package in the global cache until the time slice corresponding to the second virtual machine is used up.

[0054] The technical solution provided in this embodiment reduces the time consumption caused by writing global cache data to video memory and then reading it back in a graphics processor virtualization scenario. This saves video memory bandwidth and improves the execution performance of the physical engine for virtual machine tasks. Specifically, it determines whether the first command package has been executed after the time slice corresponding to the first virtual machine is used up in a single time unit. If yes, the execution data associated with the first command package in the global cache is written to the video memory, and the execution data associated with the first command package in the global cache is invalidated. If no, the execution data associated with the first command package in the global cache is retained. Then, it determines whether the second command package of the second virtual machine is being executed for the first time. If yes, the physical engine executes multiple task commands sequentially, starting from the first task command in the second command package, until the time slice corresponding to the second virtual machine is used up. If no, the physical engine continues to execute the second command package based on the execution data associated with the second command package in the global cache until the time slice corresponding to the second virtual machine is used up.

[0055] Figure 3 This is a flowchart illustrating a data processing method for graphics processor virtualization according to Embodiment 3 of the present invention. This embodiment is a further refinement of the above embodiments. In this embodiment, in addition to task command symbols, the command package may also include cache data write command symbols, cache data invalidation command symbols, context save command symbols, and context restore command symbols. The data processing procedure of the global cache in the graphics processor can be implemented through specific command symbols in the command package. For example... Figure 3 As shown, the method includes:

[0056] Step 310: In a single time unit, after detecting that the time slice corresponding to the first virtual machine has been used up, determine whether the first command package has been executed completely based on the position of the completed task command in the first command package. If yes, proceed to step 320; otherwise, proceed to step 330.

[0057] Step 320: Execute the cache data write command and cache data invalidation command in the first command package through the physics engine to write the execution data associated with the first command package in the global cache into the video memory, and invalidate the execution data associated with the first command package in the global cache.

[0058] Step 330: Skip the cached data write command and cached data invalidation command in the first command package through the physics engine, and execute the save context command to retain the execution data associated with the first command package in the global cache, the interrupt position of the task command, and the current running environment of the physics engine.

[0059] In this embodiment, specifically, the current operating environment of the physical engine may include the context environment of the arithmetic unit and registers.

[0060] Step 340: Determine whether the second command package of the second virtual machine is being executed for the first time. If yes, proceed to step 350; otherwise, proceed to step 360.

[0061] Step 350: Starting from the first task command in the second command package, execute multiple task commands sequentially through the physics engine until the time slice corresponding to the second virtual machine is used up.

[0062] Step 360: Through the physical engine, execute the recovery context command in the second command package to restore the physical engine's running environment. Based on the execution data associated with the second command package in the global cache and the running environment, starting from the interrupt position of the task command in the second command package, execute the subsequent task commands in the second command package in sequence until the time slice corresponding to the second virtual machine is used up.

[0063] In this step, specifically, if the second command package of the second virtual machine is not executed for the first time, that is, if the second command package was interrupted during historical execution, then the recovery context command in the second command package is executed by the physical engine to restore the context environment of the arithmetic units and registers before the second command package was interrupted.

[0064] The technical solution provided in this embodiment reduces the time consumption caused by writing global cache data to video memory and then reading it back in a single time unit after detecting that the time slice of the first virtual machine has been used up. It determines whether the first command package has been completed based on the position of the completed task command in the first command package. If yes, the physical engine executes the cache data write command and cache data invalidation command in the first command package. If no, the physical engine skips the cache data write command and cache data invalidation command in the first command package and executes the save context command. Then, it determines whether the second command package of the second virtual machine is being executed for the first time. If yes, the physical engine executes multiple task command commands sequentially from the first task command in the second command package until the time slice is used up. If no, the physical engine executes the restore context command of the second command package. Based on the execution data associated with the second command package in the global cache and the restored runtime environment, it executes the subsequent task command commands of the second command package sequentially from the interrupt position of the task command in the second command package until the time slice is used up. This technique can reduce the time consumption caused by writing global cache data to video memory and then reading it back in a graphics processor virtualization scenario, saving video memory bandwidth and improving the execution performance of virtual machine tasks by the physical engine.

[0065] Based on the above embodiments, in order to better explain the technical solution provided by the present invention, the following implementation methods can be referred to:

[0066] Taking virtual machines A and B as examples, in a single time unit, after the scheduler detects that the time slice of virtual machine A has been used up, it can determine whether the command package of virtual machine A has been executed.

[0067] Assume that the command package format of virtual machine A is as follows:

[0068] Command packet header

[0069] {

[0070] Restore Context Command

[0071] Context storage space

[0072] }

[0073] {

[0074] Task Command Line 1

[0075] Task Command Line 2

[0076] ...

[0077] Task command n

[0078] }

[0079] {

[0080] Global cache data write command to video memory

[0081] Invalidate global cache data command

[0082] Save Context Command

[0083] Context storage space

[0084] }

[0085] command packet tail

[0086] In this embodiment, the scheduler can obtain the position of the completed task command in the command package of virtual machine A. If the physical engine has completed the execution of task command n, it will normally execute the command to write global cache data to video memory and the command to invalidate global cache data. Then, the command package of virtual machine B will be executed through the physical engine until the time slice is used up.

[0087] If the time slice of virtual machine A has expired, and the physics engine has just finished executing the task command m in the above command package ( If the task command is not executed, the position of the task command is preserved. After the physics engine skips the command to write global cache data to video memory and the command to invalidate global cache data, it executes the command to save the context, so as to preserve the context environment of the internal arithmetic units and registers of the physics engine and marks the command package as incomplete. Then the command package of virtual machine B is executed through the physics engine until the time slice is used up.

[0088] When it is the physical engine's turn to serve virtual machine A next time, the physical engine can execute the recovery context command in the above command package to restore the context environment of the physical engine's internal arithmetic units and registers, and jump to task command m to continue executing the task commands after task command m.

[0089] After detecting that the time slice corresponding to virtual machine B has been used up, the command package of virtual machine B can be judged in the same way as above, and the execution data associated with the command package in the global cache can be processed according to the judgment result.

[0090] Figure 4 This is a schematic diagram of a data processing device for graphics processor virtualization according to Embodiment 4 of the present invention. The device is applied to a graphics processor in a cloud server. The cloud server deploys multiple virtual machines, including at least a first virtual machine and a second virtual machine. Figure 4 As shown, the device includes: a command packet judgment module 410, a data retention module 420, and a command packet execution module 430.

[0091] The command packet judgment module 410 is used to determine whether the first command packet of the first virtual machine has been executed after detecting that the time slice corresponding to the first virtual machine has been used up in a single time unit.

[0092] The data retention module 420 is used to retain the execution data associated with the first command package in the global cache if the first command package has not been executed.

[0093] Command package execution module 430 is used to execute the second command package of the second virtual machine through the physical engine until the time slice corresponding to the second virtual machine is used up.

[0094] The technical solution provided in this embodiment, by having the scheduler detect that the time slice corresponding to the first virtual machine has been used up in a single time unit, determines whether the first command package of the first virtual machine has been executed. If the first command package has not been executed, the execution data associated with the first command package in the global cache is retained, and the second command package of the second virtual machine is executed by the physics engine until the time slice corresponding to the second virtual machine is used up, can reduce the time consumption caused by writing global cache data to video memory and then reading it back in the graphics processor virtualization scenario, save video memory bandwidth, and improve the execution performance of the physics engine for virtual machine tasks.

[0095] Based on the above embodiments, the command package includes a cached data write command, a cached data invalidation command, a save context command, and a restore context command.

[0096] Command packet determination module 410 includes:

[0097] The first command packet processing unit is used to detect that the time slice corresponding to the first virtual machine has been used up, and determine whether the first command packet has been executed based on the position of the completed task command in the first command packet; if so, the cache data write command and cache data invalidation command in the first command packet are executed by the physical engine to write the execution data associated with the first command packet in the global cache into the video memory, and invalidate the execution data associated with the first command packet in the global cache.

[0098] The status labeling unit is used to label the execution status of the first command package if the first command package has not been completed, and write the labeling result into the storage unit.

[0099] The data retention module 420 includes:

[0100] The storage command execution unit is used to, if the first command package has not been completed, skip the cached data write command and cached data invalidation command in the first command package through the physics engine, and execute the save context command to retain the execution data associated with the first command package, the interrupt position of the task command, and the current running environment of the physics engine in the global cache.

[0101] Command package execution module 430 includes:

[0102] The second command packet determination unit is used to query the status label result corresponding to the second command packet in the storage unit, and determine whether the second command packet is executed for the first time based on the query result.

[0103] The second command package execution unit is used to determine whether the second command package is being executed for the first time; if so, it executes multiple task commands sequentially starting from the first task command in the second command package through the physical engine; if not, it continues to execute the second command package through the physical engine based on the execution data associated with the second command package in the global cache.

[0104] The recovery command execution unit is used to restore the physical engine's operating environment by executing the recovery context command in the second command package through the physical engine when the second command package is not executed for the first time; and by the physical engine, based on the execution data and the operating environment, to execute the subsequent task commands in the second command package sequentially, starting from the interrupt position of the task command in the second command package.

[0105] The above-described apparatus can execute the methods provided in all the foregoing embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the above methods. Technical details not described in detail in this embodiment can be found in the methods provided in all the foregoing embodiments of the present invention.

[0106] Figure 5 A schematic diagram of a server 10, which can be used to implement embodiments of the present invention, is shown. The server is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, mainframe computers, and other suitable computers.

[0107] like Figure 5 As shown, server 10 includes at least one graphics processor, at least one processor 11, and memory, such as read-only memory (ROM) or random access memory (RAM), communicatively connected to at least one processor 11. The memory stores computer programs executable by at least one processor. Processor 11 can perform various appropriate actions and processes based on the computer program stored in read-only memory 12 or loaded from storage unit 18 into random access memory 13. Random access memory 13 can also store various programs and data required for the operation of server 10. Processor 11, read-only memory 12, and random access memory 13 are interconnected via bus 14. Input / output (I / O) interfaces are also connected to bus 14.

[0108] Multiple components in server 10 are connected to input / output interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of monitors, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows server 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0109] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as data processing methods virtualized by a graphics processor.

[0110] In some embodiments, the graphics processor virtualization data processing method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on server 10 via read-only memory 12 and / or communication unit 19. When the computer program is loaded into random access memory 13 and executed by processor 11, one or more steps of the graphics processor virtualization data processing method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the graphics processor virtualization data processing method by any other suitable means (e.g., by means of firmware).

[0111] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0112] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0113] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0114] To provide interaction with the user, the systems and techniques described herein can be implemented on a server having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the server. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including voice input, speech input, or tactile input).

[0115] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0116] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0117] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0118] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A data processing method for graphics processor virtualization, the method comprising: The application relates to a graphics processor applied to a cloud server, wherein a plurality of virtual machines are deployed in the cloud server, and the plurality of virtual machines at least include a first virtual machine and a second virtual machine; the method comprises the following steps: In a single time unit, after detecting that a time slice corresponding to the first virtual machine is used up, it is judged whether a first command package of the first virtual machine is executed completely; If the first command package is not executed completely, execution data associated with the first command package in a global cache is reserved; It is judged whether a second command package of the second virtual machine is executed for the first time through a physical engine; if yes, a plurality of task command symbols are executed in sequence through the physical engine from a first task command symbol in the second command package; if not, the second command package is continuously executed according to execution data associated with the second command package in the global cache through the physical engine until a time slice corresponding to the second virtual machine is used up.

2. The method of claim 1, wherein, The command package comprises a cache data write command symbol and a cache data invalid command symbol; After detecting that a time slice corresponding to the first virtual machine is used up, it is judged whether a first command package of the first virtual machine is executed completely, which comprises the following steps: After detecting that a time slice corresponding to the first virtual machine is used up, it is judged whether a first command package of the first virtual machine is executed completely according to a position of a task command symbol that has been executed completely in the first command package; If yes, a cache data write command symbol and a cache data invalid command symbol in the first command package are executed through the physical engine so as to write execution data associated with the first command package in the global cache into a display memory and to invalidate the execution data associated with the first command package in the global cache.

3. The method of claim 2, wherein, The command package further comprises a save context command symbol; If the first command package is not executed completely, the execution data associated with the first command package in the global cache, an interruption position of a task command symbol and a current running environment of the physical engine are reserved by skipping the cache data write command symbol and the cache data invalid command symbol in the first command package and executing the save context command symbol through the physical engine. The command package comprises a restore context command symbol; 4. The method of claim 1, wherein, The second command package is continuously executed according to execution data associated with the second command package in the global cache through the physical engine, which comprises the following steps: The restore context command symbol in the second command package is executed through the physical engine so as to restore the running environment of the physical engine; According to the execution data and the running environment, a subsequent task command symbol in the second command package is executed in sequence through the physical engine from an interruption position of a task command symbol. The method further comprises the following steps:

5. The method of claim 1, wherein, If the first command package is not executed completely, an execution state of the first command package is marked, and the marking result is written into a storage unit; It is judged whether the second command package is executed for the first time, which comprises the following steps: A state marking result corresponding to the second command package is inquired in the storage unit, and it is judged whether the second command package is executed for the first time according to the inquiry result. ​ 6. A data processing apparatus for graphics processor virtualization, the data processing apparatus comprising: A graphics processor applied to a cloud server, the cloud server deploying a plurality of virtual machines, the plurality of virtual machines including at least a first virtual machine and a second virtual machine; the apparatus comprising: a command packet judgment module configured to, after detecting that a time slice corresponding to the first virtual machine is used up in a single time unit, judge whether a first command packet of the first virtual machine is executed completely; a data retention module configured to, if the first command packet is not executed completely, retain execution data associated with the first command packet in a global cache; a command packet execution module configured to judge, by a physical engine, whether a second command packet of the second virtual machine is executed for the first time; if yes, execute a plurality of task command symbols in the second command packet by the physical engine from a first task command symbol in the second command packet; if not, continue to execute the second command packet by the physical engine according to execution data associated with the second command packet in the global cache until a time slice corresponding to the second virtual machine is used up.

7. A server, characterized by The server comprises: at least one graphics processor; at least one processor; and a memory connected to the at least one processor in communication; wherein, the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the data processing method of the graphics processor virtualization according to any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to execute the data processing method of the graphics processor virtualization according to any one of claims 1-5 when executed.

9. A computer program product, characterised in that, The computer program product comprises a computer program, and the computer program, when executed by the processor, implements the data processing method of the graphics processor virtualization according to any one of claims 1-5. The computer program product comprises a computer program, and the computer program, when executed by the processor, implements the data processing method of the graphics processor virtualization according to any one of claims 1-5.

Citation Information

Patent Citations

  • Resource scheduling method and device of physical display card, storage medium and terminal

    CN116521376A

  • System and method for multi-tenant implementation of graphics processing unit

    US20210096917A1