WO2023151340A1 - 图形处理器资源管理方法、装置、设备、存储介质和程序产品 - Google Patents
图形处理器资源管理方法、装置、设备、存储介质和程序产品 Download PDFInfo
- Publication number
- WO2023151340A1 WO2023151340A1 PCT/CN2022/132457 CN2022132457W WO2023151340A1 WO 2023151340 A1 WO2023151340 A1 WO 2023151340A1 CN 2022132457 W CN2022132457 W CN 2022132457W WO 2023151340 A1 WO2023151340 A1 WO 2023151340A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- application process
- resources
- resource
- application
- graphics processor
- Prior art date
Links
- 238000012545 processing Methods 0.000 title claims abstract description 141
- 238000007726 management method Methods 0.000 title claims abstract description 66
- 238000000034 method Methods 0.000 claims abstract description 631
- 230000008569 process Effects 0.000 claims abstract description 580
- 238000013468 resource allocation Methods 0.000 claims abstract description 116
- 238000004590 computer program Methods 0.000 claims abstract description 14
- 238000009877 rendering Methods 0.000 claims description 87
- 230000015654 memory Effects 0.000 claims description 24
- 230000001360 synchronised effect Effects 0.000 claims description 13
- 238000003672 processing method Methods 0.000 claims 2
- 238000005516 engineering process Methods 0.000 abstract description 7
- 230000000694 effects Effects 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 40
- 230000006870 function Effects 0.000 description 12
- 238000004891 communication Methods 0.000 description 11
- 230000003044 adaptive effect Effects 0.000 description 8
- 230000003139 buffering effect Effects 0.000 description 6
- 238000004422 calculation algorithm Methods 0.000 description 6
- 238000004364 calculation method Methods 0.000 description 6
- 230000007246 mechanism Effects 0.000 description 4
- 239000000243 solution Substances 0.000 description 4
- 238000002347 injection Methods 0.000 description 3
- 239000007924 injection Substances 0.000 description 3
- 238000002360 preparation method Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 2
- 230000000670 limiting effect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000002829 reductive effect Effects 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000002860 competitive effect Effects 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000006866 deterioration Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000012827 research and development Methods 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000012384 transportation and delivery Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/505—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/30—Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
- A63F13/35—Details of game servers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5072—Grid computing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/509—Offload
Definitions
- the present application relates to the field of cloud technologies, and more specifically, to a graphics processor resource management method, device, device, computer-readable storage medium, and computer program product.
- the cloud game renders the image of the game on the graphics processing unit (GPU) on the cloud server side, and transmits the rendering result to the user's client through the network.
- GPU graphics processing unit
- multiple game processes hosted on the cloud server may share the hardware computing resources of the cloud server, so there will be competition for hardware computing resources. If multiple game processes are running on one GPU at the same time, these game processes will compete for GPU resources and affect the rendering effect. If a separate GPU is provided for each game process, although the rendering quality of each game process can be guaranteed, But this will inevitably cause a serious waste of GPU resources.
- the present application determines the processing order of these task processes in real time according to the resource requirements of each task process and the resource consumption that has occurred, thereby realizing efficient allocation of graphics manager resources.
- Embodiments of the present application provide a graphics processor resource management method, device, device, computer-readable storage medium, and computer program product.
- An embodiment of the present application provides a graphics processor resource management method, including: determining multiple graphics processors for processing application processes; obtaining multiple application processes to be processed, and providing Each application process allocates a graphics processor in the plurality of graphics processors; for each application process in at least one application process allocated to a graphics processor, determining that the application process is in the graphics processor The amount of remaining available resources in the currently reserved resources, the amount of remaining available resources is related to the amount of remaining available resources of the application process in the historical reserved resources of the graphics processor; and based on each of the at least one application process The amount of remaining available resources of an application process in the currently predetermined resource, determining a resource allocation command for each application process in the at least one application process, and the resource allocation command indicates whether to process the application process; Wherein, the resource allocation command is used to make the amount of remaining available resources of the application process in the currently predetermined resources reach a preset target value.
- the embodiment of the present application also provides a graphics processor resource management method, including: starting a scheduling process, the scheduling process includes an allocation thread and a plurality of processing threads; a graphics processor, and assign a processing thread to each graphics processor in the plurality of graphics processors; start a plurality of application processes, and each application process in the plurality of application processes includes a configured scheduling library; for each application process in the plurality of application processes, assign the plurality of application processes to each application process in the plurality of application processes through the scheduling library of the application process and the allocation thread One of the graphics processors and the corresponding processing thread; for each application process in the at least one application process assigned to a graphics processor, the application is determined by the processing thread corresponding to the application process The amount of remaining available resources of a process in the currently reserved resources of the graphics processor, so as to determine a resource allocation command for the application process, and the resource allocation command indicates whether to process the application process; wherein, the remaining The amount of available resources is related to the amount of remaining available resources of the application process in the historical reserved resources
- An embodiment of the present application provides a graphics processor resource management device, including: a processor determination module configured to determine multiple graphics processors that can be used to process application processes; a processor allocation module configured to acquire a plurality of application processes, and assign one of the plurality of graphics processors to each application process in the plurality of application processes; the remaining resource determination module is configured to allocate to a graphics processor For each application process in the at least one application process, determine the remaining available resource amount of the application process in the currently reserved resources of the graphics processor, and the remaining available resource amount is the same as that of the application process in the graphics processor and the resource allocation module is configured to, based on the remaining available resource amount of each application process in the at least one application process in the current predetermined resource, determine the remaining available resource amount for the at least one application process A resource allocation command for each application process in the at least one application process, the resource allocation command indicates whether to process the application process; wherein the resource allocation command is used to make the application process in the current scheduled The remaining available resource amount in the resource reaches the preset target value.
- An embodiment of the present application provides a graphics processor resource management device, including: one or more processors; and one or more memories, where computer executable programs are stored in the one or more memories, and when When the computer-executable program is executed by the processor, the graphics processor resource management method described above is executed.
- An embodiment of the present application provides a computer-readable storage medium, on which computer-executable instructions are stored, and when executed by a processor, the instructions are used to implement the above-mentioned graphics processor resource management method.
- Embodiments of the present application provide a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
- the processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the graphics processor resource management method according to the embodiment of the present application.
- the method provided by the embodiments of the present application uses the past resource consumption of the application process running on the graphics processor as a reference for resource allocation, and uses the actual The amount of available resources is used to adjust resource allocation in real time, thereby avoiding resource competition among multiple application processes.
- the method provided by the embodiments of the present application considers the remaining available resources of these application processes in the historical resource allocation for multiple application processes running simultaneously on the same graphics processor, and based on the current resources of these application processes in the resources of the graphics processor The amount of available resources determines the resource allocation scheme in real time, thereby realizing efficient allocation of graphics manager resources.
- graphics processor resources can be reasonably allocated according to the resource requirements of each application process, the influence of competition among multiple application processes is avoided, and the usage rate of graphics processor resources is improved.
- FIG. 1 is a schematic diagram showing an example of a scenario in which multiple application processes use GPU resources according to an embodiment of the present application;
- FIG. 2A is a flowchart illustrating a method for managing graphics processor resources according to an embodiment of the present application
- FIG. 2B is a schematic flow diagram illustrating a method for managing graphics processor resources according to an embodiment of the present application
- FIG. 2C is a schematic diagram showing a timing sequence of a graphics processor resource management method according to an embodiment of the present application.
- FIG. 3 is a schematic diagram illustrating allocating graphics processors for multiple application processes according to an embodiment of the present application
- FIG. 4A is a schematic diagram illustrating two resource usage situations according to an embodiment of the present application.
- FIG. 4B is a schematic diagram showing resource allocation ratios of multiple application processes according to an embodiment of the present application.
- FIG. 5 is a schematic diagram illustrating an acquisition queue and a processing queue according to an embodiment of the present application
- Fig. 6 is an exemplary schematic diagram illustrating determining a first increment of a used resource amount of an application process in a currently reserved resource according to an embodiment of the present application
- Fig. 7 is a schematic diagram illustrating acquisition and processing of a first increment according to an embodiment of the present application.
- FIG. 8A is a schematic diagram illustrating a double-buffering method of the CPU and the GPU when determining the first increment according to an embodiment of the present application
- FIG. 8B is a schematic diagram illustrating an adaptive buffering method of the CPU and the GPU when determining the first increment according to an embodiment of the present application
- FIG. 9A is a schematic diagram showing a graphics processor resource management method according to an embodiment of the present application.
- FIG. 9B is a schematic diagram illustrating scheduling logic of a graphics processor resource management method according to an embodiment of the present application.
- FIG. 10 is a schematic diagram showing a graphics processor resource management device according to an embodiment of the present application.
- FIG. 11 shows a schematic diagram of a graphics processor resource management device according to an embodiment of the present application.
- Figure 12 shows a schematic diagram of the architecture of an exemplary computing device according to an embodiment of the application.
- Fig. 13 shows a schematic diagram of a storage medium according to an embodiment of the present application.
- the graphics processor resource management method of the present application may be based on cloud technology (Cloud technology).
- the graphic processor resource management method of the present application may be based on cloud gaming (Cloud gaming).
- Fig. 1 is a schematic diagram showing an example of a scenario where GPU resources are used by multiple application processes according to an embodiment of the present application.
- the network can be an Internet of Things (Internet of Things) based on the Internet and/or a telecommunication network, which can be a wired network or a wireless network, for example, it can be a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN) ), cellular data communication network and other electronic networks that can realize the function of information exchange.
- Internet of Things Internet of Things
- a telecommunication network which can be a wired network or a wireless network, for example, it can be a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN) ), cellular data communication network and other electronic networks that can realize the function of information exchange.
- the mobile phone application or computer software on the user terminal can send the control command input by the user to the server, thereby starting the corresponding application process.
- There may be various hardware computing resources on the server for example, central processing unit, communication interface, memory, and so on.
- GPU resources shown in Figure 1 as an example, there are multiple GPUs (e
- the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or it can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services Cloud servers for basic cloud computing services such as cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
- the user terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto.
- the user terminal and the server may be connected directly or indirectly through wired or wireless communication, which is not limited in this application.
- a networked game application usually relies on the GPU on the cloud server to synthesize the game screen displayed by the user terminal or perform hardware encoding.
- Such game applications are also called cloud games (also called “cloud games”). Game On Demand”).
- the user terminal can transmit the data of the user's game operation to the cloud server through the control stream, and the cloud server transmits one or more audio frames and video frames to the user terminal through the data stream.
- cloud gaming games are stored, synchronized and presented in remote cloud servers, and delivered to players using streaming technology, which is a completely different type of online gaming service from the past.
- the cloud server runs the game, renders 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 command is sent to the cloud server.
- cloud gaming transfers the computing load of the game from the client to the cloud, thereby releasing its constraints on the player's device.
- cloud gaming also allows players to start the game immediately without spending time on downloading and installing the game client. Due to these advantages, cloud gaming has attracted great attention from academia and industry.
- the cloud server is responsible for the interpretation of player input, the execution of game code and the rendering of graphics, and transmits the game scene to the client through the network, while the client is responsible for decoding and displaying the game scene to the player, capturing and sending the game player's view in real time.
- the cloud server in the process of the cloud server using the GPU to perform graphics rendering, due to the limited hardware computing resources of the GPU, in the cloud server that provides cloud games, multiple virtual entities hosted on the cloud server may share the hardware computing resources of the cloud server , so there will be competition for hardware computing resources.
- GPU hardware renders the rendering requests provided by all game processes on it according to the principle of first-come-first-served rendering, and the increase of the rendering load of a single game process will affect the normal rendering of other game processes. For example, in the case of any game process rendering timeout, other game processes are forced to shorten the rendering time, resulting in low rendering quality, and this deterioration of rendering quality may gradually accumulate as the rendering process progresses, seriously affecting the user's game experience.
- the present application provides a graphics processor resource management method, which determines the processing order of these task processes in real time according to the resource requirements of each task process and the resource consumption that has occurred, thereby realizing the graphics manager. Efficient allocation of resources.
- the method provided by the embodiments of the present application uses the past resource consumption of the application process running on the graphics processor as a reference for resource allocation, and uses the actual The amount of available resources is used to adjust resource allocation in real time, thereby avoiding resource competition among multiple application processes.
- the method provided by the embodiments of the present application considers the remaining available resources of these application processes in the historical resource allocation for multiple application processes running simultaneously on the same graphics processor, and based on the current resources of these application processes in the resources of the graphics processor The amount of available resources determines the resource allocation scheme in real time, thereby realizing efficient allocation of graphics manager resources.
- the resources of the graphics processor can be reasonably allocated according to the resource requirements of each application process, the influence of competition among multiple application processes is avoided, and the usage rate of the resources of the graphics processor is improved.
- FIG. 2A is a flowchart illustrating a graphics processor resource management method 200 according to an embodiment of the present application.
- FIG. 2B is a schematic block diagram illustrating a method for managing graphics processor resources according to an embodiment of the present application.
- FIG. 2C is a schematic diagram showing a timing sequence of a graphics processor resource management method according to an embodiment of the present application.
- a plurality of graphics processors for processing application processes may be determined.
- the resource management of the GPU can be coordinated between the application process and the scheduling service as shown in FIG. 2C , wherein the application process part corresponds to the execution of the application process (for example, a game instance) in the GPU resource management process. operation, and the scheduling service part corresponds to the GPU resource management scheduling operation for the corresponding application process.
- the application process can be various application processes such as game process, video process and conference process, etc.
- the game process developed by graphics engines such as OpenGL (Open Graphics Library, Open Graphics Library) is used as an example
- OpenGL Open Graphics Library, Open Graphics Library
- the allocation thread in the scheduling service can first determine the multiple GPUs that are currently available for processing the application process, and create corresponding processing threads for these GPUs in the scheduling service, and then for each Resource allocation management of a GPU can be performed on its corresponding processing thread.
- the determined GPU should have the ability to perform certain rendering calculations.
- the GPU resource management method of this application is also applicable to the processing of other application processes, for example, it can be applied to video processes and conference processes
- the processing may be processing the image rendering of the video image, or may be processing the image rendering of the conference image.
- step 202 a plurality of application processes to be processed may be obtained, and one graphics processor among the plurality of graphics processors is assigned to each application process in the plurality of application processes.
- the server can register the corresponding application process for it, including but not limited to assigning each application process a GPU for its graphics rendering processing, and returning the registration information to the To the application process, information such as the index of the allocated GPU and its corresponding processing thread.
- the application process's request for GPU resources can also be forwarded to different GPUs for execution, so that multiple GPUs can be A GPU is virtualized to implement application process processing in this case.
- more than one application process may be allocated to the same GPU, that is, the processing tasks of more than one application process may be executed on the same GPU at the same time, under the condition that the computing performance limit of the GPU is guaranteed.
- FIG. 3 is a schematic diagram illustrating allocating graphics processors to multiple application processes according to an embodiment of the present application.
- the application processes A and C are allocated to the GPUs 1 for processing, application process B is assigned to GPU 2 for processing, and GPU C may not be assigned to perform any application process processing. Therefore, for the application processes A and C running together on the GPU 1, these application processes can share the computing resources on the GPU 1, so the resource usage of these application processes may also have a competitive relationship, which can be avoided by the GPU resource management method of the present application. Competing effects between these application processes.
- each application process in the plurality of application processes may have a predetermined resource requirement weight.
- the resource requirement weight of each application process may be determined based on the amount of GPU resources required for its calculation, and the resource requirement weight may be predetermined and notified to the scheduling service during registration.
- the corresponding resource requirement weight can be determined in advance based on the complexity and calculation amount of the screen rendering.
- the weight can be the proportion required for the screen rendering of the game instance in unit GPU resources, for example, in If the screen rendering of a game instance requires 200ms in 1s of GPU hardware computing time, the resource requirement weight of the game instance can be 0.2 (200ms/1s).
- assigning one of the multiple graphics processors to each of the multiple application processes in step 202 may include: determining one of the multiple graphics processors The available resource ratio of each graphics processor, where the available resource ratio is the ratio of resources available for processing application processes in the graphics processor; and based on the resource requirement weight of each application process in the plurality of application processes and An available resource ratio of each graphics processor in the plurality of graphics processors determines a graphics processor allocated to each application process.
- each GPU in the plurality of GPUs is a GPU currently available for processing application processes, but the amount of computing resources available in these GPUs is not necessarily equal and not necessarily equal to the amount of computing resources of all of them.
- the amount of available resources of the GPU can be expressed by its available resource ratio, which can represent the proportion of the amount of resources available for processing application processes in the GPU to its unit resources, for example , in 1s GPU hardware computing time, the time available for processing the application process is 0.8s, then the available resource ratio of the GPU can be 0.8.
- the GPU allocation to the application process can be jointly determined based on the resource requirement weight of each application process and the available resource ratio of each GPU.
- the sum of resource requirement weights of at least one application process allocated to one graphics processor is not greater than the ratio of available resources of the graphics processor.
- the sum of the resource requirement weights of the application processes allocated to it for processing cannot be greater than the available resource ratio of the GPU, that is, the amount of resources actually used for processing application processes in the GPU cannot be greater than the expected amount of resources.
- step 203 for each application process in at least one application process allocated to a graphics processor, the remaining available resource amount of the application process in the currently reserved resources of the graphics processor may be determined, the remaining The amount of available resources may be related to the amount of remaining available resources of the application process in the historical predetermined resources of the graphics processor.
- the resource amounts included in the historical reserved resources and the current reserved resources of the graphics processor respectively may be predetermined resource amounts.
- the amount of resources respectively contained in the historical reserved resource and the current reserved resource may be the above-mentioned unit GPU resource, and the historical reserved resource is a resource reserved by the application process before the currently reserved resource.
- the usage of unit GPU resources can be used to determine the usage rate of the GPU (the ratio of the actual working time of the GPU to the running time), so the allocation of GPU resources in this application can be based on the allocation of unit GPU resources.
- the unit GPU resource may be a calculation time of unit length, such as 1 second or 1 frame time described above, which is not limited in the present application.
- the resource requirement weight of each application process in the plurality of application processes may indicate a proportion of the resource amount required by the application process in the predetermined resource amount.
- the resource requirement weight of the application process may be the resource ratio required by the processing of the application process in unit GPU resources.
- the current resource allocation can be determined based on the historical state of resource allocation to the application process.
- the historical state may include the remaining resource amount of the application process in the historical resource allocation, that is, the resource amount that can be used but not used by it.
- the existence of the remaining available resources may be due to the resource occupation of the application process due to the processing timeout of other application processes. Such resource occupation may cause the rendering effect of the application process to be poor. Therefore, in order to avoid the accumulation of such resource occupation , corresponding adjustments can be made in the subsequent resource allocation, for example, the available resource amount of the application process in the current resource allocation can be associated with the remaining available resource amount in the historical resource allocation.
- determining the remaining available resources of the application process in the current reserved resources in step 203 may include: based on the remaining available resources of the application process in the historical reserved resources, the The amount of resources used by the application process in the currently reserved resources and the resource demand weight of the application process are used to determine the remaining available resource amount of the application process in the currently reserved resources.
- the total amount of available resources of the application process in the current reserved resources can be determined.
- the amount of used resources in the reserved resources can determine its remaining available resources in the current reserved resources, that is, the current reserved resources can be obtained by subtracting the used resources in the currently reserved resources from the total amount of available resources in the currently reserved resources The amount of remaining available resources in .
- the current resource allocation can be adjusted based on the error in the historical resource allocation to reduce or even eliminate the resource allocation error . For example, in the case that the remaining available resources of an application process in the historical scheduled resources are less than zero, by subtracting the remaining available resources of the application process in the historical scheduled resources from the remaining available resources of the application process in the current scheduled resources The absolute value of the amount can effectively reduce the resource allocation error.
- the graphics processor resource management method 200 may further include: for each application process in the at least one application process, acquiring the remaining available resources of the application process in the historical predetermined resources amount, and determine the amount of resources used by the application process in the currently reserved resources.
- the amount of resources used by the application process in the currently scheduled resource may include the amount of resources used by the application process in the previous resource allocation and the amount of resources used in the earlier resource allocation to the current scheduled resource, wherein, The amount of resources used by the application process in the previous resource allocation corresponds to the computing resources used by the application process in the latest processing.
- determining the amount of used resources of the application process in the currently scheduled resources may include determining a first increment of the amount of used resources of the application process in the currently scheduled resources, the first increment It may correspond to the previous processing of the processing task from the application process by the graphics processor corresponding to the application process.
- the first increment may correspond to the time when the GPU performed the rendering processing of the game instance last time, as shown in FIG. 2C , the rendering time may be obtained by the application process, and through The scheduling library is set to notify the scheduling service, so that the scheduling service processes the rendering time based on the rendering time, including determining the amount of remaining available resources of the application process in the currently scheduled resources.
- the scheduling service can jointly determine the current resource allocation plan, and notify the application process whether to render, and the application process waits during this period Rendering notifications from the scheduling service, as shown in Figure 2C. Therefore, obtaining the remaining available resources of each application process, especially obtaining the first increment of each application process is very important for the GPU resource management of this application, which can effectively reduce allocation errors.
- FIG. 6 and FIG. 7 For the manner of obtaining the first increment, reference may be made to the relevant descriptions in FIG. 6 and FIG. 7 below, which will not be described in detail here.
- a resource allocation command for each application process in the at least one application process may be determined based on the remaining available resource amount of each application process in the at least one application process in the current predetermined resource , the resource allocation command indicates whether to process the application process.
- step 204 may include: for each application process in the at least one application process, when the amount of remaining available resources of the application process in the currently scheduled resources is not greater than zero, determining that the resource allocation command for the application process indicates not to process the application process; and for other application processes in the at least one application process whose remaining available resources are greater than zero, based on each application in the other application processes The priority of the process determines the resource allocation command for each application process.
- resources may not be allocated to it in the currently reserved resources, so as not to affect the processing of other application processes.
- it may be considered to continue to allocate GPU computing resources to these application processes.
- the allocation of resources to the application processes can be based on the priority of the application processes, rather than just based on the previously described first-come, first-served competition model.
- the priority of each application process among the other application processes may be related to the length of time the application process waits to be processed and the time order in which the latest first increment thereof is determined. For example, for pending application processes that are about to freeze the screen, etc., their priority can be set higher so that they can be processed first; and for processing opportunities that do not have such an emergency situation, it can be based on the information obtained from these application processes.
- the time order of the first increment is used to determine its priority. For example, the application process that first obtains its first increment and whose remaining available resources in the current scheduled resources is greater than zero can be prioritized.
- determining a resource allocation command for each application process based on the priority of each application process in the other application processes may include: for each application process in the other application processes, when there is In the case of an application process whose length of time waiting to be processed satisfies a predetermined condition, determining a resource allocation command to the application process based on the chronological order of determining the latest first increment of the application process; and when there is no waiting to be processed In the case of the application process whose processing time satisfies the predetermined condition, the resource allocation command for each application process is determined based on the time sequence of determining the latest first increment of each application process in the other application processes.
- the following factors can be considered (including but not limited to) for the priority setting of application processes: 1
- the amount of remaining available resources can be set to low for the application processes whose remaining available resources in the current scheduled resources are not greater than zero.
- Priority indicate not to execute
- 2 Urgency, you can assign high priority to the application process that needs to be processed urgently, for example, the screen display is about to freeze or other emergencies
- 3 The order of the first increment can be obtained first
- the application process of the first increment is assigned a higher priority, so that the allocation of GPU resources is more continuous, thereby improving the utilization rate of GPU resources. It should be understood that, when setting the priority for processing application processes, the method of the present application may also consider other various factors, and the factors listed above are only used as examples and not limitations.
- the resource allocation command indicates whether the corresponding application process will send a processing task to the corresponding graphics processor to be processed by the graphics processor, wherein the graphics processor is responsible for the processing task
- the processing of corresponds to usage of resources of the graphics processor by the application process.
- the GPU resource management of the present application controls the sending of processing tasks by these application processes by evaluating the resource usage of the GPU hardware resources by each application process.
- FIG. 2B takes a graphics rendering task as an example.
- GPU resource management can control the delivery of rendering instructions by each application process through resource allocation commands.
- each application process may determine whether to send a processing task to the corresponding GPU according to the received resource allocation command (for example, deliver the rendering instruction to the GPU rendering instruction queue in FIG. 2B ), and the execution of the processing task by the GPU will be Consuming a certain amount of GPU hardware resources, the certain amount of computing resources may correspond to the first increment of the application process referred to in the next resource allocation.
- the resource allocation command may be used to make the amount of remaining available resources of the application process in the currently reserved resources reach a preset target value.
- the resource allocation command can reduce errors in resource allocation to each application process.
- the preset target value is a pre-set value that needs to be achieved by the amount of remaining available resources, and can be set according to requirements. For example, it can be set to zero, so that the amount of remaining available resources approaches zero, so as to save resources.
- FIG. 4A is a schematic diagram illustrating two resource usage situations according to an embodiment of the present application.
- the application process has been unable to use the currently scheduled resources No resources are used any more, so no resources are allocated to the application process from the currently scheduled resources, so that the amount of remaining available resources does not continue to decrease.
- the resource allocation command is used to make the resources used by the application process in the current scheduled resources compared with the resource ratio used by the application process in the historical scheduled resources
- the scale is closer to the resource requirement weight of the application process. That is, the resource allocation command is used to make the first error of the application process greater than the second error, and the first error refers to the resource demand weight of the application process and the historical predetermined resource used by the application process
- the second error refers to an error between the resource demand weight of the application process and the resource proportion used by the application process in the currently scheduled resources.
- Fig. 4B is a schematic diagram showing resource allocation ratios of multiple application processes according to an embodiment of the present application.
- the resource requirement weights of the three application processes A, B, and C are 0.5, 0.2, and 0.3, respectively.
- application process A used more resources than its scheduled resource requirements (58%), resulting in insufficient resources for the other two application processes B and C (respectively 17% and 25%, both less than their scheduled resources The proportion of resources corresponding to the weight).
- the amount of remaining available resources of the application process A in the historical reserved resources is less than zero (for example, -0.08 in the example in FIG.
- the resource amount used by the application process in the currently scheduled resource can be closer to the expected resource amount, that is, the resource demand weight of the application process corresponding resource requirements. Therefore, on-demand resource allocation to application processes and efficient utilization of GPU resources can be realized.
- FIG. 5 is a schematic diagram illustrating an acquisition queue and a processing queue according to an embodiment of the present application.
- the acquisition queue inserts multiple new rendering time data sequentially through input events, and the processing queue performs rendering time processing during this period, and can exchange with the acquisition queue after the processing is completed, making the acquisition queue a new The processing queue, and the processing queue becomes a new acquisition queue, and the timing allocation of time is realized through the alternation of the queues.
- the method of obtaining the first increment may also change accordingly.
- the manner of determining the first increment may be determined based on the processing manner of the graphics processor for the processing task, and the processing manner may include at least one of synchronous rendering or asynchronous rendering A sort of.
- the above-mentioned first increment of determining the amount of resources used by the application process in the current predetermined resource may be performed by one of the following: by starting the previous processing and end marking, to estimate the first increment; or obtain the first increment from the graphics processor by using a query instruction.
- the determination of the first increment may be completed by intercepting a GPU hardware queue by using a signal.
- the above-mentioned first increment of determining the amount of resources used by the application process in the currently reserved resources may be marked by marking the start and end of the previous processing, to estimate the first increment.
- Fig. 6 is an exemplary schematic diagram illustrating determining a first increment of a used resource amount of an application process in a currently reserved resource according to an embodiment of the present application.
- the actual time consumption of rendering may be determined by calculating the execution time of the drawing function, and the actual time consumption of rendering may be used as the first increment of the amount of resources used in the currently scheduled resources.
- the execution time of the drawing function may include the preparation time and the actual rendering time.
- the transmission of the drawing function through the PCI-E channel and the preparation for rendering include the execution of rendering instructions, and the actual rendering time
- the command signal F can be inserted before and after the drawing command, so as to inform the application process (or scheduling service) to start or end the timing when the signal F is triggered.
- the determination of the first increment may be performed locally on the application thread through a query.
- the above-mentioned first increment for determining the amount of resources used by the application process in the currently reserved resources may be obtained from the graphics processor by using a query instruction. first increment.
- Fig. 7 is a schematic diagram illustrating acquisition and processing of a first increment according to an embodiment of the present application.
- a query operation may be sent to the GPU in a query manner, and the query operation may determine the time between two specified query points through the GPU.
- “Start Query” and “End Query” are two specified query points inserted in the GPU respectively, to query the GPU time spent by the execution of the drawing function of the rendering instruction in between, that is, the rendering time, where the insertion
- the first "End Query” point of the query was discarded because it could not know where its corresponding "Start Query” point was inserted.
- the gray box part in Figure 7 indicates that the GPU resource management process is executed based on the obtained rendering time, that is, the dispatching service is notified of the obtained rendering time and then waits for the dispatching service to notify the rendering, and the dispatching service executes the rendering time processing and notifies through the event way to send rendering notifications (that is, resource allocation commands) to the application process.
- the GPU resource management method of the present application can use the time of the CPU to execute rendering instructions to offset the time of the GPU to prepare query results.
- FIG. 8A is a schematic diagram illustrating a double-buffering method of the CPU and the GPU when determining the first increment according to an embodiment of the present application.
- the indexes of CPU and GPU indicate their respective processing order, where the processing of CPU 2 corresponds to the query time of GPU 1, and the processing of CPU 3 corresponds to the query time of GPU 2.
- the GPU management method of the present application can also solve the foregoing problems based on an adaptive buffering mechanism .
- FIG. 8B is a schematic diagram illustrating an adaptive buffering method of a CPU and a GPU when determining a first increment according to an embodiment of the present application.
- the double buffering mechanism can still be used, but in the case that the previous drawing cannot be queried, it is not necessary to end this query until it is determined that the previous drawing must be completed, during which multiple drawing calls can be made .
- the adaptive buffer method expands the number of draw calls in the query, and expands the single draw call of the query to multiple random calls.
- the system accuracy may be reduced. This is because there may be cross-rendering between different application processes, and the GPU can only read the time of the current query point and cannot distinguish between different application processes, resulting in inaccurate queries.
- the rendering instruction buffer can be forced to be flushed asynchronously at the end of the GPU query, which will generate a large number of fast draws, and such draws can be quickly obtained without using the adaptive buffer method.
- Rendering time results on the GPU, but this also results in a communication overhead.
- a Monte Carlo algorithm can be used, which combines the basic algorithm of the double buffer method and the adaptive algorithm, and obtains a better solution (relative to the optimal solution) through a statistical method of probability theory.
- the degradation of the adaptive algorithm to the double-buffered underlying algorithm can be limited by the number of draw calls or the system runtime, where lower values of these parameters may lead to poor communication performance, while higher values may increase the communication between multiple application processes. Therefore, the rationality of the system can be further guaranteed by using the Monte Carlo algorithm.
- FIG. 9A is a schematic diagram illustrating a graphics processor resource management method 300 according to an embodiment of the present application.
- the graphics processor resource management method 300 may include two operations performed by a scheduling process and an application process respectively.
- the graphics processor resource management method 300 may mainly include the following steps, where the numbers of each step correspond to the reference numerals in FIG. 9A .
- Start a scheduling process which may include an allocation thread and a plurality of processing threads.
- the scheduling process may include one allocation thread and multiple processing threads, wherein the allocation thread may be used for allocation of GPUs and application processes and distribution of messages, and the processing thread may be used for GPU rendering time processing.
- multiple GPUs that are currently available for processing application processes can be determined for subsequent management of resource allocation for each GPU.
- the scheduling process can allocate three processing threads 1, 2, and 3 for the rendering time processing of the three GPUs respectively. Therefore, the subsequent resource allocation of each GPU can be Executed by the corresponding processing thread.
- the scheduling library can be shared among the multiple application processes, and the information interaction between the application process and the scheduling process can be realized through the scheduling library.
- the scheduling library can send the information of the application process to the scheduling process for registration, and the registration operation of the application process is a synchronous operation.
- the application process can continue to send messages after registration, and the scheduling process can notify the processing of the application process through shared events.
- three application processes can be assigned GPUs for their graphics rendering processing, for example, application processes 1 and 2 are assigned to perform graphics rendering on GPU 1, and application process 3 is assigned to perform graphics on GPU 3. rendering, while GPU 2 is not allocated for the processing of these three application processes.
- corresponding registration information may be returned to each application process, such as information such as the index of the allocated GPU and its corresponding processing thread.
- the above-mentioned rendering processing operations of the scheduling service can be performed by corresponding processing threads in the scheduling process, for example, the processing thread 1 corresponding to GPU 1 can process the rendering time of application processes 1 and 2, including determining when the two application processes are A corresponding resource allocation command is determined based on the remaining available resources in the currently reserved resources of the two application processes in the currently reserved resources.
- each application process determines whether to send a processing task to the corresponding GPU based on the resource allocation command for processing by the GPU.
- the manner of obtaining the first increment is different based on the manner in which the GPU processes the processing task.
- the first increment can be estimated by the scheduling library directly from the GPU through signal interception; in the case of synchronous rendering, the first increment can be obtained by the scheduling library from the GPU through query instructions , that is, return along the original path from the GPU to the scheduling library.
- the amount of remaining available resources is related to the amount of remaining available resources of the application process in the historical predetermined resources of the graphics processor, and the resource allocation command is used to make the application process in the The remaining available resources in the currently scheduled resources reach the preset target value.
- the resource amount used by the application process in the currently scheduled resource can be closer to the expected resource amount, that is, the resource demand weight of the application process corresponding resource requirements. Therefore, on-demand resource allocation to application processes and efficient utilization of GPU resources can be realized.
- FIG. 9B is a schematic diagram showing the scheduling logic of the graphics processor resource management method according to the embodiment of the present application.
- the graphics processor resource management method of the present application may involve three runtime libraries based on the current design of a common graphics system, which are respectively client injection (SchedulingClient), scheduling service (SchedulingService) and scheduling logic (Scheduling) .
- client injection and scheduling service only handles function injection and external event communication, and the core logic lies in the scheduling logic.
- various functions eg, ResourceScheduling, SchedulingProtocol, etc.
- FIG. 9B can be called to determine resource allocation commands for each application process by collecting and calculating rendering time and calculating whether to render based on the rendering time.
- FIG. 10 is a schematic diagram showing a graphics processor resource management apparatus 1000 according to an embodiment of the present application.
- the graphics processor resource management apparatus 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 .
- the processor determining module 1001 may be configured to determine multiple graphics processors available for processing application processes.
- the processor determining module 1001 may perform the operations described in step 201 above.
- the application process may be various application processes such as a game process, a video process, and a conference process.
- the determined GPU should be The computing power of the GPU.
- the processor allocation module 1002 may be configured to acquire multiple application processes to be processed, and allocate one graphics processor among the multiple graphics processors to each application process in the multiple application processes.
- the processor allocation module 1002 may perform the operations described above in relation to step 202 .
- the server may register corresponding application processes for each user terminal, including allocating GPUs for graphics rendering processing to each application process.
- more than one application process can be assigned to the same GPU, that is, the processing tasks of more than one application process can be executed on the same GPU at the same time, but the load assigned to the GPU cannot exceed this Computational performance limitations of GPUs.
- the remaining resource determining module 1003 may be configured to, for each application process in at least one application process allocated to a graphics processor, determine the amount of remaining available resources of the application process in the currently reserved resources of the graphics processor, The remaining available resource amount is related to the remaining available resource amount of the application process in the historical reserved resources of the graphics processor.
- the remaining resource determining module 1003 may perform the operations described above in relation to step 203 .
- the current resource allocation can be adjusted based on the error in the historical resource allocation to reduce or even eliminate the resource allocation error .
- the resource allocation module 1004 may be configured to determine the resources for each application process in the at least one application process based on the remaining available resource amount of each application process in the at least one application process in the currently predetermined resources An allocation command, where the resource allocation command indicates whether to process the application process. Wherein, the resource allocation command is used to make the amount of remaining available resources of the application process in the currently predetermined resources reach a preset target value.
- the resource allocation module 1004 may perform the operations described above in relation to step 204 .
- the resource amount used by the application process in the currently scheduled resource can be closer to the expected resource amount, that is, the resource demand weight of the application process corresponding resource requirements. Therefore, on-demand resource allocation to application processes and efficient utilization of GPU resources can be realized.
- each application process in the plurality of application processes has a predetermined resource requirement weight
- the device further includes:
- the used resource determination module is configured to, for each application process in the at least one application process, obtain the remaining available resource amount of the application process in the historical predetermined resources, and determine that the application process has the amount of used resources in the reserved resources;
- the remaining resource determination module is further configured to be based on the amount of remaining available resources of the application process in the historical reserved resources, the amount of used resources of the application process in the current reserved resources, and the application The resource requirement weight of the process determines the amount of remaining available resources of the application process in the currently scheduled resources;
- the resource allocation command is used to make the first error of the application process larger than the second error
- the first error refers to the difference between the resource demand weight of the application process and the historical predetermined resources of the application process.
- An error of the proportion of resources used refers to an error between the resource demand weight of the application process and the proportion of resources used by the application process in the currently scheduled resources.
- the resource allocation command indicates whether the corresponding application process will send a processing task to the corresponding graphics processor for processing by the graphics processor, wherein the graphics processor is responsible for the processing task processing usage of resources of the graphics processor corresponding to the application process;
- the used resource determining module is further configured to determine a first increment of the amount of used resources of the application process in the currently scheduled resource, the first increment corresponds to the resource corresponding to the application process The previous processing of the processing task from the application process by the graphics processor.
- the resource allocation module is further configured to, for each application process in the at least one application process, if the amount of remaining available resources among the currently reserved resources corresponding to the application process is not greater than zero , determining that the resource allocation command to the application process indicates not to process the application process; and for other application processes in the at least one application process whose remaining available resources are greater than zero, based on each of the other application processes The priority of the application process determines the resource allocation order for each application process.
- the priority of each of the other application processes is related to the length of time the application process waits to be processed and the chronological order in which its latest first increment is determined;
- the resource allocation module is further configured to, for each application process in the other application processes, if there is an application process whose waiting time to be processed satisfies a predetermined condition, based on determining the latest first Incremental chronological order to determine the resource allocation command for the application process; and in the case that there is no application process waiting for the length of time to be processed to meet the predetermined condition, based on determining each application process in the other application processes The chronological order of the latest first increment is used to determine the resource allocation commands for each application process.
- FIG. 11 shows a schematic diagram of a GPU resource management device 2000 according to an embodiment of the present application.
- 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 codes, and when the computer-readable codes are executed by the one or more processors 2010, the above-mentioned graphics processor resource management method can be executed.
- the processor in the embodiment of the present application may be an integrated circuit chip, which has a signal processing capability.
- the above-mentioned processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
- DSP digital signal processor
- ASIC application-specific integrated circuit
- FPGA off-the-shelf programmable gate array
- Various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed.
- the general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc., and may be of an X86 architecture or an ARM architecture.
- the various example embodiments of the present application may be implemented in hardware or special purpose circuits, software, firmware, logic, or any combination thereof. Certain aspects may be implemented in hardware, while other aspects may be implemented in firmware or software, which may be executed by a controller, microprocessor or other computing device.
- aspects of the embodiments of the present application are illustrated or described as block diagrams, flowcharts, or using some other graphical representation, it will be understood that the blocks, devices, systems, techniques, or methods described herein may serve as non-limiting Examples are implemented in hardware, software, firmware, special purpose circuits or logic, general purpose hardware or controllers or other computing devices, or some combination thereof.
- computing device 3000 may include bus 3010, one or more CPUs 3020, read only memory (ROM) 3030, random access memory (RAM) 3040, communication ports 3050 connected to a network, input/output components 3060, hard disk 3070, etc.
- the storage device in the computing device 3000 such as the ROM 3030 or the hard disk 3070, can store various data or files used in the processing and/or communication of the graphics processor resource management method provided in the present application and program instructions executed by the CPU.
- Computing device 3000 may also include user interface 3080 .
- the architecture shown in FIG. 11 is only exemplary, and one or more components in the computing device shown in FIG. 12 may be omitted according to actual needs when implementing different devices.
- FIG. 13 shows a schematic diagram 4000 of a storage medium according to the present application.
- a computer-readable storage medium in embodiments of the present application may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.
- the nonvolatile memory can be read only memory (ROM), programmable read only memory (PROM), erasable programmable read only memory (EPROM), electrically erasable programmable read only memory (EEPROM), or flash memory.
- Volatile memory can be random access memory (RAM), which acts as external cache memory.
- RAM Static Random Access Memory
- DRAM Dynamic Random Access Memory
- SDRAM Synchronous Dynamic Random Access Memory
- DDRSDRAM Double Data Rate Synchronous Dynamic Random Access Memory
- ESDRAM Enhanced Synchronous Dynamic Random Access Memory
- SLDRAM Synchronous Linked Dynamic Random Access Memory
- DRRAM Direct Memory Bus Random Access Memory
- Embodiments of the present application also provide a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
- the processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the graphics processor resource management method according to the embodiment of the present application.
- Embodiments of the present application provide a graphics processor resource management method, device, device, computer-readable storage medium, and computer program product.
- the method provided by the embodiments of the present application uses the past resource consumption of the application process running on the graphics processor as a reference for resource allocation, and uses the actual The amount of available resources is used to adjust resource allocation in real time, thereby avoiding resource competition among multiple application processes.
- the method provided by the embodiments of the present application considers the remaining available resources of these application processes in the historical resource allocation for multiple application processes running simultaneously on the same graphics processor, and based on the current resources of these application processes in the resources of the graphics processor The amount of available resources determines the resource allocation scheme in real time, thereby realizing efficient allocation of graphics manager resources.
- graphics processor resources can be reasonably allocated according to the resource requirements of each application process, the influence of competition among multiple application processes is avoided, and the usage rate of graphics processor resources is improved.
- each block in the flowchart or block diagram may represent a module, program segment, or part of code that includes at least one Executable instructions.
- the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
- each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
- the various example embodiments of the present application may be implemented in hardware or special purpose circuits, software, firmware, logic, or any combination thereof. Certain aspects may be implemented in hardware, while other aspects may be implemented in firmware or software, which may be executed by a controller, microprocessor or other computing device.
- aspects of the embodiments of the present application are illustrated or described as block diagrams, flowcharts, or using some other graphical representation, it will be understood that the blocks, devices, systems, techniques, or methods described herein may serve as non-limiting Examples are implemented in hardware, software, firmware, special purpose circuits or logic, general purpose hardware or controllers or other computing devices, or some combination thereof.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Mathematical Physics (AREA)
- Processing Or Creating Images (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
Claims (18)
- 一种图形处理器资源管理方法,由图形处理器资源管理设备执行,包括:确定用于处理应用进程的多个图形处理器;获取待处理的多个应用进程,并为所述多个应用进程中的每个应用进程分配所述多个图形处理器中的一个图形处理器;对于向一个图形处理器分配的至少一个应用进程中的每个应用进程,确定所述应用进程在所述图形处理器的当前预定资源中的剩余可用资源量,所述剩余可用资源量与所述应用进程在所述图形处理器的历史预定资源中的剩余可用资源量相关;以及基于所述至少一个应用进程中的每个应用进程在所述当前预定资源中的剩余可用资源量,确定对所述至少一个应用进程中的每个应用进程的资源分配命令,所述资源分配命令指示是否对所述应用进程进行处理;其中,所述资源分配命令用于使所述应用进程在所述当前预定资源中的剩余可用资源量达到预设目标值。
- 如权利要求1所述的方法,其中,所述多个应用进程中的每个应用进程具有预定的资源需求权重,所述方法还包括:对于所述至少一个应用进程中的每个应用进程,获取所述应用进程在所述历史预定资源中的剩余可用资源量,并且确定所述应用进程在所述当前预定资源中的已使用资源量;其中,所述确定所述应用进程在所述当前预定资源中的剩余可用资源量包括:基于所述应用进程在所述历史预定资源中的剩余可用资源量、所述应用进程在所述当前预定资源中的已使用资源量、以及所述应用进程的资源需求权重,确定所述应用进程在所述当前预定资源中的剩余可用资源量;其中,所述资源分配命令用于使所述应用进程的第一误差大于第二误差,所述第一误差是指所述应用进程的资源需求权重与所述应用进程在所述历史预定资源中所使用的资源比例的误差,所述第二误差是指所述应用进程的资源需求权重与所述应用进程在所述当前预定资源中所使用的资源比例的误差。
- 如权利要求2所述的方法,其中,图形处理器的历史预定资源和当前预定资源分别包含的资源量均为预定资源量;所述多个应用进程中的每个应用进程的资源需求权重指示所述应用进程在所述预定资源量中所需的资源量的比例;其中,为所述多个应用进程中的每个应用进程分配所述多个图形处理器中的一个图形处理器包括:确定所述多个图形处理器中的每个图形处理器的可用资源比,所述可用资源比为所述图形处理器中可用于处理应用进程的资源比例;以及基于所述多个应用进程中的每个应用进程的资源需求权重以及所述多个图形处理器中的每个图形处理器的可用资源比,确定为每个应用进程分配的图形处理器;其中,向一个图形处理器分配的至少一个应用进程的资源需求权重之和不大于所述图形处理器的可用资源比。
- 如权利要求2所述的方法,其中,所述资源分配命令指示对应的应用进程是否要向对应的图形处理器发送处理任务以由所述图形处理器进行处理,其中,所述图形处理器对所述处理任务的处理对应于所述应用进程对所述图形处理器的资源的使用;其中,确定所述应用进程在所述当前预定资源中的已使用资源量,包括:确定所述应用进程在所述当前预定资源中的已使用资源量的第一增量,所述第一增量对应于与所述应用进程相对应的图形处理器对来自所述应用进程的处理任务的前一次处理。
- 如权利要求4所述的方法,其中,所述确定所述应用进程在所述当前预定资源中的已使用资源量的第一增量,包括:基于所述图形处理器对所述处理任务的处理方式确定所述应用进程在所述当前预定资源中的已使用资源量的第一增量,所述处理方式包括同步渲染或者异步渲染中的至少一种。
- 如权利要求5所述的方法,其中,所述基于所述图形处理器对所述处理任务的处理方式确定所述应用进程在所述当前预定资源中的已使用资源量的第一增量,包括:当所述图形处理器对所述处理任务的处理方式为异步渲染时,通过对所述前一次处理的开始与结束进行标记,确定所述第一增量。
- 如权利要求5所述的方法,其中,所述基于所述图形处理器对所述处理任务的处理方式确定所述应用进程在所述当前预定资源中的已使用资源量的第一增量,包括:当所述图形处理器对所述处理任务的处理方式为同步渲染时,通过使用查询指令,从所述图形处理器获取所述第一增量。
- 如权利要求4所述的方法,其中,所述基于所述至少一个应用进程中的每个应用进程在所述当前预定资源中的剩余可用资源量,确定对所述至少一个应用进程中的每个应用进程的资源分配命令包括:对于所述至少一个应用进程中的每个应用进程,在所述应用进程对应的当前预定资源中的剩余可用资源量不大于零的情况下,确定对所述应用进程的资源分配命令指示不对所述应用进程进行处理;以及对于所述至少一个应用进程中剩余可用资源量大于零的其他应用进程,基于所述其他应用进程中的每个应用进程的优先级确定对每个应用进程的资源分配命令。
- 如权利要求8所述的方法,其中,所述其他应用进程中的每个应用进程的优先级与所述应用进程等待被处理的时间长度以及确定其最新的第一增量的时间顺序相关;基于所述其他应用进程中的每个应用进程的优先级确定对每个应用进程的资源分配命令包括:对于所述其他应用进程中的每个应用进程,在存在等待被处理的时间长度满足预定条件的应用进程的情况下,基于确定所述应用进程的最新的第一增量的时间顺序来确定对所述应用进程的资源分配命令;以及在未存在等待被处理的时间长度满足预定条件的应用进程的情况下,基于确定所述其他应用进程中的每个应用进程的最新的第一增量的时间顺序来确定对每个应用进程的资源分配命令。
- 一种图形处理器资源管理方法,由图形处理器资源管理设备执行,包括:启动调度进程,所述调度进程包括分配线程和多个处理线程;通过所述分配线程确定用于处理应用进程的多个图形处理器,并为所述多个图形处理器中的每个图形处理器分配一个处理线程;启动多个应用进程,所述多个应用进程中的每个应用进程包括由所述调度进程预先配置的调度库;对于所述多个应用进程中的每个应用进程,通过所述应用进程的调度库和所述分配线程, 为所述多个应用进程中的每个应用进程分配所述多个图形处理器中的一个图形处理器和对应的处理线程;对于向一个图形处理器分配的至少一个应用进程中的每个应用进程,通过与所述应用进程相对应的处理线程确定所述应用进程在所述图形处理器的当前预定资源中的剩余可用资源量,以确定对所述应用进程的资源分配命令,所述资源分配命令指示是否对所述应用进程进行处理;其中,所述剩余可用资源量与所述应用进程在所述图形处理器的历史预定资源中的剩余可用资源量相关,所述资源分配命令用于使所述应用进程在所述当前预定资源中的剩余可用资源量达到预设目标值达到预设目标值。
- 一种图形处理器资源管理装置,包括:处理器确定模块,被配置为确定用于处理应用进程的多个图形处理器;处理器分配模块,被配置为获取待处理的多个应用进程,并为所述多个应用进程中的每个应用进程分配所述多个图形处理器中的一个图形处理器;剩余资源确定模块,被配置为对于向一个图形处理器分配的至少一个应用进程中的每个应用进程,确定所述应用进程在所述图形处理器的当前预定资源中的剩余可用资源量,所述剩余可用资源量与所述应用进程在所述图形处理器的历史预定资源中的剩余可用资源量相关;以及资源分配模块,被配置为基于所述至少一个应用进程中的每个应用进程在所述当前预定资源中的剩余可用资源量,确定对所述至少一个应用进程中的每个应用进程的资源分配命令,所述资源分配命令指示是否对所述应用进程进行处理;其中,所述资源分配命令用于使所述应用进程在所述当前预定资源中的剩余可用资源量达到预设目标值达到预设目标值。
- 如权利要求11所述的装置,其中,所述多个应用进程中的每个应用进程具有预定的资源需求权重,所述装置还包括:已使用资源确定模块,用于对于所述至少一个应用进程中的每个应用进程,获取所述应用进程在所述历史预定资源中的剩余可用资源量,并且确定所述应用进程在所述当前预定资源中的已使用资源量;其中,所述剩余资源确定模块还用于基于所述应用进程在所述历史预定资源中的剩余可用资源量、所述应用进程在所述当前预定资源中的已使用资源量、以及所述应用进程的资源需求权重,确定所述应用进程在所述当前预定资源中的剩余可用资源量;其中,所述资源分配命令用于使所述应用进程的第一误差大于第二误差,所述第一误差是指所述应用进程的资源需求权重与所述应用进程在所述历史预定资源中所使用的资源比例的误差,所述第二误差是指所述应用进程的资源需求权重与所述应用进程在所述当前预定资源中所使用的资源比例的误差。
- 如权利要求12所述的装置,其中,所述资源分配命令指示对应的应用进程是否要向对应的图形处理器发送处理任务以由所述图形处理器进行处理,其中,所述图形处理器对所述处理任务的处理对应于所述应用进程对所述图形处理器的资源的使用;其中,所述已使用资源确定模块还用于确定所述应用进程在所述当前预定资源中的已使用资源量的第一增量,所述第一增量对应于与所述应用进程相对应的图形处理器对来自所述应用进程的处理任务的前一次处理。
- 如权利要求13所述的装置,所述资源分配模块还用于对于所述至少一个应用进程中的每个应用进程,在所述应用进程对应的当前预定资源中的剩余可用资源量不大于零的情况下,确定对所述应用进程的资源分配命令指示不对所述应用进程进行处理;以及对于所述至少一个应用进程中剩余可用资源量大于零的其他应用进程,基于所述其他应用进程中的每个应用进程的优先级确定对每个应用进程的资源分配命令。
- 如权利要求14所述的装置,其中,所述其他应用进程中的每个应用进程的优先级与所述应用进程等待被处理的时间长度以及确定其最新的第一增量的时间顺序相关;所述资源分配模块还用于对于所述其他应用进程中的每个应用进程,在存在等待被处理的时间长度满足预定条件的应用进程的情况下,基于确定所述应用进程的最新的第一增量的时间顺序来确定对所述应用进程的资源分配命令;以及在未存在等待被处理的时间长度满足预定条件的应用进程的情况下,基于确定所述其他应用进程中的每个应用进程的最新的第一增量的时间顺序来确定对每个应用进程的资源分配命令。
- 一种图形处理器资源管理设备,包括:一个或多个处理器;以及一个或多个存储器,其中存储有计算机可执行程序,当由所述处理器执行所述计算机可执行程序时,执行权利要求1-10中任一项所述的方法。
- 一种计算机可读存储介质,其上存储有计算机可执行指令,所述指令在被处理器执行时用于实现如权利要求1-10中任一项所述的方法。
- 一种计算机程序产品,包括计算机指令,其特征在于,该计算机指令被处理器执行时实现权利要求1至10中任一项所述的方法的步骤。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020247011896A KR20240052091A (ko) | 2022-02-14 | 2022-11-17 | 그래픽 처리 유닛 자원 관리 방법, 장치, 디바이스, 저장 매체, 및 프로그램 제품 |
US18/215,018 US20230342207A1 (en) | 2022-02-14 | 2023-06-27 | Graphics processing unit resource management method, apparatus, and device, storage medium, and program product |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210135158.4A CN114490082A (zh) | 2022-02-14 | 2022-02-14 | 图形处理器资源管理方法、装置、设备和存储介质 |
CN202210135158.4 | 2022-02-14 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US18/215,018 Continuation US20230342207A1 (en) | 2022-02-14 | 2023-06-27 | Graphics processing unit resource management method, apparatus, and device, storage medium, and program product |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023151340A1 true WO2023151340A1 (zh) | 2023-08-17 |
Family
ID=81479606
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/132457 WO2023151340A1 (zh) | 2022-02-14 | 2022-11-17 | 图形处理器资源管理方法、装置、设备、存储介质和程序产品 |
Country Status (4)
Country | Link |
---|---|
US (1) | US20230342207A1 (zh) |
KR (1) | KR20240052091A (zh) |
CN (1) | CN114490082A (zh) |
WO (1) | WO2023151340A1 (zh) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114490082A (zh) * | 2022-02-14 | 2022-05-13 | 腾讯科技(深圳)有限公司 | 图形处理器资源管理方法、装置、设备和存储介质 |
CN115408305B (zh) * | 2022-11-03 | 2022-12-23 | 北京麟卓信息科技有限公司 | 一种基于dma重定向的图形渲染方式检测方法 |
CN116579914B (zh) * | 2023-07-14 | 2023-12-12 | 南京砺算科技有限公司 | 一种图形处理器引擎执行方法、装置、电子设备及存储介质 |
CN117314728B (zh) * | 2023-11-29 | 2024-03-12 | 深圳市七彩虹禹贡科技发展有限公司 | 一种gpu运行调控方法及系统 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160358305A1 (en) * | 2015-06-07 | 2016-12-08 | Apple Inc. | Starvation free scheduling of prioritized workloads on the gpu |
CN110362407A (zh) * | 2019-07-19 | 2019-10-22 | 中国工商银行股份有限公司 | 计算资源调度方法及装置 |
CN111597042A (zh) * | 2020-05-11 | 2020-08-28 | Oppo广东移动通信有限公司 | 业务线程运行方法、装置、存储介质及电子设备 |
CN112870726A (zh) * | 2021-03-15 | 2021-06-01 | 腾讯科技(深圳)有限公司 | 图形处理器的资源分配方法、装置和存储介质 |
CN113849312A (zh) * | 2021-09-29 | 2021-12-28 | 北京百度网讯科技有限公司 | 数据处理任务的分配方法、装置、电子设备及存储介质 |
CN114490082A (zh) * | 2022-02-14 | 2022-05-13 | 腾讯科技(深圳)有限公司 | 图形处理器资源管理方法、装置、设备和存储介质 |
-
2022
- 2022-02-14 CN CN202210135158.4A patent/CN114490082A/zh active Pending
- 2022-11-17 WO PCT/CN2022/132457 patent/WO2023151340A1/zh active Application Filing
- 2022-11-17 KR KR1020247011896A patent/KR20240052091A/ko unknown
-
2023
- 2023-06-27 US US18/215,018 patent/US20230342207A1/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160358305A1 (en) * | 2015-06-07 | 2016-12-08 | Apple Inc. | Starvation free scheduling of prioritized workloads on the gpu |
CN110362407A (zh) * | 2019-07-19 | 2019-10-22 | 中国工商银行股份有限公司 | 计算资源调度方法及装置 |
CN111597042A (zh) * | 2020-05-11 | 2020-08-28 | Oppo广东移动通信有限公司 | 业务线程运行方法、装置、存储介质及电子设备 |
CN112870726A (zh) * | 2021-03-15 | 2021-06-01 | 腾讯科技(深圳)有限公司 | 图形处理器的资源分配方法、装置和存储介质 |
CN113849312A (zh) * | 2021-09-29 | 2021-12-28 | 北京百度网讯科技有限公司 | 数据处理任务的分配方法、装置、电子设备及存储介质 |
CN114490082A (zh) * | 2022-02-14 | 2022-05-13 | 腾讯科技(深圳)有限公司 | 图形处理器资源管理方法、装置、设备和存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN114490082A (zh) | 2022-05-13 |
KR20240052091A (ko) | 2024-04-22 |
US20230342207A1 (en) | 2023-10-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023151340A1 (zh) | 图形处理器资源管理方法、装置、设备、存储介质和程序产品 | |
US10891177B2 (en) | Message management method and device, and storage medium | |
US20220379204A1 (en) | Image processing method and apparatus, server, and medium | |
CN109582425B (zh) | 一种基于云端与终端gpu融合的gpu服务重定向系统及方法 | |
US8341624B1 (en) | Scheduling a virtual machine resource based on quality prediction of encoded transmission of images generated by the virtual machine | |
CN110769278B (zh) | 一种分布式视频转码方法及系统 | |
US8990292B2 (en) | In-network middlebox compositor for distributed virtualized applications | |
CN109726005B (zh) | 用于管理资源的方法、服务器系统和计算机可读介质 | |
CN107832143B (zh) | 一种物理机资源的处理方法和装置 | |
CN102143386B (zh) | 一种基于图形处理器的流媒体服务器加速方法 | |
CN110247942B (zh) | 一种数据发送方法、装置和可读介质 | |
US10733022B2 (en) | Method of managing dedicated processing resources, server system and computer program product | |
CN113992758B (zh) | 一种系统数据资源的动态调度方法、装置及电子设备 | |
CN111078404B (zh) | 一种计算资源确定方法、装置、电子设备及介质 | |
WO2017075967A1 (zh) | 在线媒体服务的带宽分配方法及系统 | |
CN111432262A (zh) | 页面视频渲染方法及装置 | |
CN109388501B (zh) | 基于人脸识别请求的通信匹配方法、装置、设备及介质 | |
CN111597044A (zh) | 任务调度方法、装置、存储介质及电子设备 | |
WO2020259208A1 (zh) | 内存调度方法、装置、设备及存储介质 | |
CN114327918B (zh) | 调整资源量的方法、装置、电子设备和存储介质 | |
WO2022057718A1 (zh) | 编码调度方法、服务器及客户端和获取远程桌面的系统 | |
CN113051051B (zh) | 视频设备的调度方法、装置、设备及存储介质 | |
CN115344350A (zh) | 云服务系统的节点设备及资源处理方法 | |
CN114816703A (zh) | 一种任务处理方法、装置、设备及介质 | |
CN111111163B (zh) | 管理计算资源的方法、设备和电子设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22925691 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2022925691 Country of ref document: EP |
|
ENP | Entry into the national phase |
Ref document number: 20247011896 Country of ref document: KR Kind code of ref document: A |
|
ENP | Entry into the national phase |
Ref document number: 2022925691 Country of ref document: EP Effective date: 20240328 |