Control method and device of a graphics processing unit, terminal equipment and storage medium

By obtaining the operating cycle and voltage of the graphics processing unit, calculating power consumption, and adjusting the frequency and voltage to minimize power consumption, the problem of increased power consumption in terminal devices is solved, and battery life and energy efficiency are improved.

CN115237244BActive Publication Date: 2025-12-16GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210783539.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-27
Publication Date
2025-12-16
Estimated Expiration
2042-06-27

AI Technical Summary

Technical Problem

In existing technologies, even when terminal devices use dynamic voltage and frequency adjustment mechanisms to reduce the power of the graphics processing unit, there is still a problem of increased power consumption, resulting in wasted power.

Method used

By obtaining the duty cycle and operating voltage of the graphics processing unit, power consumption is calculated, and the operating frequency and operating voltage are adjusted to minimize power consumption, including adjusting the number of computing units and the operating frequency of other subsystems to optimize energy efficiency.

Benefits of technology

It effectively avoids increased power consumption, improves the battery life of terminal devices, reduces power waste, and enhances energy efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115237244B_ABST
    Figure CN115237244B_ABST
Patent Text Reader

Abstract

The application discloses a kind of control method, device, terminal equipment and storage medium of graphic processing unit, belong to terminal control technical field.Application is used in terminal equipment, this method includes: obtaining the working cycle and working voltage of graphic processing unit (GPU);According to working cycle and working voltage, the power consumption of GPU in working cycle is obtained;The working frequency of GPU and the working voltage of GPU are adjusted, so that the power consumption of GPU in working cycle reaches minimum value, so that the power consumption of GPU in working cycle reaches minimum value.The working frequency of GPU and the working voltage of GPU are adjusted based on the minimum value of power consumption in the application, can avoid the situation that the power consumption of GPU still increases in the process of reducing the working frequency of GPU, improve the endurance of terminal equipment, reduce the waste of power of terminal equipment.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of terminal control, and particularly relates to a control method and device of a graphic processing unit, a terminal device and a storage medium. BACKGROUND

[0002] With the development of information technology and Internet technology, users have become very common in daily life to use terminal devices, and how to improve the endurance of terminal devices in use is a problem that people are more concerned about.

[0003] At present, most terminal devices will use a dynamic voltage and frequency scaling (DVFS) mechanism to adjust the working frequency and working voltage of a graphic processing unit (GPU) when reducing power consumption. The DVFS mechanism adjusts the working frequency of the GPU according to the utilization rate of the GPU, so that the utilization rate of the GPU is maintained at a certain target value to meet the computing power requirements of the current graphic processing task.

[0004] For the above-mentioned existing DVFS mechanism, although the power of the GPU can be reduced after adjusting the frequency, the power consumption of the GPU will still increase, and there is a problem of waste of terminal device power. SUMMARY

[0005] In order to solve the problems of the prior art, improve the endurance of the terminal device, and reduce the waste of power of the terminal device, the embodiments of the present application provide a control method and device of a graphic processing unit, a terminal device and a storage medium. The technical solution is as follows:

[0006] In one aspect, the present application provides a control method of a graphic processing unit, applied to a terminal device, the method comprising:

[0007] obtaining a working period and a working voltage of the graphic processing unit (GPU);

[0008] obtaining the power consumption of the GPU in the working period according to the working period and the working voltage;

[0009] adjusting the working frequency of the GPU and the working voltage of the GPU to minimize the power consumption of the GPU in the working period.

[0010] In one aspect, the present application provides a terminal device control device, applied to a terminal device, the device comprising:

[0011] The first obtaining module is configured to obtain a working period and a working voltage of the GPU.

[0012] The second obtaining module is configured to obtain an electricity consumption of the GPU in the working period according to the working period and the working voltage.

[0013] The parameter adjusting module is configured to adjust the working frequency of the GPU and the working voltage of the GPU, so that the electricity consumption of the GPU in the working period reaches a minimum value.

[0014] In another aspect, the present application provides a terminal device, which comprises a processor and a memory, and the memory stores at least one instruction, at least one program, a code set or an instruction set, which are loaded and executed by the processor to implement the control method of the GPU as described in one aspect.

[0015] In another aspect, the present application provides a computer readable storage medium, which stores at least one instruction, at least one program, a code set or an instruction set, which are loaded and executed by a processor to implement the control method of the GPU as described in one aspect.

[0016] In another aspect, the present application provides a computer program product, which, when running on a computer, causes the computer to execute the control method of the GPU as described in one aspect.

[0017] In another aspect, the present application provides an application publishing platform, which is used to publish a computer program product, and when the computer program product runs on a computer, causes the computer to execute the control method of the GPU as described in one aspect.

[0018] The technical scheme provided by the embodiments of the present application has at least the following beneficial effects:

[0019] This application obtains the GPU's duty cycle and operating voltage; based on the duty cycle and operating voltage, it obtains the GPU's power consumption during the duty cycle; and it adjusts the GPU's operating frequency and operating voltage to minimize the power consumption during the duty cycle. This application adjusts the GPU's operating frequency and operating voltage based on minimizing power consumption, avoiding situations where the GPU's power consumption still increases when the operating frequency is reduced, thus improving the battery life of terminal devices and reducing power waste. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart of a method for controlling a graphics processing unit according to an exemplary embodiment of this application;

[0022] Figure 2 This is a flowchart of a method for controlling a graphics processing unit according to an exemplary embodiment of this application;

[0023] Figure 3 This is a structural block diagram of a graphics processing unit according to an exemplary embodiment of this application;

[0024] Figure 4 This is a schematic diagram of a SOC system architecture according to an exemplary embodiment of this application;

[0025] Figure 5 This is a flowchart of a method for controlling a graphics processing unit according to an exemplary embodiment of this application;

[0026] Figure 6 This is a structural block diagram of the control device for a graphics processing unit provided in an exemplary embodiment of this application;

[0027] Figure 7 This is a schematic diagram of the structure of a terminal device provided in an exemplary embodiment of this application. Detailed Implementation

[0028] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is made in connection with the drawings, in which the same reference numerals designate the same elements throughout the several figures, and the description is made in connection with the drawings and is directed to illustrative exemplary embodiments. The embodiments described in these exemplary embodiments are not meant to represent all embodiments consistent with the application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the application as detailed in the appended claims.

[0029] With the rapid development of science and technology, various terminal devices have been applied in people's daily life, and people need to use terminal devices in work, life and study. For example, people use terminal devices to take pictures of the surrounding environment and record data in work. With more and more scenes of using terminal devices and the promotion and use of Internet of Things, it is more and more important to improve the endurance of terminal devices.

[0030] Currently, the main systems of terminal devices include Android system, iOS system, Linux system, etc. For terminal devices with various kernel systems, the central processing unit (CPU) and the image processing unit (GPU) of each processor mainly serve as task processing units during the running of the terminal device. Accordingly, these task processing units consume power of the terminal device when working.

[0031] In actual application, in order to improve the endurance of terminal devices and prolong the battery life of mobile phones, the system on chip (SOC) design in the terminal adopts various schemes to reduce power consumption. Among them, the graphic processor in most terminal devices will adopt the DVFS mechanism to adjust the working frequency and working voltage, so as to reduce the power consumption level of the GPU when working. Among them, the DVFS mechanism adjusts the working frequency of the GPU according to the utilization rate of the current GPU, so that the utilization rate of the GPU is maintained at a certain target value to meet the computing power demand of the current graphic processing task.

[0032] That is, the frequency and voltage adjustment scheme of the above-mentioned DVFS technology is to reduce the working frequency of the graphic processor as much as possible to meet the processing demand of the load task. The essence of this adjustment scheme is to adjust the working frequency so that the GPU can run at the lowest power to meet the processing demand of the load task. However, in actual life, the use scene of the terminal device is limited by the battery capacity, and constantly reducing the working power of the GPU is equivalent to constantly reducing the working frequency of the GPU. When the working voltage of the GPU is reduced to the lowest, if the working power continues to be reduced, it will instead increase the power consumption of the GPU, causing waste of power of the terminal device.

[0033] In order to solve the problems in the related art, improve the endurance of the terminal device, and reduce the waste of power of the terminal device, the application provides a control method of a graphics processing unit, which can adjust the working frequency and the working voltage based on the power consumption of the GPU, so that the power consumption of the GPU to the battery is the lowest after adjusting the working frequency and the working voltage.

[0034] Please refer to Figure 1 which shows a method flowchart of a control method of a graphics processing unit provided by an exemplary embodiment of the application, which can be used in a terminal device. As Figure 1 shown, the control method of the graphics processing unit can include the following steps:

[0035] Step 101, obtaining the working period and the working voltage of the graphics processing unit (GPU).

[0036] Optionally, the terminal device mentioned in the application can be a mobile phone, a tablet computer, a notebook computer, smart glasses, a smart watch, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a desktop computer, a laptop computer, a smart home device, and the like.

[0037] During the running of the GPU of the terminal device, various data processing tasks need to be processed by the GPU, such as rendering and displaying images. In the present scheme, the terminal device can obtain the working period and the working voltage of the GPU through the CPU, or can obtain the working period and the working voltage of the GPU itself. The present scheme does not limit the way of obtaining the working period and the working voltage of the GPU.

[0038] Step 102, obtaining the power consumption of the GPU in the working period according to the working period and the working voltage.

[0039] Optionally, the terminal device can bring the obtained working period and working voltage of the GPU into the calculation formula of the power consumption, so as to calculate the power consumption of the GPU in the working period. For example, the power consumption of the GPU of the terminal device can be written as the following function:

[0040] e=g(f,v,c,w);

[0041] In the above formula, f represents the working frequency of the GPU, v represents the working voltage of the GPU, c represents the number of operation units in the GPU, w represents the working load of the GPU, and e represents the power consumption of the GPU. For the GPU of the terminal device, the current working period can be t, and the power consumption of the GPU in one working period t can be represented by e. c can be a default fixed number or the number of currently running operation units after adjustment.

[0042] In step 103, the working frequency of the GPU and the working voltage of the GPU are adjusted so that the power consumption of the GPU in the working period reaches a minimum value, so that the power consumption of the GPU in the working period reaches a minimum value.

[0043] Optionally, in the present solution, the working frequency of the GPU and the working voltage of the GPU are adjusted so that the power consumption of the GPU in the working period reaches a minimum value, so that the power consumption of the GPU in the working period reaches a minimum value. During the adjustment, the terminal device can adjust the working frequency, and according to the adjusted working frequency and the voltage calculation formula, the target voltage corresponding to the adjusted working frequency is obtained. The voltage calculation formula is: v=k2*f. Wherein, k2 is a constant, which can be set by the developer or the operation and maintenance personnel according to the process parameters of the system-on-chip of the terminal device. Optionally, this step is equivalent to the process of taking the minimum value of e by adjusting f and v.

[0044] To sum up, the present application obtains the working period and the working voltage of the GPU, obtains the power consumption of the GPU in the working period according to the working period and the working voltage, and adjusts the working frequency of the GPU and the working voltage of the GPU so that the power consumption of the GPU in the working period reaches a minimum value, so that the power consumption of the GPU in the working period reaches a minimum value. The present application adjusts the working frequency of the GPU and the working voltage of the GPU based on the minimum power consumption, which can avoid the situation that the power consumption of the GPU still increases during the process of reducing the working frequency of the GPU, improves the endurance of the terminal device, and reduces the waste of power of the terminal device.

[0045] In a possible implementation manner, the number of operation units of the GPU can also be adjusted in the present application to improve the energy efficiency of the GPU of the terminal device.

[0046] Please refer to Figure 2 which shows a method flowchart of a GPU control method provided by an exemplary embodiment of the present application, which can be used in a terminal device. As Figure 2 shown, the GPU control method can include the following steps:

[0047] In step 201, the working period and working voltage of the GPU are obtained.

[0048] Optionally, t represents the working period, and the working period t of the GPU obtained by the terminal device can be represented by the following formula: t=k1*(w / f), where w represents the working load of the GPU, and f represents the current working frequency of the GPU. That is, the terminal device can calculate the current working period of the GPU according to the current working frequency of the GPU and the working load of the GPU. Wherein, k1 is similar to k2, and is set by the developer or the operation and maintenance personnel according to the process parameters of the system-level chip of the terminal device. In addition, the working voltage of the GPU can be represented by v, and the relationship between the working voltage of the GPU and the working frequency of the GPU (v=k2*f) can be referred to the description of step 103 in the above embodiment, which will not be described here. Figure 1

[0049] In step 202, the energy utilization rate of the top module of the GPU and the core energy utilization rate are obtained, and the core energy utilization rate is the average utilization rate of the energy utilization rates of each running operation unit in the GPU.

[0050] Wherein, the energy utilization rate of the top module of the GPU is the utilization rate of the battery energy of the top module of the GPU. The energy utilization rate of each running operation unit in the GPU is the utilization rate of the battery energy of each running operation unit in the GPU.

[0051] Optionally, please refer to Figure 3 , which shows a structure block diagram of a GPU according to an example embodiment of the present application. As Figure 3 shown, the GPU 300 includes a top module 301 and each operation unit 302. In the above Figure 3 embodiment, the GPU 300 can be divided into a top module 301 and each operation unit 302, wherein the top module 301 can be responsible for memory access, geometry processing and other work in the terminal device, and each operation unit 302 can be responsible for Fragment processing and other work in the terminal device. The clock of the top module 301 is f TOP , and each operation unit 302 uses the same clock f CORE , and the clock of the top module 301 and the clock of each operation unit 302 are independently controlled by the terminal device.

[0052] ​In the GPU, a top module and a plurality of operation units can be included. In the scheme, the terminal device can further acquire the energy utilization rate of the top module and the core energy utilization rate. For example, the terminal device calculates the energy utilization rate of the top module 301 through the performance counter of the GPU to obtain αTOP, calculates the utilization rate of each running operation unit 302 through the performance counter of the GPU, and obtains the average value according to the utilization rate of each running operation unit 302 to obtain the average utilization rate αCORE of the energy utilization rate of each running operation unit in the GPU.

[0053] Optionally, the number of operation units of the GPU of the terminal device in the scheme can be a default fixed number or can be flexibly adjusted. That is, if the number of running operation units in the GPU is a fixed number, the scheme can directly enter step 204 from step 202, and if the number of running operation units in the GPU is flexibly adjusted, step 203 can be entered. That is, if the number of running operation units in the GPU is a fixed number, in the above e=g(f, v, c, w), c corresponds to a constant.

[0054] In step 203, the number of running operation units in the GPU is adjusted according to the energy utilization rate of the top module and the core energy utilization rate.

[0055] Optionally, if the number of operation units in the GPU can be individually controlled to turn on or off the working power supply, because the processing capacity and the completed sub-workload of different operation units are different, many cooperations are involved among them, the scheme can obtain an optimal number of operation units for different situations, so that the energy efficiency is the highest.

[0056] Optionally, the terminal device can adjust the number of running operation units in the GPU according to the energy utilization rate of the top module and the core energy utilization rate in the following manner: a first proportion value is calculated according to the energy utilization rate of the top module and the core energy utilization rate; when the first proportion value is greater than a first threshold value, a first preset number of operation units are added to the number of running operation units in the GPU; when the first proportion value is less than a second threshold value, a first preset number of operation units are reduced from the number of running operation units in the GPU. The code can be as follows:

[0057] Define β=k*α CORE / α TOP

[0058] If β>β U

[0059] Iecrease core number, N core = N core + Δ

[0060] Else If β < β D

[0061] Decrease top module frequency, N core = N core - Δ

[0062] Endif

[0063] wherein β represents the first proportion value, the first threshold is β U , the second threshold is β D , the first preset number is Δ, and N core is the number of running operation units. k is a constant, which can be set by a developer or an operation and maintenance personnel according to a process parameter of a system-on-chip of the terminal device. That is, the terminal device brings the obtained energy utilization rate of the top module and the sub-core energy utilization rate into the calculation formula of β to obtain the first proportion value β, judges the size relationship between β and the first threshold and the second threshold, increases Δ operation units on the basis of the number of running operation units in the GPU when β > the first threshold, and decreases Δ operation units on the basis of the number of running operation units in the GPU when β < the second threshold.

[0064] For example, β U may be 3, β D may be 1 / 3, Δ is 2, N core is 5, and β calculated is 4, then 2 operation units are added on the basis of the number of running operation units, and the adjusted number of running operation units is 7. N core is 5, β calculated is 0.2, then 2 operation units are reduced on the basis of the number of running operation units, and the adjusted number of running operation units is 3. Optionally, when β is between the second threshold and the first threshold, the terminal device can keep the number of running operation units unchanged. That is, when the first proportion value is greater than the first threshold, it is indicated that the energy utilization rate of the top module of the GPU is high, and the number of operation units can be increased to enhance the processing capability of the GPU and improve the energy efficiency of the GPU. When the first proportion value is less than the second threshold, it is indicated that the energy utilization rate of the top module of the GPU is low, and the number of operation units can be reduced to enhance the processing capability of the GPU and improve the energy efficiency of the GPU.

[0065] In a possible implementation, when the number of operation units is reduced, the terminal device can determine the task priorities of the various running operation units in the GPU when the first proportion value is less than the second threshold value, and reduce the various running operation units in the GPU by the first preset number of operation units in the order from low to high task priority. That is, when the first proportion value is less than the second threshold value, the terminal device can obtain the task priorities of the various running operation units. For example, the various running operation units are operation unit one, operation unit two, operation unit three, operation unit four, and operation unit five, and the tasks processed by the five operation units are task one, task two, task three, task four, and task five, respectively. The tasks processed by the five operation units are arranged in the order from low to high task priority as task one, task four, task five, task three, and task two. When the first proportion value calculated by the terminal device is less than the second threshold value, the task priorities of the various running operation units are obtained, and the number of operation units is reduced. Taking the above example in which the value of Δ is 2, the operation unit one and the operation unit four in the GPU are turned off.

[0066] In step 204, the power consumption of the GPU in the working period is obtained according to the working period, the working voltage, and the number of various running operation units in the GPU.

[0067] Optionally, still taking the above e representing the power consumption of the GPU in the working period, the terminal device can obtain the power consumption of the GPU in the working period by bringing the working period, the working voltage, and the number of various running operation units in the GPU into the above formula, which will not be described herein again.

[0068] In step 205, the working frequency of the GPU and the working voltage of the GPU are adjusted, so that the power consumption of the GPU in the working period reaches a minimum value.

[0069] Optionally, the power consumption of the GPU of the terminal device can be written as the following function: e=g(f,v,c,w), where f represents the working frequency of the GPU, v represents the working voltage of the GPU, c represents the number of operation units in the GPU, w represents the working load of the GPU, and e represents the power consumption of the GPU. Since there is a linear mapping relationship between f and v in the DVFS mechanism: v=k2*f, e=g(f,v,c,w) can be simplified as e=g(f,c,w). The target of the present solution is to obtain

[0070] For example, the working period of the GPU obtained by the terminal device in the above manner is as follows:

[0071]

[0072] Then, the working voltage of the GPU is v=k2*f, and thus the dynamic power consumption of the GPU can be expressed as follows:

[0073] P dyn =k3v 2 f;

[0074] Then, the power consumption corresponding to the dynamic power consumption of the GPU is E dyn =P dyn t=k4f 2 w;

[0075] Optionally, the static power consumption of the GPU is also considered in the present solution, and the static power consumption of the GPU can be expressed as follows:

[0076] P lkg =k5v 2 ;

[0077] Then, the power consumption corresponding to the static power consumption of the GPU is E lkg =P lkg t=k6fw;

[0078] The total power consumption of the GPU is e=E dyn +E lkg ;

[0079] In the present solution, the DVFS mechanism is adjusted to select the minimum energy consumption corresponding to the lowest working frequency that meets the working load, that is, to find The above k3, k4, and k5 are constants, and can also be set by the developer or the operation and maintenance personnel according to the process parameters of the system-on-chip of the terminal device.

[0080] In the above Figure 3 , the GPU includes a top module and an operation unit, and in the present step, the terminal device can adjust as follows: adjusting the working frequency of the top module of the GPU to a first frequency and adjusting the working voltage of the top module of the GPU to a first voltage, so that the power consumption of the top module of the GPU in the working period reaches a minimum value; and adjusting the working frequency of the operation unit of the GPU to a second frequency and adjusting the working voltage of the operation unit of the GPU to a second voltage, so that the power consumption of the operation unit of the GPU in the working period reaches a minimum value.

[0081] Optionally, in the present solution, the process of adjusting the working frequency of the top module of the GPU to a first frequency and adjusting the working voltage of the top module of the GPU to a first voltage, so that the power consumption of the top module of the GPU in the working period reaches a minimum value, can be as follows:

[0082] The terminal device can compare the obtained top-mode energy utilization rate αTOP with the fifth threshold. When αTOP > the fifth threshold, the operating frequency of the top mode is increased, and the operating voltage of the top mode corresponding to the adjusted operating frequency is obtained according to v = k2*f, thereby adjusting the operating voltage of the top mode. The terminal device can also compare the obtained top-mode energy utilization rate αTOP with the sixth threshold. When αTOP < the sixth threshold, the operating frequency of the top mode is decreased, and the operating voltage of the top mode corresponding to the adjusted operating frequency is obtained according to v = k2*f, thereby adjusting the operating voltage of the top mode. When the operating frequency of the top mode reaches the highest frequency that can operate at the lowest operating voltage, the operating frequency of the top mode is kept constant. The corresponding code is as follows:

[0083] If α_TOP>α_(TOP_U)

[0084] Increase top module frequency, f_TOP, ## Increase the operating frequency of the top module.

[0085] Adjust the working voltage of the top module.

[0086] Else If α_TOP < α_(TOP_D)

[0087] Decrease top module frequency, f_TOP## Reduce the operating frequency of the top module.

[0088] If f_TOP reaches f_(TOP_min), then maintain f_TOP at the minimum frequency. This means that when the operating frequency of the top mold reaches the highest frequency it can operate at with the minimum operating voltage, the operating frequency of the top mold should remain constant.

[0089] Adjust the working voltage of the top module.

[0090] Endif

[0091] Wherein, α_(TOP_U) is the fifth threshold and α_(TOP_D) is the sixth threshold. Optionally, the fifth and sixth thresholds can be preset in the terminal device by the developers. For example, the fifth threshold can be 80% and the sixth threshold can be 30%.

[0092] Optionally, in this solution, the process of adjusting the operating frequency of the GPU's computing unit to the second frequency and the operating voltage of the GPU's computing unit to the second voltage, so that the power consumption of the GPU's computing unit during its working cycle is minimized, can be as follows:

[0093] Optionally, the terminal device can also compare the obtained sub-core energy utilization rate αCORE with the fifth threshold. When αCORE > the seventh threshold, the operating frequency of the computing unit is increased, and the operating voltage of the computing unit corresponding to the adjusted operating frequency is obtained according to v = k2*f, thereby adjusting the operating voltage of the computing unit. Alternatively, the obtained sub-core energy utilization rate αCORE can be compared with the eighth threshold. When αCORE < the eighth threshold, the operating frequency of the computing unit is decreased, and the operating voltage of the computing unit corresponding to the adjusted operating frequency is obtained according to v = k2*f, thereby adjusting the operating voltage of the computing unit. When the operating frequency of the computing unit reaches the highest frequency that can operate at the lowest operating voltage, the operating frequency of the computing unit is kept constant. The corresponding code can be as follows:

[0094] If α_CORE>α_(CORE_U)

[0095] Increase core module frequency, f_CORE##Increase the operating frequency of the computing unit.

[0096] Adjust core working voltage; ## Adjust the operating voltage of the arithmetic unit

[0097] Else If α_CORE < α_(CORE_D)

[0098] Decrease core module frequency, f_CORE ## Reduce the operating frequency of the arithmetic unit

[0099] If f_CORE reaches f_(CORE_min), then maintain f_CORE at the minimum frequency. This means that when the operating frequency of the arithmetic unit reaches the highest frequency it can operate at with the minimum operating voltage, the operating frequency of the arithmetic unit should remain constant.

[0100] Adjust core working voltage; ## Adjust the operating voltage of the arithmetic unit

[0101] Endif

[0102] Wherein, the seventh threshold value is a CORE U, the eighth threshold value is a CORE D, optionally, the seventh threshold value and the eighth threshold value can be pre-set in the terminal device by the developer, for example, the seventh threshold value can be 80%, and the eighth threshold value can be 30%.

[0103] In the above content, since the actual GPU has a minimum working voltage limit, when the working voltage of the top model in the GPU reaches the minimum working voltage, and the working voltage of the operation unit in the GPU reaches the minimum working voltage, the above v can also be regarded as a constant, so the dynamic power consumption of the GPU corresponding to the power consumption E can be obtained by derivation dyn = P dyn t = k4w

[0104] The static power consumption of the GPU corresponds to the power consumption

[0105] Therefore, the scheme keeps the working frequency unchanged at the minimum working voltage, prevents the problem of increasing static power consumption caused by continuously reducing the working frequency, that is, in the process of adjusting the working frequency of the GPU and the working voltage of the GPU to make the power consumption of the GPU in the working cycle reach the minimum value, when the working voltage of the GPU reaches the minimum working voltage, the working frequency of the GPU is kept unchanged.

[0106] In a possible implementation manner, the terminal device can further obtain the adjusted working frequency of the top model of the GPU and the working frequency of the top model of the GPU before adjustment after adjusting the working frequency of the top model of the GPU to the first frequency and adjusting the working voltage of the top model of the GPU to the first voltage to make the power consumption of the top model of the GPU in the working cycle reach the minimum value; when the ratio between the adjusted working frequency of the top model of the GPU and the working frequency of the top model of the GPU before adjustment is greater than a third threshold value, the working frequency of the double-rate DDR storage system is increased; when the ratio between the adjusted working frequency of the top model of the GPU and the working frequency of the top model of the GPU before adjustment is less than a fourth threshold value, the working frequency of the DDR storage system is reduced; when the ratio between the adjusted working frequency of the top model of the GPU and the working frequency of the top model of the GPU before adjustment is within the range of the fourth threshold value and the third threshold value, the working frequency of the DDR storage system is kept unchanged; wherein, the third threshold value is greater than the fourth threshold value.

[0107] Optionally, in this application, the GPU can be located within a System-on-a-Chip (SoC) architecture. The tasks processed by the GPU can also involve other subsystems within the SoC system. When the GPU's processing load changes, the frequencies of other subsystems also need to be adjusted to improve the SoC's energy efficiency. Subsystems related to the GPU include Double Data Rate (DDR) memory systems, CPU systems, and display systems.

[0108] Please refer to Figure 4 This illustrates a schematic diagram of a SOC system architecture according to an exemplary embodiment of this application. Figure 4 As shown, the SOC architecture 400 includes a CPU 401, a GPU 402, a display system 403, and a DDR storage system 404. The terminal device can further adjust the operating frequency of the DDR storage system after adjusting the GPU's top-level module's operating frequency and voltage to a first level to minimize the power consumption of the GPU's top-level module during its operating cycle, thereby improving the SOC's energy efficiency.

[0109] Optionally, the code for adjusting the operating frequency of the DDR memory system can be as follows:

[0110] If f_(TOP_curr) / f_(TOP_prev)>f_(TOP_ratio_u)

[0111] IncreaseDDRfrequency, f_(DDR_freq); ## Increase the operating frequency of the DDR memory system.

[0112] Adjust DDR working voltage; ## Adjust the working voltage of the DDR memory system

[0113] Else if f_(TOP_curr) / f_(TOP_prev) <f_(TOP_ratio_d)

[0114] DecreaseDDRfrequency, f_(DDR_freq); ## Reduce the operating frequency of the DDR memory system.

[0115] Adjust DDR working voltage; ## Adjust the working voltage of the DDR memory system

[0116] Else

[0117] Maintain DDR frequency.

[0118] Endif

[0119] Wherein, f_(TOP_curr) is the adjusted working frequency of the top module of the GPU, f_(TOP_prev) is the working frequency of the top module of the GPU before adjustment, f_(TOP_ratio_u) is the third threshold value, f_(TOP_ratio_d) is the fourth threshold value. Optionally, the third threshold value and the fourth threshold value can be pre-set in the terminal device by the developer, for example, the third threshold value can be 2, and the fourth threshold value can be 1 / 2. Optionally, the working frequency increased or decreased each time for the DDR storage system can be half of the working frequency of the current DDR storage system.

[0120] It should be noted that the present scheme can also adjust the working voltage and working frequency of the display system and CPU in the SOC architecture, thereby improving the energy efficiency of the SOC. The manner can refer to the adjustment manner of the DDR storage system, which will not be described here.

[0121] In summary, the present application obtains the working period and working voltage of the GPU, obtains the power consumption of the GPU in the working period according to the working period and working voltage, adjusts the working frequency of the GPU and the working voltage of the GPU, so that the power consumption of the GPU in the working period reaches the minimum value, so that the power consumption of the GPU in the working period reaches the minimum value. The present application adjusts the working frequency of the GPU and the working voltage of the GPU based on the minimum power consumption, which can avoid the situation that the power consumption of the GPU still increases during the process of reducing the working frequency of the GPU, improves the endurance of the terminal device, and reduces the waste of power of the terminal device.

[0122] In addition, the present application can flexibly change the execution strength of the GPU on the load by adjusting the number of operation units in the GPU, thereby improving the energy efficiency of the GPU of the terminal device. The present application can also adjust the working frequency and working voltage of other subsystems on the SOC system architecture, thereby improving the energy efficiency of the SOC.

[0123] Taking a mobile phone as an example, the mobile phone adjusts the working voltage and working frequency of the GPU by the improved DVFS mechanism in the present scheme during running of a game application, thereby prolonging the duration of the mobile phone and improving the endurance.

[0124] Please refer to Figure 5 which shows a method flowchart of a GPU control method provided by an example embodiment of the present application. The GPU control method can be used in a terminal device. Figure 5 As shown in the figure, the GPU control method can include the following steps:

[0125] Step 501, detect whether α_TOP is greater than α_(TOP_U).

[0126] If yes, execute step 502, otherwise execute step 503.

[0127] Step 502, increase the operating frequency of the top module, and adjust the operating voltage of the top module.

[0128] Step 503, detect whether α_TOP is less than α_(TOP_D).

[0129] If yes, execute step 504, otherwise execute step 505.

[0130] Step 504, decrease the operating frequency of the top module, and adjust the operating voltage of the top module.

[0131] Step 505, detect whether α_CORE is greater than α_(CORE_U).

[0132] If yes, execute step 506, otherwise execute step 507.

[0133] Step 506, increase the operating frequency of the arithmetic unit, and adjust the operating voltage of the arithmetic unit.

[0134] Step 507, detect whether α_CORE is less than α_(CORE_D).

[0135] If yes, execute step 508, otherwise execute step 509.

[0136] Step 508, decrease the operating frequency of the arithmetic unit, and adjust the operating voltage of the arithmetic unit.

[0137] Step 509, calculate β.

[0138] Step 510, detect whether β is greater than β U .

[0139] If yes, execute step 511, otherwise execute step 512.

[0140] Step 511, increase the number of arithmetic units that are running.

[0141] Step 512, detect whether β is less than β D .

[0142] If yes, execute step 513, otherwise keep the number of arithmetic units that are running unchanged.

[0143] Step 513, decrease the number of arithmetic units that are running.

[0144] Optionally, each of the above parameters can beFigure 2 The various parameters in the embodiments have the same meanings, which will not be repeated here. It should be noted that the execution of steps 501 to 504 can be simultaneous with the execution of steps 505 to 508, or the order can be adjusted, which will not be repeated here.

[0145] In step 514, the power consumption of the GPU in the working cycle is obtained, and the working frequency of the GPU and the working voltage of the GPU are adjusted so that the power consumption of the GPU in the working cycle reaches a minimum value.

[0146] In summary, the present application obtains the working cycle and the working voltage of the GPU, obtains the power consumption of the GPU in the working cycle according to the working cycle and the working voltage, and adjusts the working frequency of the GPU and the working voltage of the GPU so that the power consumption of the GPU in the working cycle reaches a minimum value. The present application adjusts the working frequency of the GPU and the working voltage of the GPU based on the minimum power consumption, which can avoid the situation that the power consumption of the GPU still increases during the reduction of the working frequency of the GPU, improves the endurance of the terminal device, and reduces the waste of power of the terminal device.

[0147] The following is an apparatus embodiment of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the apparatus embodiments of the present application, please refer to the method embodiments of the present application.

[0148] Please refer to Figure 6 , which shows a structural block diagram of a GPU control device provided by an exemplary embodiment of the present application. The GPU control device 600 can be used in a terminal device to execute all or part of the steps performed by the terminal device in the methods provided by the embodiments shown in Figure 1 , Figure 2 or Figure 5 . The GPU control device 600 includes:

[0149] A first obtaining module 601 is configured to obtain the working cycle and the working voltage of the GPU.

[0150] A second obtaining module 602 is configured to obtain the power consumption of the GPU in the working cycle according to the working cycle and the working voltage.

[0151] A parameter adjusting module 603 is configured to adjust the working frequency of the GPU and the working voltage of the GPU so that the power consumption of the GPU in the working cycle reaches a minimum value.

[0152] In conclusion, the application obtains the working period and working voltage of a graphic processing unit (GPU), and obtains the power consumption of the GPU in the working period according to the working period and working voltage. The working frequency and working voltage of the GPU are adjusted so that the power consumption of the GPU in the working period reaches a minimum value. The working frequency and working voltage of the GPU are adjusted based on the minimum power consumption, which can avoid the situation that the power consumption of the GPU still increases when the working frequency of the GPU is reduced, improve the endurance of the terminal device, and reduce the waste of power of the terminal device.

[0153] Optionally, the apparatus further comprises a third obtaining module and a first adjusting module

[0154] The third obtaining module is configured to, before the step of obtaining the power consumption of the GPU in the working period according to the working period and the working voltage, obtain the energy utilization rate of a top model of the GPU and a sub-core energy utilization rate, the sub-core energy utilization rate being an average utilization rate of energy utilization rates of each running operation unit in the GPU.

[0155] The first adjusting module is configured to adjust the number of each running operation unit in the GPU according to the energy utilization rate of the top model and the sub-core energy utilization rate.

[0156] The second obtaining module is configured to obtain the power consumption of the GPU in the working period according to the working period, the working voltage, and the number of each running operation unit in the GPU.

[0157] Optionally, the first adjusting module comprises a first calculating unit, a first increasing unit, and a first reducing unit.

[0158] The first calculating unit is configured to calculate a first proportion value according to the energy utilization rate of the top model and the sub-core energy utilization rate.

[0159] The first increasing unit is configured to, when the first proportion value is greater than a first threshold value, increase a first preset number of operation units on the basis of the number of each running operation unit in the GPU.

[0160] The first reducing unit is configured to, when the first proportion value is less than a second threshold value, reduce a first preset number of operation units on the basis of the number of each running operation unit in the GPU.

[0161] Optionally, the first reducing unit comprises a first determining sub-unit and a first reducing sub-unit.

[0162] The first determining sub-unit is configured to determine a task priority of each running operation unit in the GPU when the first ratio value is less than a second threshold value.

[0163] The first reducing sub-unit is configured to sequentially reduce a first preset number of operation units from the running operation units in the GPU according to the task priority from low to high.

[0164] Optionally, the parameter adjustment module comprises a second adjustment module and a third adjustment module.

[0165] The second adjustment module is configured to adjust a working frequency of a top module of the GPU to a first frequency and adjust a working voltage of the top module of the GPU to a first voltage, so that a power consumption of the top module of the GPU in the working cycle reaches a minimum value.

[0166] The third adjustment module is configured to adjust a working frequency of an operation unit of the GPU to a second frequency and adjust a working voltage of the operation unit of the GPU to a second voltage, so that a power consumption of the operation unit of the GPU in the working cycle reaches a minimum value.

[0167] Optionally, the device further comprises:

[0168] The fourth acquisition module is configured to acquire the adjusted working frequency of the top module of the GPU and the working frequency of the top module of the GPU before the adjustment after the working frequency of the top module of the GPU is adjusted to the first frequency and the working voltage of the top module of the GPU is adjusted to the first voltage, so that the power consumption of the top module of the GPU in the working cycle reaches the minimum value.

[0169] The second increasing module is configured to increase a working frequency of a double-rate DDR storage system when a ratio between the adjusted working frequency of the top module of the GPU and the working frequency of the top module of the GPU before the adjustment is greater than a third threshold value.

[0170] The second reducing module is configured to reduce the working frequency of the DDR storage system when the ratio between the adjusted working frequency of the top module of the GPU and the working frequency of the top module of the GPU before the adjustment is less than a fourth threshold value.

[0171] The first keeping module is configured to keep the working frequency of the DDR storage system unchanged when the ratio between the adjusted working frequency of the top module of the GPU and the working frequency of the top module of the GPU before the adjustment is within a range of the fourth threshold value and the third threshold value, wherein the third threshold value is greater than the fourth threshold value.

[0172] Optionally, in the process of adjusting the working frequency of the GPU to the target frequency and adjusting the working voltage of the GPU to the target voltage, when the working voltage of the GPU reaches the minimum working voltage, the working frequency of the GPU is controlled to remain unchanged.

[0173] Figure 7 is a structural schematic diagram of a terminal device provided by an exemplary embodiment of the present application. As shown in Figure 7 the terminal device 700 includes a central processing unit (CPU) 701, a system memory 704 including a random access memory (RAM) 702 and a read only memory (ROM) 703, and a system bus 705 connecting the system memory 704 and the central processing unit 701. The terminal device 700 also includes a basic input / output system (I / O system) 706 to help transfer information between various devices in the computer, and a mass storage device 707 for storing an operating system 712, application programs 713, and other program modules 714.

[0174] The basic input / output system 706 includes a display 706 for displaying information and a transmission device 709 such as a mouse, a keyboard, etc. for a user to transmit information. The display 706 and the transmission device 709 are both connected to the central processing unit 701 through a transmission / output controller 710 connected to the system bus 705. The basic input / output system 706 can also include a transmission / output controller 710 for receiving and processing transmissions from a keyboard, a mouse, or a plurality of other devices such as an electronic stylus, etc. Similarly, the transmission / output controller 710 also provides output to a display screen, a printer, or other types of output devices.

[0175] The mass storage device 707 is connected to the central processing unit 701 through a mass storage controller (not shown) connected to the system bus 705. The mass storage device 707 and its associated computer readable medium provide non-volatile storage for the terminal device 700. That is, the mass storage device 707 can include a computer readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.

[0176] The computer readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid state memory technology, CD-ROM, digital versatile disks (Digital Video Disc, High Definition Video Disc), or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices. Of course, the computer storage media is not limited to the above-mentioned several. The system memory 704 and the mass storage device 707 described above can be collectively referred to as memory.

[0177] The terminal device 700 can be connected to the Internet or other network devices through a network interface unit 711 connected to the system bus 705. The memory further includes one or more programs, which are stored in the memory.

[0178] The embodiments of the present application also provide a computer readable medium, which stores at least one instruction, the at least one instruction is loaded and executed by the processor to implement all or part of the steps performed by the terminal device in the control method of the graphic processing unit according to the above various embodiments.

[0179] The embodiments of the present application also provide a computer program product, which stores at least one instruction, the at least one instruction is loaded and executed by the processor to implement all or part of the steps performed by the terminal device or the server in the control method of the graphic processing unit according to the above various embodiments.

[0180] It should be noted that: the apparatus provided by the above embodiments in the execution of the control of the terminal device, only the above-mentioned each functional module is divided and illustrated, in actual application, can be required to be completed by different functional modules, namely the internal structure of the device is divided into different functional modules, in order to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be described here.

[0181] The above-mentioned serial numbers of the embodiments of the present application are only for description, not representing the advantages and disadvantages of the embodiments.

[0182] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or can be instructed by a program to complete the related hardware, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0183] The above only describes optional embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A control method for a graphics processing unit, characterized in that, Applied to a terminal device, the method includes: Obtain the operating cycle and operating voltage of the graphics processing unit (GPU); The energy utilization rate of the top module and the energy utilization rate of the sub-cores of the GPU are obtained. The energy utilization rate of the sub-cores is the average energy utilization rate of each running computing unit in the GPU. The number of each running computing unit in the GPU is adjusted based on the energy utilization rate of the top module and the energy utilization rate of the sub-cores. Based on the working cycle, the operating voltage, and the number of each running computing unit in the GPU, the power consumption of the GPU during the working cycle is obtained; Adjust the GPU's operating frequency and operating voltage to minimize the GPU's power consumption during the operating cycle.

2. The method according to claim 1, characterized in that, The step of adjusting the number of each running computing unit in the GPU based on the energy utilization rate of the top module and the energy utilization rate of the sub-cores includes: Calculate the first ratio value based on the energy utilization rate of the top mode and the energy utilization rate of the daughter core; When the first ratio value is greater than the first threshold, the number of computing units is increased by a first preset number based on the number of computing units currently running in the GPU; When the first ratio value is less than the second threshold, the number of computing units in the GPU is reduced by a first preset number based on the number of computing units currently running.

3. The method according to claim 2, characterized in that, When the first ratio value is less than the second threshold, reducing the number of operating computing units in the GPU by a first preset number of computing units includes: When the first ratio value is less than the second threshold, the task priority of each running computing unit in the GPU is determined; According to the task priority from low to high, the number of running computing units in the GPU is reduced by a first preset number of computing units in turn.

4. The method according to claim 1, characterized in that, Adjusting the GPU's operating frequency and operating voltage to minimize the GPU's power consumption during the operating cycle includes: The operating frequency of the GPU's top module is adjusted to a first frequency, and the operating voltage of the GPU's top module is adjusted to a first voltage, so that the power consumption of the GPU's top module during the duty cycle is minimized; and, The operating frequency of the GPU's computing unit is adjusted to a second frequency, and the operating voltage of the GPU's computing unit is adjusted to a second voltage, so that the power consumption of the GPU's computing unit during the working cycle is minimized.

5. The method according to claim 4, characterized in that, After adjusting the operating frequency of the GPU's top module to a first frequency and adjusting the operating voltage of the GPU's top module to a first voltage, so that the power consumption of the GPU's top module during the duty cycle reaches a minimum, the method further includes: Obtain the adjusted operating frequency of the GPU's top module and the operating frequency of the GPU's top module before adjustment; When the ratio between the adjusted operating frequency of the GPU's top module and the original operating frequency of the GPU's top module is greater than the third threshold, the operating frequency of the double-rate DDR memory system is increased. When the ratio between the adjusted operating frequency of the GPU's top module and the operating frequency of the GPU's top module before adjustment is less than the fourth threshold, the operating frequency of the DDR memory system is reduced. When the ratio between the adjusted operating frequency of the GPU's top module and the unadjusted operating frequency of the GPU's top module is within the range of the fourth threshold and the third threshold, the operating frequency of the DDR memory system remains unchanged; wherein the third threshold is greater than the fourth threshold.

6. The method according to any one of claims 1 to 5, characterized in that, During the process of adjusting the GPU's operating frequency to the target frequency and the GPU's operating voltage to the target voltage, when the GPU's operating voltage reaches the minimum operating voltage, the GPU's operating frequency is kept constant.

7. A control device for a graphics processing unit, characterized in that, Applied to a terminal device, the device includes: The first acquisition module is used to acquire the working cycle and operating voltage of the graphics processing unit (GPU). The third acquisition module is used to acquire the energy utilization rate of the top module and the energy utilization rate of the sub-core of the GPU. The energy utilization rate of the sub-core is the average energy utilization rate of each running computing unit in the GPU. The first adjustment module is used to adjust the number of each running computing unit in the GPU according to the energy utilization rate of the top module and the energy utilization rate of the sub-core. The second acquisition module is used to acquire the power consumption of the GPU during the working cycle based on the working cycle, the working voltage, and the number of each running computing unit in the GPU. The parameter adjustment module is used to adjust the operating frequency and operating voltage of the GPU so that the power consumption of the GPU during the working cycle is minimized.

8. A terminal device, characterized in that, The terminal device includes a processor and a memory, the memory storing at least one instruction, at least one program, code set, or instruction set, the at least one instruction, the at least one program, the code set, or the instruction set being loaded and executed by the processor to implement the control method of the graphics processing unit as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the control method of the graphics processing unit as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • SOC method for low-power-consumption GPU

    CN107168457A

  • Integrated circuit performing dynamic voltage and frequency regulation operation and method of operation thereof

    CN114594849A