Graphics processor resource management method, device, equipment, and program

The method addresses the challenge of limited GPU resources in cloud gaming by dynamically allocating resources based on demand and past consumption, enhancing rendering quality and resource utilization.

JP7681803B2Active Publication Date: 2025-05-22TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2024524725
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2022-02-14
Filing Date
2022-11-17
Publication Date
2025-05-22
Estimated Expiration
2042-11-17

AI Technical Summary

Technical Problem

In cloud gaming, the limited GPU resources on cloud servers lead to contention among multiple game processes, affecting rendering quality, and providing separate GPUs for each process results in resource wastage.

Method used

A method for efficient GPU resource management that determines the processing order of task processes in real-time based on resource demand and past consumption, allocating resources to ensure a predetermined target value is reached.

Benefits of technology

This method avoids resource contention and improves GPU resource utilization by rationally allocating resources based on demand, ensuring high-quality rendering for multiple game processes with limited resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007681803000001
    Figure 0007681803000001
  • Figure 0007681803000002
    Figure 0007681803000002
  • Figure 0007681803000003
    Figure 0007681803000003
Patent Text Reader

Abstract

The present application provides a resource management method, an apparatus, a computer-readable storage medium, and a computer program product for a graphics processor. The method according to the present application relates to the field of cloud technology and cloud gaming, and for multiple application processes simultaneously running on the same graphics processor, considers the remaining resources available for these application processes in past resource allocation, and determines a resource allocation method in real time based on the currently available resource amount of these application processes in the graphics processor resource, thereby realizing efficient allocation of the graphics processor resource. According to the method according to the present application, the graphics processor resource can be rationally allocated according to the resource demand of each application process, avoiding the influence of contention between multiple application processes, and improving the utilization rate of the graphics processor resource.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This application claims priority to a Chinese patent application filed with the State Intellectual Property Office of the People's Republic of China on February 14, 2022, bearing application number 2022101351584 and entitled "Graphics processor resource management method, device and apparatus, and storage medium," the entire contents of which are incorporated herein by reference.

[0002] The present application relates to the field of cloud technology, and more particularly to a graphics processor resource management method, apparatus and device, computer-readable storage medium, and computer program product. [Background technology]

[0003] With the continuous development of cloud technology, cloud gaming is becoming more and more popular in the gaming industry. In cloud gaming, the game screen is rendered by a graphics processor (Graphic Processing Unit, GPU) on the cloud server side, and the rendering result is transmitted to the user's client via a network. However, the GPU resource on the cloud server side is limited, and in a cloud server providing cloud gaming, multiple game processes loaded on the cloud server may share the hardware computing resources of the cloud server, so that contention for the hardware computing resources occurs. When multiple game processes are simultaneously executed on one GPU, these game processes compete for GPU resources, which affects the rendering effect. Providing a separate GPU for each game process can guarantee the rendering quality of each game process, but it will inevitably lead to serious waste of GPU resources.

[0004] Therefore, there is a need for an efficient GPU resource management method that can achieve higher quality rendering of multi-game processes with limited GPU resources. Summary of the Invention [Problem to be solved by the invention]

[0005] In order to solve the above problem, the present application realizes efficient allocation of graphics processor resources by determining in real time the processing order for task processes based on the resource demand of each task process and resource consumption that has already occurred. [Means for solving the problem]

[0006] SUMMARY OF THE DISCLOSURE Embodiments of the present application provide a graphics processor resource management method, apparatus and device, a computer-readable storage medium, and a computer program product.

[0007] Embodiments of the present application include: determining a plurality of graphics processors for processing application processes; obtaining a plurality of application processes to be processed and assigning one of the plurality of graphics processors to each application process of the plurality of application processes; for each application process of at least one application process assigned to one graphics processor, determining the remaining amount of resources available for the application process in the current predetermined resources of the graphics processor, wherein the remaining amount of available resources is associated with the remaining amount of resources available for the application process in the past predetermined resources of the graphics processor; based on the remaining amount of resources available for each application process of the at least one application process in the current predetermined resources, determining a resource allocation instruction for each application process of the at least one application process, wherein the resource allocation instruction indicates whether to perform processing on the application process; and the resource allocation instruction is used to make the remaining amount of resources available for the application process in the current predetermined resources reach a predetermined target value, providing a method for managing resources of a graphics processor.

[0008] An embodiment of the present application includes a step of initiating a scheduling process, the scheduling process including an allocation thread and a plurality of processing threads; a step of determining a plurality of graphics processors for processing application processes by the allocation thread and allocating one processing thread to each of the plurality of graphics processors; a step of initiating a plurality of application processes, each of the plurality of application processes including a scheduling library pre-constructed by the scheduling process; and a step of allocating one of the plurality of graphics processors and a corresponding processing thread to each of the plurality of application processes by the scheduling library of the application process and the allocation thread. and for each application process of at least one application process assigned to one graphics processor, determining, by a processing thread corresponding to the application process, an amount of remaining resource available for the application process in a current specified resource of the graphics processor, and determining a resource allocation instruction for the application process, the resource allocation instruction instructing the application process whether or not to perform processing, wherein the amount of remaining resource available is related to an amount of remaining resource available for the application process in a past specified resource of the graphics processor, and the resource allocation instruction is used to make the amount of remaining resource available for the application process in the current specified resource reach a predetermined target value.

[0009] An embodiment of the present application provides a resource management device for a graphics processor, comprising: a processor determination module configured to determine a plurality of graphics processors capable of processing an application process; a processor allocation module configured to obtain a plurality of application processes to be processed and to assign one of the plurality of graphics processors to each of the plurality of application processes; a remaining resource determination module configured to determine, for each of at least one application process assigned to one graphics processor, an amount of remaining resources available for the application process in a current specified resource of the graphics processor, the amount of remaining resources available being associated with an amount of remaining resources available for the application process in a past specified resource of the graphics processor; and a resource allocation module configured to determine a resource allocation instruction for each of the at least one application process based on the amount of remaining resources available for each of the at least one application process in the current specified resource, the resource allocation instruction instructing whether or not to perform processing for the application process, wherein the resource allocation instruction is used to ensure that the amount of remaining resources available for the application process in the current specified resource reaches a predetermined target value.

[0010] An embodiment of the present application provides a graphics processor resource management device including one or more processors and one or more memories, wherein a computer-executable program is stored in the one or more memories, and when the computer-executable program is executed by the processor, the graphics processor resource management method as described above is performed.

[0011] An embodiment of the present application provides a computer-readable storage medium having computer-executable instructions stored thereon, which, when executed by a processor, realizes the above-described graphics processor resource management method.

[0012] An embodiment of the present application further provides a computer program product or computer program comprising computer instructions, the computer instructions being stored in a computer readable storage medium, such that a processor of a computing device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computing device to perform a graphics processor resource management method according to an embodiment of the present application. Effect of the Invention

[0013] Compared to conventional resource management methods for graphics processors, the method according to the embodiment of the present application avoids resource contention among multiple application processes by using the past resource consumption of application processes running on the graphics processor as a reference for resource allocation and adjusting resource allocation in real time based on the amount of resources actually available to each application process.

[0014] The method according to the embodiment of the present application realizes efficient resource allocation for multiple application processes simultaneously executed on the same graphics processor by considering the remaining resources available for these application processes in the past resource allocation and determining a resource allocation method in real time based on the currently available resource amount of the graphics processor resources for these application processes. According to the method according to the embodiment of the present application, the graphics processor resources can be rationally allocated according to the resource demand of each application process, the influence of the contention between multiple application processes is avoided, and the utilization rate of the graphics processor resources is improved. [Brief description of the drawings]

[0015] In order to more clearly describe the technical means in the embodiments of the present application, the following briefly describes the drawings that need to be used in the description of the embodiments. It is obvious that the drawings in the following description are only some exemplary embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative labor. [Figure 1] FIG. 2 is an exemplary schematic diagram illustrating a scene in which multiple application processes use a GPU resource according to an embodiment of the present application. [Figure 2A] 1 is a flowchart illustrating a resource management method for a graphics processor according to an embodiment of the present application. [Figure 2B] 1 is a schematic flow chart illustrating a resource management method for a graphics processor according to an embodiment of the present application. [Figure 2C] FIG. 2 is a sequence diagram illustrating a resource management method for a graphics processor according to an embodiment of the present application. [Diagram 3] FIG. 2 is a schematic diagram illustrating allocation of a graphics processor to multiple application processes according to an embodiment of the present application. [Figure 4A]It is a schematic diagram showing two types of resource usage situations according to an embodiment of the present application. [Figure 4B] It is a schematic diagram showing the resource allocation ratio of a plurality of application processes according to an embodiment of the present application. [Diagram 5] It is a schematic diagram showing a collection queue and a processing queue according to an embodiment of the present application. [Figure 6] It is an exemplary schematic diagram showing determining a first increment of the amount of used resources of an application process in a current predetermined resource according to an embodiment of the present application. [Figure 7] It is a schematic diagram showing the acquisition and processing of a first increment according to an embodiment of the present application. [Figure 8A] It is a schematic diagram showing a double buffering method of a CPU and a GPU when determining a first increment according to an embodiment of the present application. [Figure 8B] It is a schematic diagram showing an adaptive buffering method of a CPU and a GPU when determining a first increment according to an embodiment of the present application. [Figure 9A] It is a schematic diagram showing a resource management method of a graphics processor according to an embodiment of the present application. [Figure 9B] It is a schematic diagram showing a scheduling logic of a resource management method of a graphics processor according to an embodiment of the present application. [Figure 10] It is a schematic diagram showing a resource management device of a graphics processor according to an embodiment of the present application. [Figure 11] It is a schematic diagram showing a resource management device of a graphics processor according to an embodiment of the present application. [Figure 12] It is a schematic diagram showing an architecture of an exemplary computing device according to an embodiment of the present application. [Figure 13] It is a schematic diagram showing a storage medium according to an embodiment of the present application.

Embodiments for Carrying Out the Invention

[0016] In order to make the objectives, technical means and advantages of the present application clearer, exemplary embodiments of the present application are described in detail below with reference to the drawings. Obviously, the described embodiments are only some embodiments of the present application, but not all, and the present application is not limited to the exemplary embodiments described herein.

[0017] In the present specification and drawings, steps and elements that are substantially the same or similar are denoted by the same or similar reference numerals to avoid redundant description. In addition, in the description of this application, terms such as "first", "second", etc. are used only to distinguish the description, and should not be understood as indicating or implying relative importance or order. In addition, the term "plurality" may be understood to mean at least two.

[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terms used herein are for the purpose of describing the embodiments of the present invention only and are not intended to be limiting of the present invention.

[0019] The resource management method for a graphics processor according to the present application can be based on cloud technology.

[0020] The resource management method for a graphics processor according to the present application may be based on cloud gaming.

[0021] FIG. 1 is an exemplary schematic diagram illustrating a scene in which multiple application processes use a GPU resource according to an embodiment of the present application.

[0022] Currently, many mobile phone applications or computer software need to realize their functions through a network, especially for game applications. The network may be the Internet of Things based on the Internet and / or telecommunication network, and may be a wired network or a wireless network, for example, a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a cellular data communication network, or other electronic network that can realize information exchange functions. As shown in FIG. 1, the mobile phone application or computer software in the user terminal can send a control command input by a user to a server to launch a corresponding application process. The server may have various hardware computing resources, such as a central processing unit, a communication interface, a memory, etc. Taking the GPU resource shown in FIG. 1 as an example, there are multiple GPUs (for example, GPU-1, GPU-2, etc.) in the server, and each of these GPUs can perform related calculations for different application processes.

[0023] Optionally, the server may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, and may further be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The user terminal may be, but is not limited to, a smartphone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. The user terminal and the server may be directly or indirectly connected by wired or wireless communication methods, and are not limited in the present application. For example, in the embodiment of the present application, a game application connected to a network generally uses a GPU on the cloud server to synthesize or hardware encode the game screen displayed on the user terminal, and such a game application is also called cloud gaming (also called "game on demand"). The user terminal may transmit game operation data from the user to the cloud server via a control stream, and the cloud server transmits one or more frames of audio and video frames to the user terminal via a data stream.

[0024] In cloud gaming, games are stored, synchronized and presented in a remote cloud server, and transmitted to players by streaming technology, which is a completely different type of online game service from the conventional type. Specifically, the cloud server executes the game, presents and encodes its graphical output into video, and then streams the video to a network client, which decodes and displays the video stream for the player to interact with the game, and sends the control commands input by the player to the cloud server. In this way, cloud gaming removes the constraints on the player's device by shifting the computational load of the game from the client to the cloud, and allows the player to start playing the game immediately without having to spend time downloading and installing the game client. Due to these advantages, cloud gaming has attracted a lot of attention from academia and industry.

[0025] As described above, the cloud server is responsible for interpreting the player's input, executing the game code, and rendering graphics, and transmits the game scene to the client via the network, and the client decodes and displays the game scene to the player, and captures and transmits the game player's operation on the game in real time as the input of the cloud server. In the process of the cloud server performing graphic rendering using the GPU, the GPU hardware computing resource is limited, and in the cloud server providing cloud gaming, multiple virtual entities in the cloud server may share the hardware computing resource of the cloud server, so that contention for the hardware computing resource occurs. Generally, the rendering of the GPU hardware processes rendering requests from all game processes executed thereon on a first-come, first-served basis, and an increase in the rendering load of a single game process affects the normal rendering of other game processes. For example, when the rendering of any game process times out, the rendering time of the other game processes is forcibly shortened, so that the rendering quality is no longer high, and such deterioration of the rendering quality gradually accumulates as the rendering process progresses, which may seriously affect the user's gaming experience.

[0026] Current GPU resource management methods completely separate resource allocation or ignore resource preemption in managing GPU resources, but do not separate GPU memory and the bandwidth of the PCI-E (peripheral component interconnect express) bus standard, so that at a certain moment, the GPU occupancy is very high, but the PCI-E bus is in a null state, and the final overall resource utilization may not be high. For example, GPU resource division using virtualized GPU technology can only achieve a division granularity of 1 / 2 or 1 / 4 of the GPU resource, and cannot perform finer granularity resource division. Such resource management methods rely on pre-settings for a specific application process and cannot flexibly allocate GPU computing resources in real time according to the entry / exit of the application process.

[0027] In view of the above, the present application provides a resource management method for a graphics processor, which realizes efficient allocation of graphics processor resources by determining in real time the processing order for task processes based on the resource demand of each task process and resource consumption that has already occurred.

[0028] Compared to conventional resource management methods for graphics processors, the method according to the embodiment of the present application avoids resource contention among multiple application processes by using the past resource consumption of application processes running on the graphics processor as a reference for resource allocation and adjusting resource allocation in real time based on the amount of resources actually available to each application process.

[0029] The method according to the embodiment of the present application realizes efficient resource allocation for multiple application processes simultaneously running on the same graphics processor by considering the remaining resources available for these application processes in past resource allocations and determining a resource allocation method in real time based on the currently available resource amounts of the graphics processor resources for these application processes. According to the method according to the embodiment of the present application, the graphics processor resources can be rationally allocated according to the resource demands of each application process, thereby avoiding the influence of contention between multiple application processes and improving the utilization rate of the graphics processor resources.

[0030] Fig. 2A is a flowchart showing a resource management method 200 for a graphics processor according to an embodiment of the present application. Fig. 2B is a schematic flowchart showing a resource management method for a graphics processor according to an embodiment of the present application. Fig. 2C is a schematic sequence diagram showing a resource management method for a graphics processor according to an embodiment of the present application.

[0031] As shown in FIG. 2A, in step 201, multiple graphics processors for handling application processes may be determined.

[0032] Optionally, the resource management for GPU can be performed by two parts, an application process and a scheduling service, as shown in Fig. 2C, in cooperation with each other, the application process part corresponds to the operation performed by the application process (e.g., a game instance) in the GPU resource management process, and the scheduling service part corresponds to the GPU resource management scheduling operation for the corresponding application process. Optionally, the application process may be various application processes, such as a game process, a video process, and a conference process, and in this application, a game process developed by a graphics engine such as OpenGL (Open Graphics Library) is taken as an example, and is not limited thereto, and any process that requires GPU resource scheduling can be applied to the GPU resource management method of this application.

[0033] As shown in FIG. 2C, before an application process is launched, an allocation thread in the scheduling service first determines a number of GPUs currently available for processing the application process, and corresponding processing threads can be created for these GPUs in the scheduling service, so that subsequent resource allocation management for each GPU can be performed on the corresponding processing thread. For example, for a graphic rendering task of an application process such as a game instance, the determined GPU should have the ability to perform certain rendering calculations. Note that, although the following description often focuses on graphic rendering of a game instance in a cloud gaming scene, the GPU resource management method according to the present application can be applied to the processing of other application processes as well, for example, to the processing of a video process and a conference process, and may process image rendering of a video screen or image rendering of a conference screen.

[0034] In step 202, a plurality of application processes to be processed may be obtained, and one of the plurality of graphics processors may be assigned to each application process of the plurality of application processes.

[0035] As shown in FIG. 2C, after each user terminal launches an application, the server side can respectively register the corresponding application process, allocate a GPU for its graphic rendering processing to each application process, and return registration information to the application process, which is information such as the index of the allocated GPU and the corresponding processing thread.

[0036] Optionally, if the GPU resource demand of an application process exceeds the determined available resources of each GPU, the multiple GPUs can be virtualized into one GPU by transferring the application process's request for GPU resources to a different GPU for execution, thereby realizing application process processing in this case.

[0037] Optionally, if it is ensured that the computational performance limit of the GPU is met, multiple application processes can be assigned to the same GPU, that is, the processing tasks of multiple application processes are executed simultaneously on the same GPU.

[0038] 3 is a schematic diagram illustrating allocating a graphics processor to multiple application processes according to an embodiment of the present application. As shown in FIG. 3, when there are three application processes A, B, C and three available GPUs 1, 2, 3, by performing the GPU allocation operation in step 202, GPU1 is allocated to process application processes A and C, GPU2 is allocated to process application process B, and GPU3 is not allocated to process any application process. Therefore, for application processes A and C jointly executed on GPU1, these application processes can share the computing resources of GPU1, so that the resource usage of these application processes may also have a competitive relationship, and the GPU resource management method according to the present application can avoid the competitive effect between these application processes.

[0039] According to an embodiment of the present application, each application process of the plurality of application processes may have a predetermined resource demand weight. Optionally, the resource demand weight of each application process may be determined based on the amount of GPU resources required for its calculation, and the resource demand weight may be predetermined and notified to the scheduling service at the time of registration. For example, for a plurality of game instances, the corresponding resource demand weights may be predetermined based on the complexity and calculation amount of their screen rendering, and the weights may be the ratios required for the screen rendering of the game instance in unit GPU resources, for example, if the screen rendering of the game instance requires 200 ms in 1 s of GPU hardware computing time, the resource demand weight of the game instance may be 0.2 (200 ms / 1 s).

[0040] According to an embodiment of the present application, in step 202, allocating one graphics processor of the plurality of graphics processors to each application process of the plurality of application processes may include: determining an available resource ratio of each graphics processor of the plurality of graphics processors, the available resource ratio being a proportion of resources available for processing the application process in the graphics processor; and determining a graphics processor to be allocated to each application process based on a resource demand weight of each application process of the plurality of application processes and the available resource ratio of each graphics processor of the plurality of graphics processors.

[0041] From the above, each of the multiple GPUs is a GPU that is currently available for processing an application process, but the available computing resource amounts of these GPUs may not necessarily be equal, and may not be equal to all computing resource amounts, so it is necessary to determine the available resource amounts of the available GPUs before allocating a GPU to an application process with a specific resource demand. Similar to the above description of the resource demand weight, the available resource amount of a GPU can be expressed by its available resource ratio, and the available resource ratio can represent the ratio of the resource amount available for processing an application process in a GPU to its unit resource. For example, in a GPU hardware computing time of 1 s, if the time available for processing an application process is 0.8 s, the available resource ratio of the GPU may be 0.8.

[0042] Therefore, the GPU allocation to the application processes can be determined based on both the resource demand weight of each application process and the available resource ratio of each GPU. According to an embodiment of the present application, the sum of the resource demand weights of at least one application process assigned to one graphics processor is equal to or less than the available resource ratio of the graphics processor. The sum of the resource demand weights of the application processes assigned to one GPU for processing is equal to or less than the available resource ratio of the GPU, i.e., the amount of resources actually used for processing the application processes on the GPU is equal to or less than the expected amount of resources.

[0043] In step 203, for each application process of the at least one application process assigned to one graphics processor, a remaining resource amount available for the application process in a current predetermined resource of the graphics processor may be determined, and the remaining available resource amount may be related to a remaining resource amount available for the application process in a past predetermined resource of the graphics processor. According to an embodiment of the present application, the resource amounts included in the past predetermined resource and the current predetermined resource of the graphics processor may both be the predetermined resource amount.

[0044] Optionally, the resource amounts included in the past predetermined resource and the current predetermined resource (i.e., the predetermined resource amount) may be the unit GPU resource, and the past predetermined resource is the predetermined resource of the application process before the current predetermined resource. Since the usage amount of the unit GPU resource can determine the usage rate of the GPU (the ratio between the actual operation time and execution time of the GPU), the allocation of the GPU resource in this application can be performed based on the allocation of the unit GPU resource. For example, the unit GPU resource may be a calculation time of a unit length such as the above-mentioned 1s or 1 frame time, and this application is not limited thereto. According to an embodiment of the present application, the resource demand weight of each application process of the multiple application processes may indicate the ratio of the resource amount required for the application process in the predetermined resource amount. From the above, the resource demand weight of an application process may be the ratio of the resource required for processing the application process in the unit GPU resource.

[0045] In an embodiment of the present application, a current resource allocation may be determined based on a past state of resource allocation for an application process. The past state may include a remaining resource amount of the application process in a past resource allocation, i.e., a resource amount that is available but unused. The existence of the remaining available resource amount may be caused by the resource of the application process being occupied due to the processing timeout of other application processes, and such resource occupation may reduce the rendering effect of the application process. Therefore, in order to avoid the accumulation of such resource occupation, a corresponding adjustment can be made in subsequent resource allocation, for example, by correlating the resource amount available to the application process in the current resource allocation with the remaining available resource amount in the past resource allocation.

[0046] According to an embodiment of the present application, in step 203, determining the remaining amount of resource available for the application process on the current specified resource may include determining the remaining amount of resource available for the application process on the current specified resource based on the remaining amount of resource available for the application process on the past specified resource, the used resource amount of the application process on the current specified resource, and a resource demand weight of the application process.

[0047] Optionally, a total amount of resource available to an application process in a current given resource can be determined based on the resource demand weight of the application process and its remaining amount of available resource in the past given resource, and then, based on the amount of used resource of the application process in the current given resource, the remaining amount of available resource in the current given resource can be determined; i.e., the remaining amount of available resource in the current given resource can be obtained by subtracting the amount of used resource in the current given resource from the total amount of available resource in the current given resource.

[0048] By determining the amount of remaining resource available for an application process in a current given resource based on the amount of remaining resource available for the application process in a past given resource, the current resource allocation can be adjusted based on the error in the past resource allocation to reduce or even eliminate the error in the resource allocation. For example, if the amount of remaining resource available for an application process in a past given resource is less than zero, the error in the resource allocation can be effectively reduced by subtracting the absolute value of the amount of remaining resource available for the application process in the past given resource from the amount of remaining resource available for the application process in the current given resource.

[0049] Therefore, according to the embodiment of the present application, the resource management method 200 of the graphics processor may further include, for each application process of the at least one application process, obtaining the remaining resource amount available for the application process in the past predetermined resource, and determining the used resource amount of the application process in the current predetermined resource.

[0050] Optionally, the used resource amount of the application process in the current predetermined resource may include the resource amount used by the application process in the previous resource allocation and the resource amount used in an earlier resource allocation for the current predetermined resource, and the resource amount used by the application process in the previous resource allocation corresponds to the computing resources used in its latest processing.

[0051] Therefore, the step of determining the used resource amount of the application process in the current predetermined resource is a step of determining a first increment of the used resource amount of the application process in the current predetermined resource, and the first increment corresponds to the previous processing of the processing task from the application process by the graphics processor corresponding to the application process.

[0052] Optionally, for the rendering task of the game instance, the first increment may correspond to the time when the GPU last executed the rendering process of the game instance. As shown in FIG. 2C, the rendering time may be obtained by the application process and notified to the scheduling service by the scheduling library set therein. Thereby, the scheduling service processes the rendering time based on the rendering time and determines, among other things, the remaining resource amount available for the application process in the current predetermined resource.

[0053] From the above, as shown in FIG. 2C, by determining the remaining resource amount available for each application process on the same GPU in the current given resource, the scheduling service can determine the current resource allocation method and notify the application process whether to render, and the application process waits for the rendering notification from the scheduling service during this time. Therefore, obtaining the remaining resource amount available for each application process, especially the first increment of each application process, is very important for the GPU resource management of the present application, and can effectively reduce the allocation error. For the method of obtaining the first increment, please refer to the related description of FIG. 6 and FIG. 7 below, and will not be described in detail here.

[0054] In step 204, a resource allocation instruction for each of the at least one application process may be determined based on an amount of remaining resource available to each of the at least one application process in the current predetermined resource, the resource allocation instruction instructing the application process whether or not to perform processing.

[0055] According to an embodiment of the present application, step 204 may include: for each application process of the at least one application process, determining that a resource allocation instruction to the application process indicates no processing for the application process if the remaining resource amount available for the application process in the current predetermined resource is equal to or less than zero; and for other application processes of the at least one application process having a remaining resource amount available for the application process greater than zero, determining a resource allocation instruction to each application process based on a priority of each of the other application processes.

[0056] Optionally, from the above, for application processes whose available remaining resource amount in the current predetermined resource is equal to or less than zero, resources may not be allocated to the application processes from the current predetermined resource so as not to affect the processing of other application processes. For application processes whose available remaining resource amount in the current predetermined resource is greater than zero, it is possible to continue to allocate GPU computing resources to these application processes. Optionally, resource allocation to these application processes may be based on the priority of these application processes, and not only on the first-come-first-served contention mode described above.

[0057] According to an embodiment of the present application, the priority of each of the other application processes may be associated with the length of the processing wait time of the application process and the chronological order in which the latest first increment is determined. For example, in the case of an application process to be processed that is likely to cause a screen freeze or the like, the priority may be set high so that the process is prioritized. In the case of a processing timing in which such an emergency does not occur, the priority may be determined based on the chronological order in which the first increments of these application processes were obtained. For example, the application process that first obtained the first increment and has a remaining available resource amount in the current specified resource that is greater than zero may be processed preferentially.

[0058] According to an embodiment of the present application, the step of determining a resource allocation instruction for each application process based on the priority of each application process of the other application processes may include: when an application process exists for each application process of the other application processes, the length of processing waiting time of the application process satisfies a predetermined condition, determining a resource allocation instruction for the application process based on a chronological order of determining a latest first increment of the application process; and when no application process exists, the length of processing waiting time of the application process satisfies a predetermined condition, determining a resource allocation instruction for each application process of the other application processes, based on a chronological order of determining a latest first increment of the application process.

[0059] From the above, the following three factors (including but not limited to these factors) can be considered for setting the priority of an application process: (1) the amount of available remaining resources, where a low priority may be set (instructing not to execute) for an application process whose current amount of available remaining resources in a given resource is zero or less; (2) urgency, where a high priority may be set for an application process that needs to be processed immediately, for example, when a screen freeze or other emergency occurs; (3) the order of obtaining the first increment, where a high priority may be set for an application process that obtains the first increment first, whereby the allocation of GPU resources is made more continuous, thereby improving the utilization rate of GPU resources. It should be understood that the method of the present application may take into account various other factors when setting the priority of processing of application processes, and the factors listed above are merely examples and are not limited thereto.

[0060] According to an embodiment of the present application, the resource allocation instruction indicates whether a corresponding application process should send a processing task to a corresponding graphics processor for processing by the graphics processor, and the processing of the processing task by the graphics processor corresponds to the use of resources of the graphics processor by the application process.

[0061] As described above, the execution of the various operation steps described above does not require redirecting the rendering commands of all application processes to the command flow system required for rendering the scheduling process, as in the conventional method, but is performed in an event-triggered manner, thereby improving development efficiency and reducing costs.

[0062] As shown in Fig. 2B, the GPU resource management of the present application evaluates the resource usage of GPU hardware resources by each application process to control the transmission of processing tasks by these application processes. Fig. 2B takes a graphic rendering task as an example, and the GPU resource management can control the distribution of rendering instructions by each application process through resource allocation instructions.

[0063] Optionally, each application process can determine whether to send a processing task (e.g., deliver a rendering instruction to the GPU rendering instruction queue in FIG. 2B ) to a corresponding GPU based on the received resource allocation instruction, and the GPU can consume a certain number of GPU hardware resources to execute the processing task, and the certain number of computing resources can correspond to a first increment of the application process that is referenced for the next resource allocation.

[0064] According to an embodiment of the present application, the resource allocation instruction can make the remaining amount of resource available to the application process in the current predetermined resource reach a predetermined target value. Optionally, the resource allocation instruction tends to reduce the error of resource allocation for each application process. The predetermined target value is a value that the preset remaining amount of available resource should reach, and can be set as needed, for example, it may be set to zero to make the remaining amount of available resource approach zero and save resources.

[0065] Figure 4A is a schematic diagram showing two kinds of resource usage situations according to an embodiment of the present application. For example, when the remaining resource amount available to an application process is greater than zero (for example, the normal case shown in Figure 4A), a resource allocation instruction to the application process allows the application process to send processing tasks, and further use a certain amount of computing resources, and the remaining resource amount available is reduced to greater than zero; when the remaining resource amount available to an application process is less than zero (for example, the timeout case shown in Figure 4A), the application process cannot use any resource in the current given resource, so the application process will not allocate any resource from the current given resource to the application process, and the remaining resource amount available will not continue to decrease.

[0066] According to an embodiment of the present application, the resource allocation instruction makes the resource percentage used by the application process in the current predetermined resource closer to the resource demand weight of the application process than the resource percentage used by the application process in the past predetermined resource, i.e., the resource allocation instruction makes a first error of the application process larger than a second error, the first error being the error between the resource demand weight of the application process and the resource percentage used by the application process in the past predetermined resource, and the second error being the error between the resource demand weight of the application process and the resource percentage used by the application process in the current predetermined resource.

[0067] 4B is a schematic diagram showing the resource allocation ratio of multiple application processes according to an embodiment of the present application. As shown in FIG. 4B, the resource demand weights of three application processes A, B and C are 0.5, 0.2 and 0.3, respectively. In the past, in a given resource, application process A uses a resource amount (58%) that exceeds its given resource demand, so the other two application processes B and C are insufficient in resources (17% and 25%, respectively, both of which are less than the resource ratio corresponding to their given resource weights).

[0068] Therefore, according to the GPU resource management method of the present application, since the remaining resource amount available to application process A in the past predetermined resource is less than zero (for example, −0.08 in the example of FIG. 4B), the resource allocation from the current predetermined resource is reduced according to the overused resource amount (i.e., 0.08). Therefore, in the resource allocation result of the current predetermined resource, 42% of the available resource amount is allocated to application process A by the resource allocation adjustment, and resource compensation is performed for other application processes B and C whose resources are occupied according to the resource amount occupied by each of them (i.e., the resource amount available to application process B is 20%+(20%-17%)=23%, and the resource amount available to application process C is 30%+(30%-25%)=35%).

[0069] As described above, by making the remaining resource amount available for the application process in the current specified resource reach a predetermined target value, the resource amount used by the application process in the current specified resource can be made closer to the desired resource amount, i.e., the resource demand amount corresponding to the resource demand weight, thereby realizing on-demand resource allocation to the application process and realizing efficient use of the GPU resource.

[0070] Considering that the above GPU hardware resource timing allocation requires binding an accurate timer to a processing thread to trigger the timing allocation, in order to reduce the complexity of the method, the operations of rendering time notification and rendering time processing in FIG. 2C can be completed by creating one collection queue for collecting rendering time and one processing queue for processing rendering time.

[0071] 5 is a schematic diagram of a collection queue and a processing queue according to an embodiment of the present application. As shown in FIG. 5, the collection queue sequentially inserts multiple new rendering time data according to an input event, and the processing queue performs rendering time processing during this time, and replaces the collection queue after the processing is completed, so that the collection queue becomes the new processing queue, and the processing queue becomes the new collection queue, and the timing allocation to time is realized by the replacement of queues.

[0072] During the collection of rendering times, different rendering manners of application processes may cause the manner of obtaining the first increment to change accordingly. According to an embodiment of the present application, the manner of determining the first increment may be determined based on a processing manner of the processing task by the graphics processor, and the processing manner may include at least one of synchronous rendering or asynchronous rendering.

[0073] According to an embodiment of the present application, determining the first increment of the used resource amount of the application process at the current given resource may be performed by one of estimating the first increment by marking the start and end of the previous process, or obtaining the first increment from the graphics processor by using a query instruction.

[0074] Optionally, for an asynchronous rendering scheme, the first increment may be determined by intercepting a GPU hardware queue with a signal, in which case, according to an embodiment of the present application, determining the first increment of the used resource amount of the application process at the current given resource may be performed by estimating the first increment by marking the start and end of the previous processing.

[0075] FIG. 6 is an exemplary schematic diagram illustrating determining a first increment of a used resource amount of an application process in a current given resource according to an embodiment of the present application.

[0076] Optionally, the execution time of the drawing function may be calculated to determine the actual time required for rendering, and the actual time required for rendering may be the first increment of the amount of used resources in the current predetermined resource. As shown in Fig. 6, the execution time of the drawing function may include a preparation time and an actual rendering time, in which the preparation time includes the transmission of the drawing function through the PCI-E channel and the preparation for rendering, and the execution of the rendering command, and the actual rendering time is the actual part of the drawing command execution. Therefore, a command signal F may be inserted before and after the drawing command, and the signal F may be triggered to notify the application process (or the scheduling service) of the start or end of timing.

[0077] Optionally, for a synchronous rendering scheme, the first increment can be determined locally to an application thread by querying, in which case, according to an embodiment of the present application, determining the first increment of the used resource amount of the application process at the current given resource may be performed by obtaining the first increment from the graphics processor by using a query instruction.

[0078] FIG. 7 is a schematic diagram illustrating obtaining and processing a first increment according to an embodiment of the present application.

[0079] In the case of synchronous rendering, a query can send a query operation to the GPU, and the query operation can be used by the GPU to determine the time between two specified query points. As shown in FIG. 7, "query start" and "query end" are two specified query points inserted into the GPU, respectively, and the GPU time required to execute the drawing function of the rendering instruction between them, i.e., the rendering time, is queried, and the first inserted "query end" point cannot know the insertion position of the corresponding "query start" point, so the query is discarded. The part shown in the gray frame in FIG. 7 indicates performing a GPU resource management process based on the obtained rendering time, i.e., notifying the obtained rendering time to the scheduling service, waiting for a rendering notification by the scheduling service, performing rendering time processing by the scheduling service, and sending a rendering notification (i.e., a resource allocation command) to the application process by the event notification.

[0080] In the above-mentioned query operation of the rendering time, since the operation of waiting for the query time is a synchronous operation on the central processing unit (CPU) side, the waiting process of obtaining the rendering time may have a significant impact on the performance of the application. Therefore, the GPU resource management method according to the present application can offset the time it takes for the GPU to prepare the query result with the time it takes for the CPU to execute the rendering command.

[0081] FIG. 8A is a schematic diagram illustrating a CPU and GPU double buffering method in determining the first increment according to an embodiment of the present application.

[0082] In order to ensure the non-intersecting query mechanism in the GPU, i.e., the start point and end point of the query must be included in the non-intersecting query, i.e., multiple start points cannot be inserted consecutively, in this embodiment, the interaction operation between the CPU and the GPU is performed in a manner in which the GPU delays and calculates once. As shown in FIG. 8A, the indexes of the CPU and the GPU indicate their respective processing orders, and the processing of CPU2 corresponds to the query time of GPU1, and the processing of CPU3 corresponds to the query time of GPU2. This double buffering method effectively improves the processing performance of the CPU during the period in which the CPU waits for the query time of the GPU. However, since the processing of the CPU may be faster than the GPU, and the double buffering method may still not be able to completely avoid CPU waiting, based on the above double buffering method, the GPU management method according to the present application can also solve the above problem based on an adaptive buffering mechanism.

[0083] FIG. 8B is a schematic diagram illustrating an adaptive buffering method for a CPU and a GPU in determining the first increment according to an embodiment of the present application.

[0084] In the adaptive buffering mechanism, a double buffering mechanism can still be used, but if it is not possible to query for the completion of the previous drawing, the current query does not have to be terminated until it is determined that the previous drawing is definitely complete, and multiple drawing calls may be made during this time.

[0085] Compared to the double buffering method, the adaptive buffering method expands the number of draw calls in a query and expands one draw call in a query to multiple random calls, so the system accuracy may be reduced when multiple application processes are processed simultaneously. This is because there may be cross-rendering between different application processes, and the GPU only reads the time of the current query point and cannot distinguish between different application processes, resulting in inaccurate queries.

[0086] Therefore, in order to better control the commission of the rendering command queue, asynchronous refresh may be forced on the rendering command buffer area at the end of the GPU query, which generates a large amount of high-speed drawing, and such drawing does not need to use the adaptive buffering method, and the rendering time result of the GPU can be obtained quickly, but this also leads to communication transmission load. In order to balance system performance and accuracy while ensuring communication efficiency and reducing the mutual influence between multiple application processes, a Monte Carlo algorithm can be used that combines the basic algorithm of the double buffering method with the adaptive algorithm, and a better solution (relative to the optimal solution) is obtained by a probabilistic statistical method. The number of drawing calls or the system execution time can limit the deterioration from the adaptive algorithm to the double buffering basic algorithm, and low values ​​of these parameters may cause a decrease in communication performance, and high values ​​may increase the influence between multiple application processes, so that the rationality of the system can be further guaranteed by using the Monte Carlo algorithm.

[0087] 9A is a schematic diagram illustrating a resource management method 300 for a graphics processor according to an embodiment of the present application. As shown in FIG. 9A, the resource management method 300 for a graphics processor may include two operations respectively performed by a scheduling process and an application process. The resource management method 300 for a graphics processor may mainly include the following steps (1) to (6), and the numbers of each step correspond to the symbols in FIG. 9A.

[0088] In step (1), a scheduling process is launched, and the scheduling process may include an allocation thread and a number of processing threads.

[0089] As shown in FIG. 9A, the scheduling process may include one allocation thread and multiple processing threads, where the allocation thread may be used for allocating and delivering messages between the GPU and the application process, and the processing threads may be used for rendering time processing of the GPU.

[0090] In step (2), the allocation thread determines a plurality of graphics processors capable of processing the application process.

[0091] As described above, it is possible to determine multiple GPUs that are currently available for processing an application process, and then perform resource allocation management for each GPU.

[0092] In step (3), one processing thread is assigned to each of the plurality of graphics processors.

[0093] As shown in FIG. 9A , for the three currently determined available GPUs, the scheduling process can assign three processing threads 1, 2, and 3 to the render-time processing of the three GPUs, respectively, so that the subsequent resource allocation of each GPU can be performed by the corresponding processing thread.

[0094] In step (4), a plurality of application processes may be launched, and each of the plurality of application processes may include a scheduling library pre-constructed by the scheduling process.

[0095] Optionally, the scheduling library may be shared by the multiple application processes, and information exchange between the application processes and the scheduling process may be realized by the scheduling library. After an application process is started, the scheduling library can send information of the application process to the scheduling process for registration, and the registration operation of the application process is a synchronous operation. In order to reduce data backflow, the application process can continue to send messages after registration, and the scheduling process can notify the application process of processing by sharing events.

[0096] In step (5), for each of the plurality of application processes, a graphics processor among the plurality of graphics processors and a processing thread corresponding to the graphics processor are assigned to each of the plurality of application processes by a scheduling library of the application process and the assignment thread.

[0097] 9A, three application processes can be assigned GPUs for their graphic rendering processing, for example, GPU1 is assigned application processes 1 and 2 for graphic rendering, GPU3 is assigned application process 3 for graphic rendering, and GPU2 is not assigned to process the three application processes. After completing the registration operation of the application processes on the scheduling process, corresponding registration information, such as the index of the assigned GPU and the corresponding processing thread, can be returned to each application process.

[0098] In step (6), for each application process of at least one application process assigned to one graphics processor, a processing thread corresponding to the application process determines a remaining resource amount available for the application process in the current predetermined resource of the graphics processor, and determines a resource allocation instruction for the application process, the resource allocation instruction instructing the application process whether or not to perform processing.

[0099] The rendering processing operation of the scheduling service as described above can be performed by a corresponding processing thread in the scheduling process, for example, the processing thread 1 corresponding to GPU1 can process the rendering time of application processes 1 and 2, including determining the remaining resource amount available for the two application processes in the current predetermined resource, and determining a corresponding resource allocation command according to the remaining resource amount available for the two application processes in the current predetermined resource. After receiving the corresponding resource allocation command, each application process determines whether to send a processing task to the corresponding GPU for processing according to the resource allocation command.

[0100] From the above, the way of obtaining the first increment varies according to the way of processing the processing task by the GPU. For example, in the case of asynchronous rendering, the first increment may be directly estimated by the scheduling library from the GPU through signal interception, and in the case of synchronous rendering, the first increment may be obtained by the scheduling library from the GPU through a query command, that is, by tracing back along the solid line from the GPU to the scheduling library.

[0101] According to an embodiment of the present application, the available remaining resource amount is associated with the remaining resource amount available to the application process in the past predetermined resource of the graphics processor, and the resource allocation instruction makes the remaining resource amount available to the application process in the current predetermined resource reach a predetermined target value. As described above, by making the remaining resource amount available to the application process in the current predetermined resource reach a predetermined target value, the resource amount used by the application process in the current predetermined resource can be made closer to a desired resource amount, i.e., a resource demand amount corresponding to its resource demand weight. Therefore, on-demand resource allocation for application processes can be realized, and efficient use of GPU resources can be realized.

[0102] FIG. 9B is a schematic diagram showing the scheduling logic of the resource management method of the graphics processor according to an embodiment of the present application. Optionally, the resource management method of the graphics processor according to the present application involves three runtime libraries, which are Scheduling Client, Scheduling Service and Scheduling, respectively, based on the current design of a general graphics system. Among them, the Scheduling Client and Scheduling Service only handle the function injection and the communication manner with external events, and the core logic is in Scheduling. As shown in FIG. 9B, various functions (e.g., ResourceScheduling, SchedulingProtocol, etc.) in FIG. 9B may be called to collect and calculate the rendering time, and calculate whether to render based on the rendering time, thereby determining the resource allocation instruction for each application process.

[0103] FIG. 10 is a schematic diagram illustrating a resource management device 1000 for a graphics processor according to an embodiment of the present application.

[0104] The graphics processor resource management device 1000 may include a processor determination module 1001, a processor allocation module 1002, a remaining resource determination module 1003, and a resource allocation module 1004.

[0105] According to an embodiment of the present application, the processor determination module 1001 may be configured to determine a number of graphics processors capable of processing an application process.

[0106] Optionally, the processor determination module 1001 may perform the operations described in step 201 above.

[0107] Optionally, the application process may be various application processes, such as a game process, a video process, and a conference process, and correspondingly, for a graphic rendering task of an application process, such as a game instance, the determined GPU should be a GPU that has the ability to perform certain rendering calculations.

[0108] The processor allocation module 1002 may be configured to obtain a plurality of application processes to be processed and to allocate one graphics processor of the plurality of graphics processors to each application process of the plurality of application processes.

[0109] Optionally, the processor allocation module 1002 may perform the operations described in step 202 above.

[0110] Optionally, after each user terminal launches an application, the server side can register the corresponding application process respectively, including allocating a GPU for its graphic rendering processing to each application process. When ensuring that the limit of the computing performance of the GPU is met, multiple application processes can be allocated to the same GPU, that is, the processing tasks of multiple application processes are simultaneously executed on the same GPU, but the load allocated to the GPU cannot exceed the limit of the computing performance of the GPU.

[0111] The remaining resource determination module 1003 may be configured to determine, for each application process of at least one application process assigned to one graphics processor, an amount of remaining resources available for the application process in a current given resource of the graphics processor, the amount of available remaining resources being related to an amount of remaining resources available for the application process in a past given resource of the graphics processor.

[0112] Optionally, the remaining resource determination module 1003 may perform the operations described in the above step 203. By determining the amount of remaining resource available for an application process in a current given resource based on the amount of remaining resource available for the application process in a past given resource, the current resource allocation can be adjusted based on the error in the past resource allocation to reduce or even eliminate the error in the resource allocation.

[0113] The resource allocation module 1004 may be configured to determine a resource allocation instruction for each of the at least one application process based on a remaining amount of resource available to each of the at least one application process in the current predetermined resource, the resource allocation instruction instructing the application process to perform or not to perform an operation, and the resource allocation instruction is used to make the remaining amount of resource available to the application process in the current predetermined resource reach a predetermined target value.

[0114] Optionally, the resource allocation module 1004 may perform the operation described in step 204 above. As described above, by making the remaining resource amount available for the application process in the current predetermined resource reach a predetermined target value, the resource amount used by the application process in the current predetermined resource can be closer to the desired resource amount, i.e., the resource demand amount corresponding to its resource demand weight. Therefore, on-demand resource allocation for the application process can be realized, and efficient use of GPU resources can be realized.

[0115] In one embodiment, each application process of the plurality of application processes has a predefined resource demand weight, and the apparatus further comprises: and a used resource determination module configured to obtain, for each application process of the at least one application process, a remaining resource amount available for the application process in the past predetermined resource, and determine a used resource amount for the application process in the current predetermined resource; The remaining resource determination module is further configured to determine the remaining amount of resources available for the application process in the current predetermined resource based on the remaining amount of resources available for the application process in the past predetermined resource, the amount of resources used by the application process in the current predetermined resource, and the resource demand weight of the application process. The resource allocation instruction is used to make the first error of the application process larger than the second error. The first error is the error between the resource demand weight of the application process and the ratio of the resources used by the application process in the past predetermined resource. The second error is the error between the resource demand weight of the application process and the ratio of the resources used by the application process in the current predetermined resource.

[0116] In one embodiment, the resource allocation instruction is used to instruct whether a corresponding application process sends a processing task to a corresponding graphics processor for processing by the graphics processor. The processing of the processing task by the graphics processor corresponds to the use of the resources of the graphics processor by the application process. The used resource determination module is further configured to determine a first increment of the amount of resources used by the application process in the current predetermined resource. The first increment corresponds to the previous processing of the processing task from the application process by the graphics processor corresponding to the application process.

[0117] In one embodiment, the resource allocation module is further configured to: determine, for each application process of the at least one application process, if an amount of available remaining resource in a current predetermined resource corresponding to the application process is less than or equal to zero, a resource allocation instruction to the application process instructs the application process to not perform processing; and for other application processes of the at least one application process having an amount of available remaining resource greater than zero, determine a resource allocation instruction to each application process based on a priority of each of the other application processes.

[0118] In one embodiment, the priority of each of the other application processes is associated with a chronological order that determines the length of a processing latency of the application process and its most recent first increment; The resource allocation module is further configured to determine, for each application process of the other application processes, a resource allocation instruction for the application process based on a chronological order for determining the latest first increment of the application process when an application process exists whose length of processing waiting time satisfies a predetermined condition, and to determine a resource allocation instruction for each application process of the other application processes based on a chronological order for determining the latest first increment of the application process when an application process exists whose length of processing waiting time satisfies a predetermined condition.

[0119] According to another aspect of the present application, there is further provided a resource management apparatus for a graphics processor. Figure 11 shows a schematic diagram of a resource management apparatus 2000 for a graphics processor according to an embodiment of the present application.

[0120] 11, the graphics processor resource management device 2000 may include one or more processors 2010 and one or more memories 2020. The memory 2020 stores computer readable code, which, when executed by the one or more processors 2010, may perform the graphics processor resource management method as described above.

[0121] The processor according to the embodiment of the present application may be an integrated circuit chip having a signal processing capability. The processor may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. Each method, step, and logic block diagram disclosed in the embodiment of the present application may be realized or executed. The general-purpose processor may be a microprocessor or any general processor, and may be an X86 architecture or an ARM architecture.

[0122] In general, various exemplary embodiments of the present application may be implemented in hardware or special purpose circuits, software, firmware, logic, or any combination thereof. Some aspects may be implemented in hardware, and other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device. Although various aspects of the embodiments of the present application have been illustrated and described using block diagrams, flowcharts, or some other graphical representations, it should be understood that these blocks, devices, systems, techniques, or methods described herein may be implemented in, by way of non-limiting examples, hardware, software, firmware, special purpose circuits or logic, general purpose hardware or controller or other computing device, or some combination thereof.

[0123] For example, the method or apparatus according to the embodiment of the present application may be realized by the architecture of a computing device 3000 shown in FIG. 12. As shown in FIG. 12, the computing device 3000 may include a bus 3010, one or more CPUs 3020, a read-only memory (ROM) 3030, a random access memory (RAM) 3040, a communication port 3050 connected to a network, an input / output component 3060, and a hard disk 3070. The storage device in the computing device 3000, for example, the ROM 3030 or the hard disk 3070, may store various data or files used for processing and / or communication of the resource management method of the graphics processor according to the present application, and program instructions executed by the CPU. The computing device 3000 may further include a user interface 3080. Of course, the architecture shown in FIG. 11 is merely exemplary, and when implementing a different device, one or more components in the computing device shown in FIG. 12 may be omitted according to actual needs.

[0124] According to another aspect of the present disclosure, there is further provided a computer readable storage medium. Figure 13 shows a schematic diagram 4000 of a storage medium according to the present application.

[0125] As shown in FIG. 13, computer-readable instructions 4010 are stored in the computer storage medium 4020. When the computer-readable instructions 4010 are executed by a processor, the resource management method of the graphics processor according to the embodiments of the present application described with reference to the above drawings can be executed. The computer-readable storage medium according to the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both a volatile memory and a non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM) used as an external cache. By way of non-limiting, illustrative example, many forms of RAM can be used, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM). It should be noted that the memory of the methods described herein is intended to include these and any other suitable types of memory, but is not limited thereto. It should be noted that the memory of the methods described herein is intended to include these and any other suitable types of memory, but is not limited thereto.

[0126] According to an embodiment of the present application, there is further provided a computer program product or computer program comprising computer instructions, the computer instructions being stored in a computer readable storage medium, such that a processor of a computing device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computing device to perform a graphics processor resource management method according to an embodiment of the present application.

[0127] SUMMARY OF THE DISCLOSURE Embodiments of the present application provide a method, apparatus, device, computer-readable storage medium and computer program product for managing resources in a graphics processor.

[0128] Compared to conventional resource management methods for graphics processors, the method according to the embodiment of the present application avoids resource contention among multiple application processes by using the past resource consumption of application processes running on the graphics processor as a reference for resource allocation and adjusting resource allocation in real time based on the amount of resources actually available to each application process.

[0129] The method according to the embodiment of the present application realizes efficient resource allocation for multiple application processes simultaneously executed on the same graphics processor by considering the remaining resources available for these application processes in the past resource allocation and determining a resource allocation method in real time based on the currently available resource amount of the graphics processor resources for these application processes. According to the method according to the embodiment of the present application, the graphics processor resources can be rationally allocated according to the resource demand of each application process, the influence of the contention between multiple application processes is avoided, and the utilization rate of the graphics processor resources is improved.

[0130] It should be noted that the flowcharts and block diagrams in the drawings illustrate possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowcharts or block diagrams may represent a module, program segment, or part of code, which includes at least one executable instruction for implementing a specified logic function. It should be noted that in some alternative implementations, the functions shown in the blocks may occur in a different order from the order shown in the drawings. For example, two blocks shown in succession may actually be executed essentially in parallel or in the reverse order, as determined by the related functionality. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts may be implemented by a system based on dedicated hardware that executes the specified function or operation, or may be implemented by a combination of dedicated hardware and computer instructions.

[0131] In general, various exemplary embodiments of the present application may be implemented in hardware or special purpose circuits, software, firmware, logic, or any combination thereof. Some aspects may be implemented in hardware, and other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device. Although various aspects of the embodiments of the present application have been illustrated and described using block diagrams, flowcharts, or some other graphical representations, it should be understood that these blocks, devices, systems, techniques, or methods described herein may be implemented in, by way of non-limiting examples, hardware, software, firmware, special purpose circuits or logic, general purpose hardware or controller or other computing device, or some combination thereof.

[0132] The exemplary embodiments of the present application as described above in detail are merely exemplary and not limiting. Those skilled in the art can make various modifications and combinations to these embodiments or features thereof without departing from the principles and spirit of the present application, and such modifications should be understood to be within the scope of the present application.

Claims

1. 1. A graphics processor resource management method executed by a graphics processor resource management device, comprising: determining a number of graphics processors for handling application processes; obtaining a plurality of application processes to be processed, and allocating one of the plurality of graphics processors to each of the plurality of application processes; determining, for each of at least one application process assigned to a graphics processor, an amount of remaining resource available for the application process in a current given resource of the graphics processor, the amount of remaining available resource being related to an amount of remaining resource available for the application process in a past given resource of the graphics processor; determining a resource allocation instruction for each of the at least one application process based on a remaining resource amount available to each of the at least one application process in the current predetermined resource, the resource allocation instruction instructing the application process whether or not to perform processing; A resource management method for a graphics processor, wherein the resource allocation instruction is used to cause an amount of remaining resource available to the application process in the current given resource to reach a given target value.

2. each application process of the plurality of application processes has a predefined resource demand weight; The graphics processor resource management method includes: For each application process of the at least one application process, obtaining a remaining resource amount available for the application process in the past predetermined resource, and determining a used resource amount for the application process in the current predetermined resource; The step of determining the remaining amount of resource available to the application process at the current given resource comprises: determining an amount of remaining resource available to the application process on the current given resource based on an amount of remaining resource available to the application process on the past given resource, an amount of used resource of the application process on the current given resource, and a resource demand weight of the application process; 2. The method of claim 1, wherein the resource allocation instruction is used to make a first error of the application process greater than a second error, the first error being an error between a resource demand weight of the application process and a proportion of the resource used by the application process in the past given resource, and the second error being an error between a resource demand weight of the application process and a proportion of the resource used by the application process in the current given resource.

3. the resource amounts included in the past and current predetermined resources of the graphics processor are both predetermined resource amounts; a resource demand weight for each of the plurality of application processes indicates a ratio of an amount of resource required for the application process to the predetermined amount of resource; The step of allocating one of the plurality of graphics processors to each application process of the plurality of application processes comprises: determining an available resource ratio for each of the plurality of graphics processors, the available resource ratio being a proportion of resources available for processing an application process in the graphics processor; determining a graphics processor to be assigned to each application process based on a resource demand weight of each application process of the plurality of application processes and an available resource ratio of each graphics processor of the plurality of graphics processors; 3. The method of claim 2, wherein a sum of resource demand weights of at least one application process assigned to one graphics processor is less than or equal to an available resource ratio of the graphics processor.

4. the resource allocation instruction indicates whether a corresponding application process should transmit a processing task to a corresponding graphics processor for processing by the graphics processor, the processing of the processing task by the graphics processor corresponding to a use of a resource of the graphics processor by the application process; 3. The method of claim 2, wherein determining the amount of resource used by the application process at the current given resource comprises determining a first increment of the amount of resource used by the application process at the current given resource, the first increment corresponding to a previous processing of a processing task from the application process by a graphics processor corresponding to the application process.

5. Determining a first increment of a resource usage amount of the application process at the current given resource includes:

5. The method of claim 4, further comprising: determining a first increment of a used resource amount of the application process in the current predetermined resource based on a processing manner of the processing task by the graphics processor, the processing manner including at least one of synchronous rendering or asynchronous rendering.

6. determining a first increment of a resource usage amount of the application process in the current predetermined resource based on a processing manner of the processing task by the graphics processor, 6. The method of claim 5, further comprising the step of determining the first increment by marking the start and end of the previous processing when a processing method of the processing task by the graphics processor is asynchronous rendering.

7. determining a first increment of a resource usage amount of the application process in the current predetermined resource based on a processing manner of the processing task by the graphics processor, 6. The method of claim 5, further comprising: obtaining the first increment from the graphics processor by using a query instruction when a processing method of the processing task by the graphics processor is synchronous rendering.

8. determining resource allocation instructions for each of the at least one application process based on a remaining amount of resource available to each of the at least one application process in the current predetermined resource, for each application process of the at least one application process, determining that a resource allocation instruction to the application process indicates that no processing should be performed for the application process if an available remaining resource amount in a current predetermined resource corresponding to the application process is equal to or less than zero; and determining a resource allocation instruction for each of the other application processes among the at least one application process, the other application processes having an available remaining resource amount greater than zero, based on a priority of each of the other application processes.

9. a priority of each of the other application processes is associated with a chronological order that determines the length of a processing latency of the application process and its most recent first increment; determining a resource allocation instruction for each application process based on a priority of each of the other application processes, determining a resource allocation instruction for each of the other application processes based on a time order for determining the latest first increment of the application process when there is an application process whose processing waiting time length satisfies a predetermined condition for each of the other application processes; 9. The graphics processor resource management method of claim 8, further comprising: if there is no application process whose processing waiting time length satisfies a predetermined condition, determining a resource allocation instruction for each application process based on a time order of determining the latest first increment of each of the other application processes.

10. 1. A graphics processor resource management method executed by a graphics processor resource management device, comprising: invoking a scheduling process, the scheduling process including an allocation thread and a number of processing threads; determining, by the allocation thread, a number of graphics processors for processing an application process, and allocating one processing thread to each graphics processor of the number of graphics processors; launching a plurality of application processes, each of the plurality of application processes including a scheduling library pre-built by the scheduling process; for each application process of the plurality of application processes, assigning, via a scheduling library of the application process and the allocation thread, to each application process of the plurality of application processes, a graphics processor of the plurality of graphics processors and a corresponding processing thread; and determining, for each application process of at least one application process assigned to one graphics processor, by a processing thread corresponding to the application process, an amount of remaining resource available for the application process in a current predetermined resource of the graphics processor, and determining a resource allocation instruction for the application process, the resource allocation instruction instructing the application process whether or not to perform processing; A resource management method for a graphics processor, wherein the amount of remaining available resource is related to the amount of remaining resource available to the application process in a past specified resource of the graphics processor, and the resource allocation instruction is used to ensure that the amount of remaining resource available to the application process in the current specified resource reaches a specified target value.

11. a processor determination module configured to determine a number of graphics processors for processing an application process; a processor allocation module configured to obtain a plurality of application processes to be processed and to allocate one of the plurality of graphics processors to each application process of the plurality of application processes; a remaining resource determination module configured to determine, for each application process of at least one application process assigned to a graphics processor, an amount of remaining resource available for the application process in a current predetermined resource of the graphics processor, the amount of remaining available resource being related to an amount of remaining resource available for the application process in a past predetermined resource of the graphics processor; a resource allocation module configured to determine a resource allocation instruction for each of the at least one application process based on a remaining resource amount available to each of the at least one application process in the current predetermined resource, the resource allocation instruction instructing the application process whether or not to perform an operation; A resource management device for a graphics processor, wherein the resource allocation instruction is used to ensure that the remaining amount of resource available to the application process in the current specified resource reaches a specified target value.

12. one or more processors; one or more memories; and A graphics processor resource management device, wherein a computer-executable program is stored in the memory, and when the computer-executable program is executed by the processor, the graphics processor resource management method according to any one of claims 1 to 10 is executed.

13. A computer program comprising: A computer program causing a computer to execute the resource management method for a graphics processor according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Method for allocating and scheduling instruction processor, computer system implementing the method, and program therefor

    JP2005018560A

  • Information terminal, computer resource management method, and method for switching execution of virtual machine

    JP2007011491A

  • Virtual machine system having virtual battery and program for the system

    JP2010033207A

  • GPU allocating program, GPU allocation method, computer-readable recording medium, and GPU allocating apparatus

    JP2019121185A

  • Information Terminal, Computer Resource Managine Method, and Virtual Machine Execution Switching Method

    US20080301673A1