Rendering load scheduling method and electronic equipment

By obtaining the rendering time error value and performance-to-power ratio of each GPU, and adjusting the rendering task area and the number of GPUs, the rendering load distribution problem in the multi-GPU rendering solution is solved, the rendering efficiency and frame rate are improved, and the power consumption is reduced to meet the needs of Meet the needs of real-time interactive graphics applications.

CN118819795APending Publication Date: 2024-10-22HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310471557.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-21
Publication Date
2024-10-22

AI Technical Summary

Technical Problem

Existing multi-GPU rendering solutions are difficult to effectively handle the dynamic changes in the high rendering load of real-time interactive graphics applications such as game applications. The rendering load distribution problem among multiple GPUs leads to low rendering efficiency.

Method used

By obtaining the rendering time error value of each GPU, adjust the rendering task area area of ​​​​the next frame of image, and sort it from high to low according to the performance power consumption ratio, prioritize rendering tasks to reduce power consumption, and dynamically adjust the number of GPUs to meet the quality of service. Require.

Benefits of technology

It achieves balanced scheduling of multi-GPU rendering loads, improves rendering efficiency and frame rate, reduces system power consumption, and meets the needs of real-time and dynamic adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118819795A_ABST
    Figure CN118819795A_ABST
Patent Text Reader

Abstract

The invention provides a rendering load scheduling method and electronic equipment, and relates to the technical field of terminals. According to the method, the rendering load of the next frame of image is adjusted through the rendering time error value of the single frame of image, and load balance of multi-GPU rendering can be effectively guaranteed. The method comprises the following steps: the electronic equipment respectively obtains first rendering time of N GPUs configured by the electronic equipment in a kth frame image, wherein k is a positive integer; then, the electronic equipment determines a first rendering time error value between the first rendering time and first target rendering time corresponding to the kth frame of image; and then, according to the first rendering time error value, the electronic equipment respectively adjusts rendering task region areas when the N GPUs render the (k + 1)-th frame of image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a rendering load scheduling method and an electronic device. Background Art

[0002] With the development of terminal technology, electronic devices (such as computers, mobile phones, etc.) support running various types of applications to meet the needs of users. However, real-time interactive graphics applications such as game applications have increasingly higher requirements for image quality, resulting in a single graphics processing unit (GPU) being unable to meet the image quality requirements. Therefore, electronic devices with multiple GPUs have become the main development direction in the future.

[0003] Electronic devices need to control the rendering load of multiple GPUs to ensure the required efficiency. The current mainstream multi-GPU rendering solutions include alternate frame rendering (AFR) and scissorframe rendering (SFR). Among them, in the AFR rendering solution, the electronic device alternately assigns consecutive different frames to different GPUs for rendering, thereby improving the overall frame rate, but there is a single-frame delay problem. In the SFR rendering solution, the electronic device divides each frame into non-intersecting areas and assigns these areas to different GPUs for rendering, which can improve the frame rate while reducing the single-frame delay. Therefore, the SFR rendering solution better meets the needs of electronic devices for multi-GPU rendering.

[0004] However, the current SFR rendering solution has difficulty in handling the problem of rendering load distribution among multiple GPUs during the dynamic changes of high rendering loads in real-time interactive graphics applications such as game applications. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides a rendering load scheduling method and electronic device. The technical solution provided by the present application can effectively ensure the load balancing of multi-GPU rendering by adjusting the rendering load of the next frame of image by the rendering time error value of a single frame of image.

[0006] In order to achieve the above technical objectives, this application provides the following technical solutions:

[0007] In a first aspect, a rendering load scheduling method is provided, which is applied to an electronic device, wherein the electronic device includes N graphics processors GPU, where N is a positive integer. The method includes: obtaining first rendering times of the N GPUs at the k-th frame image, where k is a positive integer. Determining a first rendering time error value between the first rendering time and a first target rendering time corresponding to the k-th frame image. According to the first rendering time error value, adjusting the rendering task area areas of the N GPUs when rendering the (k+1)-th frame image.

[0008] In some examples, the N GPUs may be of the same or different models.

[0009] In this way, the electronic device can adjust the rendering load of the GPU in real time based on the rendering time error value, and can meet the real-time requirements of applications with high frame rate requirements and ensure the rendering speed. In addition, for real-time interactive graphics applications with fast dynamic changes in rendering load.

[0010] According to the first aspect, before respectively obtaining the first rendering time of the kth frame image of the N GPUs, the method further includes: obtaining a performance-power consumption ratio ranking result of the N GPUs.

[0011] According to the first aspect, or any implementation method of the first aspect above, according to the first rendering time error value, the rendering task area areas of the N GPUs when rendering the (k+1)th frame image are adjusted respectively, including: according to the performance-power-consumption ratio sorting results of the N GPUs, in order of the performance-power-consumption ratio sorting from high to low, according to the first rendering time error value, the rendering task area areas of the N GPUs when rendering the (k+1)th frame image are adjusted in sequence.

[0012] In this way, rendering is scheduled in descending order of performance-to-power ratio. While meeting the quality of service requirements, rendering tasks are preferentially assigned to GPUs with high performance-to-power ratio, thereby reducing power consumption during the rendering process.

[0013] According to the first aspect, or any implementation of the first aspect above, the method further includes: after the rendering task area is adjusted, determining that the rendering task area areas of m GPUs ranked lower in terms of performance-to-power ratio are reset to zero, where m is a positive integer less than N. Instructing the m GPUs to sleep.

[0014] Exemplarily, the number of GPUs involved in image rendering in the electronic device is 5. The electronic device adjusts the PID load controller of the 5 GPUs in order from high to low performance-power-ratio, and adjusts the rendering task area corresponding to the 5 GPUs. The electronic device determines that the rendering task area corresponding to the GPU 1 with the lowest performance-power-ratio ranking is reset to zero, that is, it predicts that the rendering of the next frame of image can be completed by the 4 GPUs ranked first in performance-power-ratio ranking and the service quality can be guaranteed. Then the electronic device can instruct the GPU 1 with the lowest performance-power-ratio ranking to sleep to save power consumption.

[0015] According to the first aspect, or any implementation of the first aspect above, the method further includes: after the area of ​​the rendering task area is adjusted, determining that the first estimated rendering time of the first GPU on the (K+1)th frame image exceeds the second target rendering time of the (K+1)th frame image, wherein the first GPU is the GPU with the lowest performance-to-power ratio ranking among the N GPUs. Waking up the second GPU, dividing the first rendering task area of ​​the first GPU after the area of ​​the rendering task area is adjusted into the first GPU and the second GPU, and the second estimated rendering time of the first rendering task area after the first rendering task area is re-divided is less than or equal to the second target rendering time, wherein the N GPUs do not include the second GPU.

[0016] Exemplarily, the number of GPUs involved in image rendering in the electronic device is 5. The electronic device adjusts the PID load controllers of the 5 GPUs in order from high to low performance-to-power ratio, and adjusts the rendering task area areas corresponding to the 5 GPUs. After adjusting the rendering task area area corresponding to GPU 1 with the lowest performance-to-power ratio, the electronic device determines that the rendering time required for GPU 1 to render the rendering task area after the adjusted area exceeds the target rendering time. Then, the electronic device can wake up some GPUs again to share the rendering task of GPU 1, so that the final rendering time of the image frame meets the quality of service requirements.

[0017] Optionally, in the process of waking up some GPUs, the GPUs can be woken up from high to low according to the ranking of the performance-power-consumption ratio of the dormant GPUs, and after determining that the awakened GPUs can meet the service quality requirements for rendering, the other GPUs can be stopped from being woken up. For example, the electronic device wakes up GPU 2 with the highest performance-power-consumption ratio among the dormant GPUs, and adjusts the rendering task area corresponding to GPU 1 again through the PID load controller in GPU 1, and determines the rendering task area corresponding to GPU 2 through the PID load controller in GPU 2, if it is determined that the predicted rendering time meets the service quality requirements, the other GPUs can be stopped from being woken up.

[0018] In this way, during the rendering process, the electronic device dynamically adjusts the number of GPUs according to the service quality, thereby reducing rendering power consumption while meeting the service quality requirements.

[0019] According to the first aspect, or any implementation of the first aspect above, each of the N GPUs is configured with a corresponding proportional integral differential PID controller, and the PID controller is used to adjust the rendering task area of ​​the corresponding GPU according to the first rendering time error value.

[0020] According to the first aspect, or any implementation of the first aspect above, each of the N GPUs is also configured with a corresponding fuzzy controller, and the fuzzy controller is used to adjust the parameter value of the corresponding PID controller according to the first rendering time error value and the error change corresponding to the first rendering time error value.

[0021] According to the first aspect, or any implementation of the first aspect above, the process of adjusting the parameter value of the corresponding PID controller includes a fuzzification process, a fuzzy reasoning process, and a defuzzification process.

[0022] In this way, the PID load controller can adjust the rendering load of the GPU in real time, and can meet the real-time requirements of applications with high frame rate requirements, and can ensure the rendering speed. In addition, for real-time interactive graphics applications with fast dynamic changes in rendering load, the PID load controller can also adjust the rendering load in real time based on the feedback of the output value, and adjust the parameters of the PID load controller based on the fuzzy controller to ensure the dynamic adaptability of the scheduling algorithm of the PID load controller.

[0023] According to the first aspect, or any implementation of the first aspect above, the first target rendering time corresponds to a display frame rate, and target rendering times of different image frames are the same or different.

[0024] In this way, in a rendering load scheduling scenario where the rendering load of different image frames changes, the display frame rate requirement can still be met.

[0025] According to the first aspect, or any implementation of the first aspect above, the method further includes: N GPUs rendering the (k+1)th frame image according to the adjusted rendering task area corresponding to the (k+1)th frame image.

[0026] In a second aspect, an electronic device is provided. The electronic device includes: a processor and a memory, the processor includes N graphics processors GPU, N is a positive integer. The memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor reads the computer instructions from the memory, the electronic device executes: respectively obtain the first rendering time of the N GPUs at the k-th frame image, k is a positive integer. Determine a first rendering time error value between the first rendering time and the first target rendering time corresponding to the k-th frame image. According to the first rendering time error value, adjust the rendering task area of ​​the N GPUs when rendering the (k+1)-th frame image.

[0027] According to the second aspect, before respectively obtaining the first rendering time of the kth frame image of the N GPUs, when the processor reads the computer instruction from the memory, the electronic device is also caused to execute: obtaining the performance power consumption ratio ranking result of the N GPUs.

[0028] According to the second aspect, or any implementation method of the second aspect above, according to the first rendering time error value, the rendering task area areas of the N GPUs when rendering the (k+1)th frame image are adjusted respectively, including: according to the performance-power-consumption ratio sorting results of the N GPUs, in order of the performance-power-consumption ratio sorting from high to low, according to the first rendering time error value, the rendering task area areas of the N GPUs when rendering the (k+1)th frame image are adjusted in sequence.

[0029] According to the second aspect, or any implementation of the second aspect above, when the processor reads the computer instruction from the memory, the electronic device is further caused to execute: after the rendering task area area is adjusted, the rendering task area areas of m GPUs ranked later in terms of performance-to-power ratio are determined to be zero, where m is a positive integer less than N. Instructing the m GPUs to sleep.

[0030] According to the second aspect, or any implementation of the second aspect above, when the processor reads the computer instruction from the memory, the electronic device is also caused to execute: after the area of ​​the rendering task area is adjusted, determine that the first estimated rendering time of the first GPU on the (K+1)th frame image exceeds the second target rendering time of the (K+1)th frame image, wherein the first GPU is the GPU with the lowest performance-to-power ratio ranking among the N GPUs. Wake up the second GPU, divide the first rendering task area of ​​the first GPU after the area of ​​the rendering task area is adjusted into the first GPU and the second GPU, and the second estimated rendering time of the first rendering task area after the first rendering task area is re-divided is less than or equal to the second target rendering time, wherein the N GPUs do not include the second GPU.

[0031] According to the second aspect, or any implementation of the second aspect above, each of the N GPUs is configured with a corresponding proportional integral differential PID controller, and the PID controller is used to adjust the rendering task area of ​​the corresponding GPU according to the first rendering time error value.

[0032] According to the second aspect, or any implementation of the second aspect above, each of the N GPUs is also configured with a corresponding fuzzy controller, and the fuzzy controller is used to adjust the parameter value of the corresponding PID controller according to the first rendering time error value and the error change corresponding to the first rendering time error value.

[0033] According to the second aspect, or any implementation of the second aspect above, the process of adjusting the parameter value of the corresponding PID controller includes a fuzzification process, a fuzzy reasoning process, and a defuzzification process.

[0034] According to the second aspect, or any implementation of the second aspect, the models of the N GPUs are the same or different.

[0035] According to the second aspect, or any implementation of the second aspect, the first target rendering time corresponds to a display frame rate, and target rendering times of different image frames are the same or different.

[0036] According to the second aspect, or any implementation of the second aspect above, when the processor reads computer instructions from the memory, it also enables the electronic device to execute: N GPUs render the (k+1)th frame image according to the adjusted rendering task area corresponding to the (k+1)th frame image.

[0037] The technical effects corresponding to the second aspect and any implementation method of the second aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any implementation method of the first aspect, and will not be repeated here.

[0038] In a third aspect, a rendering load scheduling device is provided, the device comprising a transceiver unit and a processing unit. The transceiver unit is used to respectively obtain the first rendering time of the N GPUs of the graphics processor at the k-th frame image, where k is a positive integer. The processing unit is used to determine a first rendering time error value between the first rendering time and a first target rendering time corresponding to the k-th frame image. The processing unit is also used to adjust the rendering task area of ​​the N GPUs when rendering the (k+1)-th frame image according to the first rendering time error value.

[0039] According to the third aspect, the transceiver unit is further used to obtain the performance-power consumption ratio ranking results of N GPUs.

[0040] According to the third aspect, or any implementation method of the third aspect above, the processing unit is also used to adjust the rendering task area of ​​the N GPUs at the (k+1)th frame image in sequence according to the performance-power-consumption ratio sorting results of the N GPUs, in order of the performance-power-consumption ratio sorting from high to low, according to the first rendering time error value.

[0041] According to the third aspect, or any implementation of the third aspect, the processing unit is further used to determine that the rendering task area areas of m GPUs ranked later in terms of performance-to-power ratio are reset to zero after the rendering task area area is adjusted, where m is a positive integer less than N. The transceiver unit is further used to instruct the m GPUs to sleep.

[0042] According to the third aspect, or any implementation of the third aspect above, the processing unit is further used to determine that the first estimated rendering time of the first GPU on the (K+1)th frame image exceeds the second target rendering time of the (K+1)th frame image after the area of ​​the rendering task area is adjusted, wherein the first GPU is the GPU with the lowest performance-to-power ratio ranking among the N GPUs. The transceiver unit is also used to wake up the second GPU, divide the first rendering task area of ​​the first GPU after the area of ​​the rendering task area is adjusted into the first GPU and the second GPU, and the second estimated rendering time of the first rendering task area after the first rendering task area is re-divided is less than or equal to the second target rendering time, wherein the N GPUs do not include the second GPU.

[0043] According to the third aspect, or any implementation of the third aspect above, each of the N GPUs is configured with a corresponding proportional integral differential PID controller, and the PID controller is used to adjust the rendering task area of ​​the corresponding GPU according to the first rendering time error value.

[0044] According to the third aspect, or any implementation method of the third aspect above, each of the N GPUs is also configured with a corresponding fuzzy controller, and the fuzzy controller is used to adjust the parameter value of the corresponding PID controller according to the first rendering time error value and the error change corresponding to the first rendering time error value.

[0045] The technical effects corresponding to the third aspect and any one of the implementation methods of the third aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.

[0046] In a fourth aspect, an electronic device is provided, which has the function of implementing the rendering load scheduling method described in the first aspect and any possible implementation thereof. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0047] The technical effects corresponding to the fourth aspect and any one of the implementation methods of the fourth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.

[0048] In a fifth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (also referred to as an instruction or code), and when the computer program is executed by an electronic device, the electronic device executes the method of the first aspect or any one of the implementations of the first aspect.

[0049] The technical effects corresponding to the fifth aspect and any one of the implementation methods of the fifth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.

[0050] According to a sixth aspect, a computer program product is provided. When the computer program product is run on an electronic device, the electronic device executes the method according to the first aspect or any one of the embodiments of the first aspect.

[0051] The technical effects corresponding to the sixth aspect and any one of the implementation methods of the sixth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.

[0052] According to a seventh aspect, a circuit system is provided, the circuit system comprising a processing circuit, wherein the processing circuit is configured to execute the method of the first aspect or any one of the embodiments of the first aspect.

[0053] The technical effects corresponding to the seventh aspect and any one of the implementation methods of the seventh aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.

[0054] In an eighth aspect, a chip system is provided, comprising at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions and send instructions to the at least one processor, and when the at least one processor executes the instructions, the at least one processor executes the method of the first aspect or any one of the embodiments of the first aspect.

[0055] The technical effects corresponding to the eighth aspect and any one of the implementation methods of the eighth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A schematic diagram of a scenario of a vertex-based rendering load scheduling solution provided in an embodiment of the present application;

[0057] Figure 2 A schematic diagram of a scenario of a time-based rendering load scheduling solution provided in an embodiment of the present application;

[0058] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0059] Figure 4 A schematic diagram of a software structure block diagram of an electronic device according to an embodiment of the present application;

[0060] Figure 5 Schematic diagram of the process of the rendering load scheduling method provided in the embodiment of the present application Figure 1 ;

[0061] Figure 6 A schematic diagram of a rendering load scheduling scenario provided in an embodiment of the present application;

[0062] Figure 7 A schematic diagram of a rendering task area adjustment scenario provided in an embodiment of the present application;

[0063] Figure 8 A schematic diagram of a PID load controller parameter adjustment scenario provided in an embodiment of the present application;

[0064] Fig. 9 The experimental results provided in the embodiments of this application are shown in FIG. Figure 1 ;

[0065] Fig.10 The experimental results provided in the embodiments of this application are shown in FIG. Figure 2 ;

[0066] Fig.11 The experimental results provided in the embodiments of this application are shown in FIG. Figure 3 ;

[0067] Fig.12 The experimental results provided in the embodiments of this application are shown in FIG. Figure 4 ;

[0068] Fig.13 Schematic diagram of the process of the rendering load scheduling method provided in the embodiment of the present application Figure 2 ;

[0069] Fig.14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0070] The technical solutions in the embodiments of the present application are described below in conjunction with the accompanying drawings in the embodiments of the present application. Wherein, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to include expressions such as "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two).

[0071] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.

[0072] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0073] In some scenarios, electronic devices (such as computers, mobile phones, etc.) support running real-time interactive graphics applications, such as game applications, virtual reality (VR) applications, etc. However, these applications have increasingly higher requirements for picture quality, and a single GPU cannot meet the quality of service (QoS) requirements. Therefore, multi-GPU electronic devices have become the main development direction in the future. Among them, the same type of GPUs can be configured in the electronic device to form a homogeneous GPU system, or different types of GPUs can be configured to form a heterogeneous GPU system. Optionally, the GPU models include, for example, NVIDIA GTX 1060 GPU, NVIDIA GTX 1080Ti GPU, etc., which are not limited in the embodiments of the present application.

[0074] The current mainstream multi-GPU rendering solutions include alternate frame rendering (AFR) and scissor frame rendering (SFR). Among them, in the AFR rendering solution, the electronic device alternately assigns consecutive different frames to different GPUs for rendering, thereby improving the overall frame rate. However, it cannot reduce the single-frame delay, and does not take into account the heterogeneous GPU system environment, and cannot adapt to GPUs with different computing power. In the SFR rendering solution, the electronic device divides each frame into non-intersecting areas and assigns these areas to different GPUs for rendering. While improving the frame rate, it can also reduce the single-frame delay, and can also adapt to heterogeneous GPU system environments with different computing power. Therefore, the SFR rendering solution better meets the needs of electronic devices for multi-GPU rendering.

[0075] In the SFR rendering scheme, since the electronic device divides each frame into non-overlapping areas and assigns these areas to different GPUs for rendering, the rendering time of each frame depends on the GPU with the slowest rendering speed. Therefore, if the overall rendering load distribution of a frame is uneven, it will affect the rendering efficiency of the frame, and then affect the overall frame rate of the electronic device.

[0076] There are many challenges in the rendering load scheduling process. First, rendering tasks usually have high frame rate requirements, so the rendering system has high real-time requirements for the scheduling algorithm of the rendering load, and the complexity of the scheduling algorithm cannot be too high to avoid affecting the rendering speed. Secondly, the rendering load of real-time interactive graphics applications changes rapidly, which requires the scheduling algorithm to have good dynamic adaptability, increasing the difficulty of scheduling the rendering load. In addition, during the rendering process, the complexity of each frame is determined by multiple factors (such as primitive size, primitive depth, etc.), which makes it difficult to predict the rendering load in advance, increasing the difficulty of rendering load distribution during rendering load scheduling.

[0077] In response to this, developers have proposed a variety of rendering load scheduling solutions, such as vertex-based rendering load scheduling solution, time-based rendering load scheduling solution, etc.

[0078] In some examples, Figure 1 A schematic diagram of a scenario of a vertex-based rendering load scheduling solution provided in an embodiment of the present application. Figure 1 As shown, the electronic device uses the load prediction module to perform offline analysis on each GPU of the preset rendering task to determine the rendering time per unit area of ​​each GPU for the rendering task. For example, the rendering task is run separately on GPU i for a period of time, and GPU i is any GPU among N GPUs. Then, the load prediction module can obtain the average rendering time of GPU i for each frame of the image during this period of time, and then the load prediction module can determine the rendering time per unit area of ​​GPU i for the rendering task based on the average rendering time per frame of the image and the display screen area.

[0079] Afterwards, the load division module can determine the display division scheme based on the offline analysis results of each GPU sent by the load prediction module. For example, the load division module determines the display division scheme based on the rendering time per unit area of ​​each GPU in the preset rendering task and the size of the display screen space to be rendered. In this display division scheme, the rendering time of each display screen is the same, so that each display screen does not have to wait for each other during the rendering process, thereby improving the rendering efficiency. For example, N GPUs are configured in the electronic device, and the rendering time per unit area of ​​the rendering task on GPU i is Ti, then the size of the display screen space that GPU i is responsible for can be determined according to the following formula.

[0080]

[0081] Afterwards, the rendering system may divide the display screen into N blocks vertically from left to right according to the display screen division scheme, and assign the blocks to N GPUs for rendering image frames.

[0082] It can be seen that in the above vertex-based rendering load scheduling scheme, although only one rendering load calculation is performed before rendering, the computational complexity and overhead are reduced, and the rendering efficiency during the rendering process is improved. However, the premise of the application of this rendering load scheduling scheme is that the objects are evenly distributed in the entire display screen space. If the objects in the rendering task are unevenly distributed in the entire display screen space, it may cause inaccurate prediction of the rendering time per unit area. Moreover, the size of the display screen space division remains unchanged during the rendering process, and cannot adapt to the dynamic changes in the high rendering load of real-time interactive graphics applications such as game applications. In addition, the performance-power-consumption ratio differences between different GPUs and the QoS requirements of rendering tasks are not considered, resulting in a waste of GPU resources.

[0083] In some other examples, Figure 2 A schematic diagram of a time-based rendering load scheduling solution provided in an embodiment of the present application. Figure 2 As shown, the electronic device is equipped with N GPUs. When rendering starts, the load division module first determines the initial display screen division scheme of the N GPUs. Specifically, the load division module divides the display screen into N blocks of equal size from left to right, and the N blocks of display screen space are rendered by the N GPUs respectively.

[0084] After that, after rendering each frame of image, the load prediction module counts the rendering time of GPU i, which is any GPU among the N GPUs, and calculates the unit rendering time of the rendering task on GPU i according to the size of the display screen that GPU i is responsible for, which is recorded as Ti. After that, the load division module can calculate the size of the display screen space rendered by GPU i in the next frame according to the unit rendering time on GPU i, so that the rendering time of each GPU is the same, that is, the display screen division scheme is re-determined.

[0085] Then the size of the display screen space that GPU i is responsible for can be determined according to the following formula.

[0086]

[0087] Afterwards, the rendering system may divide the display screen into N blocks vertically from left to right according to the display screen division scheme, and render the image frames.

[0088] It can be seen that the above time-based rendering load scheduling scheme uses the feedback of the rendering time of the previous frame to determine the display screen space division scheme for the next frame, which is suitable for scenes where objects in the rendering task are unevenly distributed in the entire display screen space. However, the premise of the application of this time-based rendering load scheduling scheme is that the rendering load of the next frame is the same as the rendering load of the previous frame, resulting in the rendering load prediction is still not accurate enough. In addition, the performance-power-consumption ratio differences between different GPUs and the QoS requirements of rendering tasks are not considered, resulting in a waste of GPU resources.

[0089] Therefore, an embodiment of the present application provides a rendering load scheduling method, which can effectively ensure the load balancing of multi-GPU rendering through the proportional-integral-derivative (PID) method, and minimize the total power consumption of the system while ensuring the quality of service.

[0090] Optionally, the rendering load scheduling method provided in the embodiment of the present application can be applied to the electronic device 100. For example, the electronic device 100 can be a terminal device such as a computer, a mobile phone, a computer, a tablet computer, a laptop computer, an augmented reality (AR) / virtual reality (VR) device, a mixed reality (MR) device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a wearable device, an artificial intelligence (AI) device, etc. The operating system installed in the above electronic device 100 includes but is not limited to Or other operating systems. This application does not limit the specific type of the above electronic equipment and the installed operating system.

[0091] For example, Figure 3 A schematic structural diagram of an electronic device 100 is shown.

[0092] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0093] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0094] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0095] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0096] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0097] In some embodiments, the processor 110 includes multiple GPUs, and the models of the multiple GPUs are the same or different. The memory 121 stores the preset performance power consumption ratio ranking results of the multiple GPUs, and the performance power consumption ratio ranking results are used by the subsequent processor 110 to adjust the rendering load of each GPU according to the performance power consumption ratio ranking results.

[0098] Optionally, by means of experiments, with rendering load as the independent variable and performance (such as frame rate, etc.) and power values ​​on different GPUs as the functional relationship of the dependent variables, the performance-power consumption ratio ranking results of different GPUs can be determined.

[0099] In some embodiments, a PID load scheduler is configured in the GPU, and the rendering load of the GPU is adjusted in real time based on the PID load scheduler to meet the quality of service requirements.

[0100] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0101] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0102] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0103] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0104] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0105] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0106] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0107] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0108] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0109] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0110] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0111] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0112] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be manufactured using a liquid crystal display (LCD), such as an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-led, Micro-led, Micro-oled, quantum dot light emitting diodes (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0113] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0114] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0115] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

[0116] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110. The electronic device 100 can use the audio module 170, such as music playing, recording, etc. The audio module 170 can include a speaker, a receiver, a microphone, a headphone interface, and an application processor to implement audio functions.

[0117] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0118] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0119] The motor 191 can generate vibration prompts. The motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 194. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0120] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, message, missed call, notification, etc. The SIM card interface 195 is used to connect a SIM card. The electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.

[0121] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0122] Figure 4 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

[0123] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0124] The application layer can include a series of application packages.

[0125] like Figure 4 As shown, the application package may include applications such as calendar, contacts, memo, camera, music, gallery, map, call, video, etc.

[0126] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0127] like Figure 4 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0128] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0129] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0130] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0131] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0132] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0133] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0134] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0135] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0136] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0137] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0138] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0139] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0140] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0141] In some embodiments, the three-dimensional graphics processing library includes a 3D engine, which is a drawing engine for 3D drawing. In some examples, the 3D engine includes a rendering load control module and a rendering system. The rendering load control module is used to adjust the rendering load of each GPU. The rendering system is used to instruct each GPU to render according to the determined rendering load.

[0142] A 2D graphics engine is a drawing engine for 2D drawings.

[0143] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0144] In some embodiments, different GPUs have different rendering capabilities, so for the same rendering load, the performance of different GPUs is also different. Optionally, the performance of the GPU can be determined, for example, by the frame rate of the image frame displayed by the electronic device. For example, the electronic device processes rendering load 1 through GPU1, and the frame rate of the output image frame is frame rate 1; the electronic device processes the same rendering load 1 through GPU2, and the frame rate of the output image frame is frame rate 2. If frame rate 2 is greater than frame rate 1, it can be determined that the performance of GPU2 is better than the performance of GPU1.

[0145] In addition, different GPUs may generate different power consumption when processing the same rendering load. For example, the power consumption generated by an electronic device processing rendering load 1 through GPU1 is power consumption 1; the power consumption generated by an electronic device processing the same rendering load 1 through GPU2 is power consumption 2. If power consumption 2 is greater than power consumption 1, it can be determined that although the performance of GPU2 is better than that of GPU1, GPU2 will generate greater power consumption during the rendering process.

[0146] Although some applications (such as real-time interactive graphics applications) currently have higher and higher requirements for the image quality displayed by electronic devices, that is, the performance requirements for GPU processing rendering loads are getting higher and higher. However, it does not mean that the higher the performance requirements of the GPU, the more suitable it is for processing rendering tasks. While meeting the quality of service requirements, the GPU should also reduce processing power consumption to avoid high power consumption problems in electronic devices.

[0147] Optionally, the comprehensive capabilities of different GPUs in processing rendering loads can be measured by the performance-power-consumption ratio of different GPUs. Then, in the subsequent rendering load scheduling process, the rendering load scheduling solution can be determined based on the performance-power-consumption ratio.

[0148] In some examples, the performance-to-power ranking results of different GPUs are determined by experiments, with rendering load as the independent variable and performance (such as frame rate, etc.) and power values ​​on different GPUs as the functional relationship of the dependent variable. The experiment can be, for example, a pre-experiment of a benchmark. For example, by modeling a game application with a known rendering load distribution, the performance and power values ​​of different GPUs during the running of the game application are collected to determine the performance-to-power ranking results of different GPUs.

[0149] In some embodiments, after the developer determines the performance-to-power ratio ranking results of different GPUs in the electronic device through experiments, the performance-to-power ratio ranking results can be pre-configured in the electronic device. Thus, when the electronic device needs to perform rendering scheduling, the GPU scheduling scheme can be determined based on the performance-to-power ratio ranking results.

[0150] For example, Figure 5 A flowchart of a rendering load scheduling method provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the method includes the following steps.

[0151] S501. The electronic device obtains a GPU performance-to-power ratio ranking result.

[0152] In some embodiments, after a user interface (UI) event occurs in the electronic device or a user operation on the display screen (such as a touch operation or voice operation on the display screen) is detected, the electronic device is triggered to draw one or more layers, render the one or more layers, and perform layer synthesis on the drawn one or more layers (i.e., the rendered one or more layers) to obtain an image frame, and then the synthesized image frame can be refreshed on the display screen.

[0153] The UI event may be automatically triggered by the electronic device. For example, when the foreground application of the electronic device automatically switches screens, the UI event may be triggered. The foreground application is the application corresponding to the interface currently displayed on the display screen of the electronic device.

[0154] In some embodiments, after the layer drawing is completed, the electronic device may determine that a rendering task has been acquired. Then, the electronic device may acquire a preset GPU performance power consumption ratio sorting result, so that the electronic device can subsequently determine the rendering load distribution result according to the GPU performance power consumption ratio sorting result.

[0155] For example, Figure 6 As shown, in step ①, after determining that the rendering task has been obtained, the load control module requests the GPU sorting module to obtain the GPU performance power consumption ratio sorting result. Correspondingly, the GPU sorting module can send the preset GPU performance power consumption ratio sorting result to the load control module.

[0156] S502: The electronic device determines a rendering load distribution result of the GPU based on a load controller according to the GPU performance-power consumption ratio sorting result.

[0157] S503: The electronic device performs rendering according to the rendering load distribution result.

[0158] In which, each GPU in the electronic device for rendering image frames is configured with a load controller. In some examples, the load controller is a PID load controller based on PID control theory. In which, PID control theory is a widely used feedback control strategy. Based on the PID control theory, the PID load controller can calculate the error value between the output value of the controlled object and the reference value, and calculate the proportional term, integral term and differential term according to the error value to adjust the input value of the controlled object so that the output value of the controlled object gradually stabilizes on the target reference value.

[0159] In some examples, the load controller configured on the GPU can be implemented by software, for example, a load control algorithm is configured in the GPU to implement rendering load control based on PID control theory. Optionally, the load controller configured on the GPU can also be implemented by hardware, for example, a chip that runs a load control algorithm is configured in the GPU (or the chip is configured at other locations in the electronic device), and different chips (or different modules of the same chip) are used to control the rendering load of the corresponding GPU. This embodiment of the application is not limited to this.

[0160] In some embodiments, S502-S503 are loop steps. After the GPU performs rendering according to the rendering allocation result, the PID load controller can obtain the output value (such as rendering time, rendering power consumption, etc.) of the GPU performing this rendering task, and adjust the GPU's next rendering load according to the error value between the output value and the reference value, and generate the corresponding rendering load allocation result. Thus, in the rendering process, dynamic rendering load adjustment is achieved, so that the output value gradually stabilizes on the target reference value, ensuring that the service quality and rendering power consumption meet the requirements. Optionally, the rendering load allocation result includes the corresponding rendering area of ​​the GPU in the next frame image, and the area of ​​the rendering area.

[0161] Optionally, the load controller configured in the GPU may also be a load controller based on other control theories. For example, the control theories used by the load controller include robust control, adaptive control, AI iterative learning control, etc. The following takes the load controller as a PID load controller as an example to introduce the rendering load scheduling process in the rendering task execution process in detail.

[0162] In some embodiments, the electronic device includes N GPUs, where N is a positive integer greater than or equal to 2. Then, the electronic device divides the screen space corresponding to the display screen into N areas according to a preset method, and each GPU is responsible for rendering one of the areas, such as the rendering task area of ​​the i-th GPU is Ri. The preset method includes, for example, vertical division, horizontal division, etc. The size of the N areas divided for the first time can be N equally divided areas. Alternatively, the electronic device divides a larger area for a GPU with a higher GPU performance power consumption ratio, and divides a smaller area for a GPU with a lower GPU performance power consumption ratio, etc. according to the GPU performance power consumption ratio ranking result.

[0163] Based on PID control theory, the control target of the PID load controller in the GPU is to minimize the difference between the rendering time of the rendering task and the target service quality (t_target), that is, to minimize the control error value.

[0164] For example, Figure 6 As shown, the load control module includes N load controllers, each of which is used to control the rendering load of a corresponding GPU in the rendering system. After the load controller in the load control module determines the rendering load distribution result of the corresponding GPU, the GPU can execute the corresponding rendering task (i.e., step ②) and feed back the output value to the corresponding load controller (i.e., step ③), so that the load controller can adjust the next load distribution result of the GPU based on the fed-back output value.

[0165] Optionally, the electronic device determines the error value between the rendering time and the target service quality (t_target) through the PID load controller by the following formula (1). i (k) is the rendering time of the kth frame on the ith GPU, e i (k) is the rendering time error value of the i-th GPU responsible for rendering task area Ri at the k-th frame.

[0166]

[0167] For example, Figure 7As shown, the electronic device adjusts the area of ​​the rendering task area of ​​each GPU in turn according to the error value determined by the above formula (1). For example, the adjustment amplitude u of the area of ​​the rendering task area of ​​the i-th GPU is determined by the following formula (2): i (k).

[0168]

[0169] in, is the proportional parameter of the PID load controller, is the integral parameter of the PID load controller, is the derivative parameter of the PID load controller.

[0170] In some embodiments, during the rendering process of an image frame, the rendering time of the GPU that last completes the rendering determines the overall rendering time of the image frame. Then, the electronic device can determine the target rendering time (i.e., QoS requirement) of a single frame image based on the display frame rate. And then, based on the QoS requirement of the single frame image, determine the target quality of service (t_target) requirement of each GPU. During the rendering process of a single frame image, if the rendering time of each GPU meets the target quality of service requirement, then the overall rendering time of the frame image meets the display frame rate requirement. In this way, in the rendering load scheduling scenario where the rendering load of different image frames changes, the display frame rate requirement can still be met.

[0171] Optionally, the electronic device adjusts the rendering task area of ​​each GPU in order of performance-to-power ratio from high to low according to the ranking result of GPU performance-to-power ratio. Then, the rendering task area of ​​the GPU with the lowest performance-to-power ratio ranking is determined according to the rendering task area areas of other GPUs. In this way, rendering scheduling is performed in order of performance-to-power ratio from high to low. While meeting the quality of service requirements, rendering tasks are preferentially assigned to GPUs with high performance-to-power ratio, thereby reducing power consumption during the rendering process.

[0172] For example, among the N GPUs configured in an electronic device, the rendering time of the (N-1) GPUs ranked first in terms of performance-power ratio just meets the QoS requirement. Then, the Nth GPU ranked lowest in terms of performance-power ratio is responsible for rendering the remaining rendering task areas, so that the overall rendering time is less than or equal to the rendering time required by QoS and can be stable. Since in the above process, the rendering task areas corresponding to GPUs with high performance-power ratios are preferentially allocated, the electronic device can meet the QoS requirements with the minimum total power consumption. That is, based on the PID load controller, the rendering load of the GPU is adjusted dynamically to meet the application's requirements for picture quality while reducing the overall rendering power consumption.

[0173] In some embodiments, during the image rendering process, the electronic device adjusts various parameters of the PID load controller according to real-time feedback from the rendering system, so that the subsequent PID load controller can obtain better rendering load distribution results during the process of adjusting the load rendering.

[0174] For example, Figure 6 As shown, the electronic device includes a fuzzy control module, and the fuzzy control module includes multiple fuzzy controllers. Each fuzzy controller corresponds to a PID load controller in a GPU. That is, each GPU of the electronic device is configured with a PID load controller and a fuzzy controller. The fuzzy controller uses the output value of the GPU performing the rendering task as a feedback variable to dynamically adjust the parameters of the PID load controller (i.e., step ③). The dynamic adjustment process includes a fuzzification process, a fuzzy reasoning process, and a defuzzification process.

[0175] In some examples, the fuzzy controller configured on the GPU can be implemented by software, for example, a fuzzy control algorithm is configured in the GPU to dynamically adjust the parameters of the corresponding PID load controller. Optionally, the load controller configured on the GPU can also be implemented by hardware, for example, a chip that runs a fuzzy control algorithm is configured in the GPU (or the chip is configured in other locations in the electronic device), and different chips (or different modules of the same chip) are used to dynamically adjust the parameters of the corresponding PID load controller. The embodiments of the present application are not limited to this.

[0176] For example, Figure 8 As shown, the PID load controller in the i-th GPU determines that the rendering time error value of the i-th GPU responsible for rendering task area Ri at the k-th frame is e i (k), and the error change is de i (k). Electronic devices will i (k) and de i (k) As the input value of the fuzzy controller, the fuzzification process, the fuzzy inference process, and the defuzzification process are performed to output the PID load controller proportional parameter The corresponding increment Integration parameters The corresponding increment And the differential parameters The corresponding increment The electronic device may then adjust the parameters of the PID load controller based on the determined parameter increments.

[0177] The fuzzification process, fuzzy reasoning process, and defuzzification process in the dynamic adjustment process of parameters of the PID load controller are introduced in detail as follows.

[0178] In some examples, the fuzzification process includes determining the membership degree of the input value. Optionally, the fuzzy controller first determines the universe of discourse (i.e., the range of values) of the input variable, and divides this universe of discourse into a set of subsets of the range of values, and these subsets are called fuzzy sets. Among them, the fuzzy sets can overlap, so an input value can belong to multiple fuzzy sets at the same time. Then, the fuzzy controller determines an input value, and calculates the membership degree of the current input value to each fuzzy set it belongs to through the membership function, thus completing the fuzzification process of the input value.

[0179] Exemplarily, the input value is the error value e i (k) and the change rate of error de i (k). The fuzzy controller determines that the universe of discourse of the input value is [-L, L], where L is the maximum value that the error value may take. The fuzzy controller divides the universe of discourse into 7 fuzzy sets: NB([-L, -2L / 3]), NM(-L, -L / 3), NS(-2L / 3, 0), ZO(-L / 3, L / 3), PS(0, 2L / 3), PM(L / 3, L), PB((2L / 3, L]). And, the fuzzy controller determines that NB_U, NM_U, NS_U, ZO_U, PS_U, PM_U, PB_U are the representative values of the fuzzy sets NB, NM, NS, ZO, PS, PM, and PB respectively. Among them, NB_U = -L, NM_U = -2L / 3, NS_U = -L / 3, ZO_U = 0, PS_U = L / 3, PM_U = 2L / 3, PB_U = L.

[0180] Assume that the fuzzy controller determines that the input value E belongs to two of the fuzzy sets A and B, and the representative values of these two fuzzy sets are A_U and B_U respectively, where A_U < B_U. Then the fuzzy controller determines that the membership degree of the input value E belonging to the fuzzy set A is (B_U - E) / (B_U - A_U), and the membership degree belonging to the fuzzy set B is (E - A_U) / (B_U - A_U).

[0181] Optionally, the number of fuzzy sets divided in the universe of discourse can also be other data amounts, and the ranges of the fuzzy sets can also be other ranges, which are not limited in the embodiments of the present application. Among them, the determination methods of the number and range of fuzzy sets can refer to the prior art, and the embodiments of the present application do not limit this.

[0182] In this way, based on the above method, the fuzzy controller can determine the membership degree of the input value and complete the fuzzification process of the input value.

[0183] In some examples, the reasoning process includes determining a fuzzy set of output values ​​and determining the membership of the output value to the fuzzy set. Optionally, the membership of the input value is called a fuzzy value, and the fuzzy controller maps the fuzzy value of the input value to the fuzzy value of the output value according to a predefined fuzzy rule to complete the fuzzy reasoning. The fuzzy set of the output value corresponds to one or more fuzzy sets in the fuzzy set of the input value.

[0184] For example, the fuzzy controller determines the input value e i (k) and de i (k) After determining the membership of the fuzzy set to which it belongs, the fuzzy set to which the output value belongs is obtained according to the fuzzy sets to which the two input values ​​belong and the fuzzy rules defined in the fuzzy rule table shown in Table 1 below.

[0185] Optionally, as shown in the fuzzy rules in Table 1 below, if the input value e i (k) belongs to fuzzy set A, and the input value is de i (k) The fuzzy set to which it belongs is fuzzy set C, then the fuzzy controller determines that the fuzzy set to which the output value belongs is the input value e i (k) The fuzzy set A belongs to the row and input value de i (k) The fuzzy set corresponding to the column to which the fuzzy set C belongs.

[0186] For example, the input value e i (k) belongs to the fuzzy set PM, and the input value is de i (k) belongs to the fuzzy set NS. Then, according to the fuzzy rules shown in Table 1, the fuzzy controller determines that the fuzzy set to which the output value belongs is ZO. For another example, the input value e i (k) belongs to fuzzy set PM and fuzzy set PB. Input value de i (k) The fuzzy sets to which it belongs are fuzzy set NS and fuzzy set ZO. Then, according to the fuzzy rules shown in Table 1 below, the fuzzy controller determines that the fuzzy sets to which the output values ​​belong are fuzzy set ZO, fuzzy set NM, and fuzzy set NB.

[0187] Optionally, if the input value e i (k) and de i (k) If the output value belongs to multiple fuzzy sets at the same time, the fuzzy controller determines all the fuzzy sets to which the output value belongs. The membership of each fuzzy set to which the output value belongs is the product of the membership of the corresponding fuzzy sets of the two input values.

[0188] For example, the input value e i (k) belongs to fuzzy set PM and fuzzy set PB. Input value e i (k) The membership degree of the fuzzy set PM is a, then the input value e i(k) The membership degree of the fuzzy set PB is (1-a). Input value de i (k) belongs to fuzzy set NS and fuzzy set ZO. Input value de i (k) The membership degree of the fuzzy set NS is b, then the input value de i (k) belongs to the fuzzy set ZO with a membership degree of (1-b). Then, according to the fuzzy rules shown in Table 1, when the input value e i (k) belongs to the fuzzy set PM and the input value is de i (k) When the input value belongs to the fuzzy set NS, the fuzzy controller can determine that the output value belongs to the fuzzy set ZO, and the degree of membership of the output value to the fuzzy set ZO is a*b; when the input value e i (k) belongs to the fuzzy set PM and the input value is de i (k) When the input value belongs to the fuzzy set ZO, the fuzzy controller can determine that the output value belongs to the fuzzy set NM, and the degree of membership of the output value to the fuzzy set NM is a*(1-b); when the input value e i (k) belongs to the fuzzy set PB and the input value is de i (k) belongs to the fuzzy set NS, the fuzzy controller can determine that the output value belongs to the fuzzy set NB, and when the input value e i (k) belongs to the fuzzy set PB and the input value is de i (k) When it belongs to the fuzzy set ZO, the fuzzy controller can determine that the output value also belongs to the fuzzy set NB. Then the membership degree of the output value to the fuzzy set NB is (1-a)*b+(1-a)*(1-b).

[0189] Table 1

[0190]

[0191] In this way, based on the above method, the fuzzy controller can determine the fuzzy set of the output value and the membership of the output value to the fuzzy set, completing the fuzzy reasoning process.

[0192] In some examples, the defuzzification process includes converting the fuzzy value of the output value into the final output value. Optionally, after the fuzzy controller determines the membership of each output value fuzzy set, the final output value is the sum of the product of the representative value of each output value fuzzy set and its membership. For example, assuming that the output value belongs to fuzzy set M and fuzzy set N, whose representative values ​​are M_U and N_U respectively, and whose memberships are u and v respectively, then the output value is (u*M_U+v*N_U).

[0193] Optionally, since the proportional parameter The corresponding increment Integration parameters The corresponding increment And the differential parameters The corresponding increment With the input value e i (k) and de i (k) belongs to different ranges. Then, the fuzzy controller needs to scale the output value. Assume that the scaling factors are α p , α i , α d , the fuzzy control output value is Then, the fuzzy controller can determine and Afterwards, the fuzzy controller can The values ​​are accumulated respectively to the corresponding parameters of the PID load controller to complete the parameter update.

[0194] Alternatively, the scaling factor α can be determined in a number of ways: p , α i , α d For example, the parameters of the PID load controller in most scenarios are obtained through experiments to determine the value of the scaling factor. and Then manually set the parameter increment The maximum value of Divide the maximum value of the parameter increment by half of the number of fuzzy sets (because fuzzy sets are divided into positive and negative parts) as the coefficient a p ,a i and a d For example, as mentioned above, the input values ​​are defined to correspond to 7 fuzzy sets, then

[0195] In this way, based on the above method, the fuzzy controller can determine the final output value, complete the defuzzification process, and thus complete the automatic parameter adjustment process of the PID load controller.

[0196] In this way, the PID load controller can adjust the rendering load of the GPU in real time, and can meet the real-time requirements of applications with high frame rate requirements, and can ensure the rendering speed. In addition, for real-time interactive graphics applications with fast dynamic changes in rendering load, the PID load controller can also adjust the rendering load in real time based on the feedback of the output value, and adjust the parameters of the PID load controller based on the fuzzy controller to ensure the dynamic adaptability of the scheduling algorithm of the PID load controller.

[0197] Through the various embodiments exemplified above, the electronic device can adjust the rendering load of the corresponding GPU through the PID load controller (such as adjusting the area of ​​the rendering task region). In addition, the electronic device can adjust the parameters of the PID load controller through the fuzzy controller during the rendering load adjustment process to enhance the rendering load adjustment capability of the PID load controller.

[0198] In some embodiments, the electronic device adjusts the GPU rendering load during the rendering process of the next frame of image based on the rendering time corresponding to the current image frame, starting from the GPU with the highest performance-to-power ratio, through the PID load controller in sequence according to the GPU performance-to-power ratio. Then, the rendering load of the GPU with the lowest performance-to-power ratio is determined by the GPU with the highest performance-to-power ratio.

[0199] For example, among N GPUs configured in an electronic device, after the PID load controller of the (N-1) GPU ranked first in terms of performance-power ratio adjusts the area of ​​the rendering task region according to the rendering time of the current image frame, the Nth GPU ranked lowest in terms of performance-power ratio is responsible for rendering the remaining rendering task area.

[0200] In some examples, during the rendering process of an image frame, the rendering time of the GPU that last completes the rendering determines the overall rendering time of the image frame. Then, the electronic device can determine whether it is necessary to adjust the number of GPUs involved in the rendering by monitoring the rendering time of the GPU with the lowest performance-power ratio to perform the rendering task.

[0201] For example, Figure 6 As shown, in step ⑤, the GPU quantity control module monitors the rendering status of the GPU with the lowest performance-power ratio ranking in the rendering system.

[0202] If the GPU quantity control module determines that the rendering time of the GPU cannot meet the service quality requirements, it can instruct the rendering system to increase the number of GPUs. The increased GPUs are used to share the rendering tasks of the GPU with the lowest performance-to-power ratio, so that the rendering time of the next frame of image meets the service quality requirements.

[0203] For example, there are N rendering task areas. During the adaptive adjustment of the rendering load, the PID load controller allocates the rendering tasks corresponding to the next frame of the image, and adjusts the area of ​​the rendering task areas corresponding to the (N-1) GPUs ranked first in terms of performance-to-power ratio. It is determined that if a GPU ranked lowest in terms of performance-to-power ratio renders the remaining rendering task area, the overall rendering time of the next frame of the image cannot meet the service quality requirements. Then, the GPU quantity control module can determine to increase the number of GPUs involved in the rendering to avoid the problem that the overall rendering time of the next frame of the image cannot meet the service quality requirements due to the excessive rendering task of the GPU ranked lowest in terms of performance-to-power ratio, which increases the rendering time. Optionally, the added GPU can be the GPU ranked highest in terms of performance-to-power ratio among the GPUs that are not involved in the rendering. It should be understood that the number of GPUs is increased to one or more according to the performance-to-power ratio of the GPU to meet the service quality requirements.

[0204] Exemplarily, the number of GPUs involved in image rendering in the electronic device is 5. The electronic device adjusts the PID load controllers of the 5 GPUs in order from high to low performance-to-power ratio, and adjusts the rendering task area areas corresponding to the 5 GPUs. After adjusting the rendering task area area corresponding to GPU 1 with the lowest performance-to-power ratio, the electronic device determines that the rendering time required for GPU 1 to render the rendering task area after the adjusted area exceeds the target rendering time. Then, the electronic device can wake up some GPUs again to share the rendering task of GPU 1, so that the final rendering time of the image frame meets the quality of service requirements.

[0205] If the GPU quantity control module determines that the rendering load of the GPU is zero, the number of GPUs participating in the rendering of the next frame of the image can be reduced, such as starting a sleep mechanism to put the GPU into sleep mode to reduce power consumption. Optionally, during the dynamic adjustment of the rendering load, the PID load controller adjusts the area of ​​the rendering task area of ​​each GPU according to the performance-to-power ratio ranking result. After the PID load controller completes the area adjustment of the rendering task area of ​​some GPUs, the remaining rendering task area area is zero, that is, the rendering load of one or more GPUs whose rendering task area area has not been adjusted is zero, and the GPU quantity control module can determine to reduce the one or more GPUs, such as putting the one or more GPUs into sleep mode. That is, the GPU quantity control module can monitor the rendering status of one or more GPUs with a lower performance-to-power ratio ranking in the rendering system.

[0206] Exemplarily, the number of GPUs involved in image rendering in the electronic device is 5. The electronic device adjusts the PID load controller of the 5 GPUs in order from high to low performance-power-ratio, and adjusts the rendering task area corresponding to the 5 GPUs. The electronic device determines that the rendering task area corresponding to the GPU 1 with the lowest performance-power-ratio ranking is reset to zero, that is, it predicts that the rendering of the next frame of image can be completed by the 4 GPUs ranked first in performance-power-ratio ranking and the service quality can be guaranteed. Then the electronic device can instruct the GPU 1 with the lowest performance-power-ratio ranking to sleep to save power consumption.

[0207] Optionally, when the number of GPUs is 1, the GPU number control module may utilize a sleep mechanism to reduce the power consumption of the portion exceeding the QoS.

[0208] In this way, during the rendering process, the number of GPUs is dynamically adjusted according to the service quality, thereby reducing the rendering power consumption while meeting the service quality requirements.

[0209] The following example uses an actual rendering experiment scenario to illustrate the specific effect of optimizing the rendering process through the PID load controller and GPU quantity control module.

[0210] The physical host used in the experiment includes multiple GPUs, whose configuration parameters are Intel Xeon CPU E5-2620 CPU, 3 NVIDIA GTX 1060 GPUs and 1 NVIDIA GTX 1080Ti GPU. In addition, these GPUs are connected through the peripheral component interconnect (PCI) Express 3.0 standard, and in order to reduce the copy overhead between GPUs, the shared video memory feature of Direct3D 12 is used to achieve direct communication between GPUs.

[0211] The rendering scenes are designed from two dimensions: the speed of picture change and the distribution of rendering load. The speed of picture change is divided into slow motion (S) and fast motion (F); the distribution of rendering load is divided into uniform distribution (U) and clustered distribution (C). Four experimental samples are formed based on the arrangement and combination of the settings of these two dimensions. In order to facilitate the subsequent experimental description, each experimental sample is expressed in the form of speed-distribution, such as FU represents a rendering scene with fast motion and uniform distribution.

[0212] Among them, Figure 1 The vertex-based rendering load scheduling scheme shown in Figure 2The time-based rendering load scheduling scheme shown in FIG. 1 is used as a comparative experimental scheme to measure the effect of the rendering load scheduling scheme based on the PID controller provided in the embodiment of the present application. The experimental results are divided into two parts. The first part is to measure the effect of the PID controller based rendering load scheduling scheme provided in the embodiment of the present application. Figure 6 The first part shows the effect of the load control module, disabling the experimental results of the GPU quantity control module; the second part shows the experimental results after adding the GPU quantity control module on the basis of including the load control module. Two groups of experimental platforms are set up in the two parts of the experiment, namely, a homogeneous experimental platform (such as including three NVIDIAGTX 1060) and a heterogeneous experimental platform (such as including two GTX 1060GPUs and one GTX 1080Ti GPU).

[0213] In addition, the target quality of service in the rendering process is set to a fixed QoS. In the vertex-based rendering load scheduling scheme, the performance of each GPU in each scenario is tested in advance, and the rendering task area of ​​the corresponding GPU is directly allocated in proportion according to the target quality of service. The target quality of service is, for example, 60 frames per second (fps). In the time-based rendering load scheduling scheme, during the rendering process, the rendering time per pixel in the screen space is estimated based on the rendering time of the previous frame, and the block size of each GPU is recalculated for each frame based on the estimated result (such as the calculation target is 60fps).

[0214] For example, in the first part of the load scheduling module utility experiment, compared with the vertex-based rendering load scheduling scheme and the time-based rendering load scheduling scheme, the rendering load scheduling scheme based on the PID controller provided by the embodiment of the present application can effectively reduce the average power consumption of the GPU while achieving the target service quality. Fig. 9 As shown in Figure 2, based on the homogeneous experimental platform, the average power consumption of the GPU is reduced by 13.49%. Fig.10 As shown in Figure 2, based on the heterogeneous experimental platform, the average power consumption of the GPU is reduced by 29%.

[0215] In the second part of the GPU quantity control module utility experiment, the PID load controller-based solution provided in the embodiment of the present application disables the use of some GPUs when the target service quality is achieved. Compared with the vertex-based rendering load scheduling solution and the time-based rendering load scheduling solution, the power consumption is greatly reduced. For example, Fig.11 As shown in Figure 2, based on the homogeneous experimental platform, the average GPU power consumption is reduced by 48.7%. Fig.12 As shown, based on the heterogeneous experimental platform, the average GPU power consumption is reduced by 60.1%.

[0216] For example, Fig.13 A flowchart of a rendering load scheduling method provided in an embodiment of the present application is shown below. Fig.13 As shown, the method includes the following steps.

[0217] S1301 , the electronic device obtains the first rendering time of the kth frame image of N GPUs respectively.

[0218] The electronic device includes N GPUs, N is a positive integer, and the models of the N GPUs are the same or different. k is a positive integer.

[0219] Optionally, each of the N GPUs is configured with a corresponding PID controller, and the PID controller is used to adjust the rendering task area of ​​the corresponding GPU in the next frame of image according to the rendering time error value of the single frame of image.

[0220] In some embodiments, during the image rendering process, the electronic device collects the rendering time of the corresponding GPU on the image frame through the PID controller, thereby obtaining the corresponding rendering time of N GPUs on the image frame.

[0221] S1302: The electronic device determines a first rendering time error value between a first rendering time and a first target rendering time corresponding to a k-th frame image.

[0222] In some embodiments, the first target rendering time corresponds to a display frame rate, and the target rendering times of different image frames may be the same or different.

[0223] For example, the PID controller can determine the first target rendering time corresponding to the rendering task of the current image frame according to the display frame rate requirement of the electronic device display screen, thereby determining the first rendering time error value between the actual first rendering time of the rendering task and the first target rendering time. Based on this, the PID controller in each GPU can determine the first rendering time error value corresponding to the GPU where it is located.

[0224] In this way, in a rendering load scheduling scenario where the rendering load of different image frames changes, the display frame rate requirement can still be met.

[0225] S1303: The electronic device adjusts the rendering task area of ​​each of the N GPUs when rendering the (k+1)th frame of image according to the first rendering time error value.

[0226] In some embodiments, after determining the rendering time error value of the current image frame, the PID controller in the GPU can adjust the rendering task area area of ​​the next frame image based on the rendering time error value, so that the subsequent actual rendering time area target rendering time requirement can meet the service quality requirements.

[0227] For example, after adjusting the rendering task area based on the rendering time error value, N GPUs render the (k+1)th frame image according to the adjusted rendering task area corresponding to the (k+1)th frame image.

[0228] It should be understood that step S1301 to step S1303 are loop steps, and the electronic device iteratively adjusts the rendering task area corresponding to the next frame image based on the actual rendering time of each frame image through the PID controller to meet the service quality requirements.

[0229] In this way, the electronic device can adjust the rendering load of the GPU in real time based on the rendering time error value, and can meet the real-time requirements of applications with high frame rate requirements and ensure the rendering speed. In addition, for real-time interactive graphics applications with fast dynamic changes in rendering load.

[0230] In some embodiments, each of the N GPUs is further configured with a corresponding fuzzy controller, which is used to adjust the parameter value of the corresponding PID controller according to the first rendering time error value and the error change amount corresponding to the first rendering time error value.

[0231] Optionally, the process of adjusting the parameter value of the corresponding PID controller includes a fuzzification process, a fuzzy reasoning process, and a defuzzification process. The specific implementation of each process can refer to the relevant content described in the above embodiment, which will not be repeated here.

[0232] In this way, the PID load controller can adjust the rendering load of the GPU in real time, and can meet the real-time requirements of applications with high frame rate requirements, and can ensure the rendering speed. In addition, for real-time interactive graphics applications with fast dynamic changes in rendering load, the PID load controller can also adjust the rendering load in real time based on the feedback of the output value, and adjust the parameters of the PID load controller based on the fuzzy controller to ensure the dynamic adaptability of the scheduling algorithm of the PID load controller.

[0233] In some embodiments, before respectively obtaining the first rendering time of the kth frame image of the N GPUs, the electronic device may also obtain the performance power consumption ratio ranking results of the N GPUs. Optionally, the performance power consumption ratio ranking results of the N GPUs may be determined offline. For example, after the performance power consumption ratio ranking results of the N GPUs are determined experimentally, the performance power consumption ratio ranking results of the N GPUs are preset in the electronic device, so that when the electronic device needs to perform image rendering, the performance power consumption ratio ranking results of the preset N GPUs can be obtained.

[0234] In some examples, the electronic device adjusts the rendering task area of ​​the N GPUs at the (k+1)th frame image in sequence according to the performance-power-consumption ratio sorting results of the N GPUs, in order of the performance-power-consumption ratio sorting from high to low, and according to the first rendering time error value.

[0235] In this way, rendering is scheduled in descending order of performance-to-power ratio. While meeting the quality of service requirements, rendering tasks are preferentially assigned to GPUs with high performance-to-power ratio, thereby reducing power consumption during the rendering process.

[0236] In some embodiments, after the rendering task area is adjusted, the electronic device determines that the rendering task area of ​​m GPUs ranked lower in terms of performance-to-power ratio is reset to zero, where m is a positive integer less than N. Then, the electronic device may instruct the m GPUs to hibernate.

[0237] In other embodiments, after the area of ​​the rendering task area is adjusted, the electronic device determines that the first estimated rendering time of the first GPU on the (K+1)th frame image exceeds the second target rendering time of the (K+1)th frame image, wherein the first GPU is the GPU with the lowest performance-to-power ratio ranking among the N GPUs. Then, the electronic device may wake up the second GPU, divide the first rendering task area of ​​the first GPU after the area of ​​the rendering task area is adjusted into the first GPU and the second GPU, and the second estimated rendering time of the first rendering task area after the first rendering task area is re-divided is less than or equal to the second target rendering time, wherein the N GPUs do not include the second GPU.

[0238] Exemplarily, the number of GPUs involved in image rendering of the electronic device is 5. The electronic device adjusts the PID load controllers of the 5 GPUs in descending order of performance-to-power ratio, and adjusts the rendering task areas corresponding to the 5 GPUs.

[0239] For example, the electronic device determines that the area of ​​the rendering task region corresponding to the GPU 1 with the lowest performance-to-power ratio is reset to zero, that is, it predicts that the rendering of the next frame of image can be completed by the four GPUs ranked first in performance-to-power ratio and the service quality can be guaranteed. In this case, the electronic device can instruct the GPU 1 with the lowest performance-to-power ratio to sleep to save power consumption.

[0240] For another example, after adjusting the area of ​​the rendering task region corresponding to GPU 1 with the lowest performance-to-power ratio, the electronic device determines that the rendering time required for GPU 1 to render the adjusted rendering task region exceeds the target rendering time. Then, the electronic device can wake up some GPUs to share the rendering task of GPU 1, so that the final rendering time of the image frame meets the quality of service requirements.

[0241] Optionally, in the process of waking up some GPUs, the GPUs can be woken up from high to low according to the ranking of the performance-power-consumption ratio of the dormant GPUs, and after determining that the awakened GPUs can meet the service quality requirements for rendering, the other GPUs can be stopped from being woken up. For example, the electronic device wakes up GPU 2 with the highest performance-power-consumption ratio among the dormant GPUs, and adjusts the rendering task area corresponding to GPU 1 again through the PID load controller in GPU 1, and determines the rendering task area corresponding to GPU 2 through the PID load controller in GPU 2, if it is determined that the predicted rendering time meets the service quality requirements, the other GPUs can be stopped from being woken up.

[0242] In this way, during the rendering process, the electronic device dynamically adjusts the number of GPUs according to the service quality, thereby reducing rendering power consumption while meeting the service quality requirements.

[0243] In some schemes, multiple embodiments of the present application can be combined, and the combined scheme can be implemented. Optionally, some operations in the process of each method embodiment are optionally combined, and / or the order of some operations is optionally changed. In addition, the execution order between the steps of each process is only exemplary and does not constitute a restriction on the execution order between the steps. There can also be other execution orders between the steps. It is not intended to indicate that the execution order is the only order in which these operations can be performed. A person of ordinary skill in the art will think of a variety of ways to reorder the operations described herein. In addition, it should be noted that the process details involved in a certain embodiment of this article are also applicable to other embodiments in a similar manner, or different embodiments can be used in combination.

[0244] In addition, some steps in the method embodiment may be equivalently replaced by other possible steps. Alternatively, some steps in the method embodiment may be optional and may be deleted in certain usage scenarios. Alternatively, other possible steps may be added to the method embodiment.

[0245] Furthermore, the various method embodiments may be implemented separately or in combination.

[0246] Combination of the above Figure 5-Figure 13 The rendering load scheduling method provided by the embodiment of the present application is described in detail. Fig.14 The electronic device provided by the embodiments of the present application is described in detail.

[0247] In one possible design, Fig.14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.14 As shown, the electronic device 1400 may include: a transceiver unit 1401 and a processing unit 1402. The electronic device 1400 may be used to implement the functions of the electronic device involved in the above method embodiment.

[0248] Optionally, the transceiver unit 1401 is used to support the electronic device 1400 to execute Figure 5 S501 in; and / or, for supporting the electronic device 1400 to execute Fig.13 S1301 in.

[0249] Optionally, the processing unit 1402 is used to support the electronic device 1400 to execute Figure 5 S502 and S503 in; and / or, for supporting the electronic device 1400 to execute Fig.13 S1302 and S1303 in.

[0250] Among them, the transceiver unit may include a receiving unit and a sending unit, and may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module. The operations and / or functions of each unit in the electronic device 1400 are respectively to implement the corresponding process of the rendering load scheduling method described in the above method embodiment. All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional unit. For the sake of brevity, it will not be repeated here.

[0251] Optionally, Fig.14 The electronic device 1400 shown may also include a storage unit ( Fig.14 (not shown), the storage unit stores a program or instruction. When the transceiver unit 1401 and the processing unit 1402 execute the program or instruction, Fig.14 The electronic device 1400 shown can execute the rendering load scheduling method described in the above method embodiment.

[0252] Fig.14 The technical effects of the electronic device 1400 shown can refer to the technical effects of the rendering load scheduling method described in the above method embodiment, which will not be repeated here.

[0253] In addition to being in the form of electronic device 1400, the technical solution provided in the present application may also be a functional unit or chip in the electronic device, or a device used in conjunction with the electronic device.

[0254] An embodiment of the present application also provides a chip system, including: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.

[0255] Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0256] Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.

[0257] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0258] It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.

[0259] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program runs on a computer, the computer executes the above-mentioned related steps to implement the rendering load scheduling method in the above-mentioned embodiment.

[0260] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the rendering load scheduling method in the above-mentioned embodiment.

[0261] In addition, an embodiment of the present application further provides a device. The device may be a component or a module, and the device may include one or more processors and a memory connected to each other. The memory is used to store a computer program. When the computer program is executed by one or more processors, the device executes the rendering load scheduling method in the above-mentioned method embodiments.

[0262] Among them, the device, computer-readable storage medium, computer program product or chip provided in the embodiments of the present application are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0263] The steps of the method or algorithm described in conjunction with the disclosure of the embodiments of the present application can be implemented in hardware or by executing software instructions by a processor. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC).

[0264] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed; that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0265] In the several embodiments provided in the present application, it should be understood that the disclosed method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of modules or units, which can be electrical, mechanical or other forms.

[0266] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0267] Computer-readable storage media include, but are not limited to, any of the following: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media that can store program codes.

[0268] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A rendering load scheduling method, characterized in that: Applied to an electronic device, the electronic device includes N graphics processors GPU, where N is a positive integer, and the method includes: Obtain the first rendering time of the k-th frame image of the N GPUs respectively, where k is a positive integer; Determine a first rendering time error value between the first rendering time and a first target rendering time corresponding to the k-th frame image; According to the first rendering time error value, the rendering task area of ​​the N GPUs when rendering the (k+1)th frame image is adjusted respectively.

2. The method according to claim 1, characterized in that: Before respectively obtaining the first rendering time of the kth frame image of the N GPUs, the method further includes: Obtain the performance-power-consumption ratio ranking results of the N GPUs.

3. The method according to claim 2, characterized in that The step of adjusting the rendering task area of ​​each of the N GPUs when rendering the (k+1)th frame of image according to the first rendering time error value comprises: According to the performance-power-consumption ratio sorting results of the N GPUs, in order of the performance-power-consumption ratio sorting from high to low, and according to the first rendering time error value, the rendering task area of ​​the N GPUs at the (k+1)th frame image is adjusted in sequence.

4. The method according to claim 3, characterized in that The method further comprises: After the rendering task area is adjusted, the rendering task area of ​​m GPUs ranked last in terms of performance-to-power ratio is determined to be zero, where m is a positive integer less than N; Instruct the m GPUs to sleep.

5. The method according to claim 3, characterized in that: The method further comprises: After the area of ​​the rendering task region is adjusted, determining that a first estimated rendering time of the first GPU on the (K+1)th frame image exceeds a second target rendering time of the (K+1)th frame image, wherein the first GPU is a GPU with the lowest performance-to-power ratio ranking among the N GPUs; Wake up the second GPU, divide the first rendering task area of ​​the first GPU after the area of ​​the rendering task area is adjusted into the first GPU and the second GPU, wherein the second estimated rendering time of the first rendering task area after the first rendering task area is re-divided is less than or equal to the second target rendering time, wherein the N GPUs do not include the second GPU.

6. The method according to any one of claims 1 to 5, characterized in that: Each of the N GPUs is configured with a corresponding proportional-integral-differential (PID) controller, and the PID controller is used to adjust a rendering task area of ​​the corresponding GPU according to the first rendering time error value.

7. The method according to claim 6, characterized in that Each of the N GPUs is also configured with a corresponding fuzzy controller, and the fuzzy controller is used to adjust the parameter value of the corresponding PID controller according to the first rendering time error value and the error change amount corresponding to the first rendering time error value.

8. A rendering load scheduling device, characterized in that: The device comprises a transceiver unit and a processing unit; The transceiver unit is used to obtain the first rendering time of the k-th frame image of N GPUs of the graphics processors respectively, where k is a positive integer; The processing unit is used to determine a first rendering time error value between the first rendering time and a first target rendering time corresponding to the k-th frame image; The processing unit is further used to adjust the rendering task area of ​​the N GPUs when rendering the (k+1)th frame image according to the first rendering time error value.

9. The device according to claim 8, characterized in that The transceiver unit is further used to obtain the performance-power consumption ratio ranking results of the N GPUs.

10. The device according to claim 9, characterized in that The processing unit is further used to adjust the rendering task area of ​​the N GPUs at the (k+1)th frame image in sequence according to the performance-power-consumption ratio sorting results of the N GPUs, in order from high to low, according to the first rendering time error value.

11. The device according to claim 10, characterized in that The processing unit is further used to determine that the rendering task area areas of m GPUs ranked later in terms of performance-to-power ratio are reset to zero after the rendering task area area is adjusted, where m is a positive integer less than N; The transceiver unit is further used to instruct the m GPUs to sleep.

12. The device according to claim 10, characterized in that The processing unit is further configured to determine, after the area of ​​the rendering task region is adjusted, that a first estimated rendering time of the first GPU on the (K+1)th frame image exceeds a second target rendering time of the (K+1)th frame image, wherein the first GPU is a GPU with the lowest performance-to-power ratio ranking among the N GPUs; The transceiver unit is further used to wake up the second GPU, divide the first rendering task area of ​​the first GPU into the first GPU and the second GPU after the area of ​​the rendering task area is adjusted, and the second estimated rendering time of the first rendering task area after the first rendering task area is re-divided is less than or equal to the second target rendering time, wherein the N GPUs do not include the second GPU.

13. The device according to any one of claims 8 to 12, characterized in that: Each of the N GPUs is configured with a corresponding proportional-integral-differential (PID) controller, and the PID controller is used to adjust a rendering task area of ​​the corresponding GPU according to the first rendering time error value.

14. The device according to claim 13, characterized in that Each of the N GPUs is also configured with a corresponding fuzzy controller, and the fuzzy controller is used to adjust the parameter value of the corresponding PID controller according to the first rendering time error value and the error change amount corresponding to the first rendering time error value.

15. An electronic device, characterized in that: include: A processor and a memory, wherein the processor includes a plurality of graphics processors, the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor reads the computer instructions from the memory, the electronic device executes the method as described in any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises a computer program, and when the computer program is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 7.

17. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Control parameter determination method, performance adjustment method and related device of electronic equipment

    CN119356837A

  • Processor resource scheduling method, related apparatus, and device

    WO2026179853A1