Dynamic power management method, device and equipment for graphics processor of embedded system
By defining power consumption levels and initializing related modules in an embedded system, dynamically managing the power supply of the graphics processor, solving the complexity and unsupported GPU power management solution in the prior art, and realizing GPU power management support in an embedded environment.
Patent Information
- Application Number
- CN202411664372.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-02-28
AI Technical Summary
GPU power management solutions in existing embedded environments are complex in terms of power consumption and performance balance, and GPU power management functions are not supported in systems without BIOS/UEFI/ACPI.
It provides a dynamic power management method for graphics processors in embedded systems. By defining the power consumption level of the graphics processor, initializing the state sampling module and decision module, periodically collecting the graphics processor status data, determining the GPU target level based on utilization and decision strategy, and determining the processing strategy by comparing the target level with the current power state, and finally executing the power management strategy.
A considerable degree of GPU power management support is implemented in an embedded system with a simple operating environment. Users can add policies according to the hardware situation to implement power management of different granularities, solving the problems of complexity and unsupport.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of graphics processor power management, and in particular to a method, device and equipment for dynamic power management of an embedded system graphics processor. Background Art
[0002] The current mainstream embedded / non-embedded OS all support power management at the system level. This support has a long history and is still in the process of continuous evolution, such as general Linux versions, Android systems, etc.
[0003] Graphics processor (GPU) is one of the main components of power consumption and is also a prominent core feature in power management support. In addition, due to the high hardware complexity of GPU, it is necessary to design the software framework in combination with the hardware implementation, and it is likely to integrate the manufacturer's SDK to achieve a relatively ideal power management effect. Taking NIVDIA, a leading GPU manufacturer, as an example, NVML (NVIDIA Management Library) is used to manage and monitor the relevant parameters and status of NVIDIA GPU. It provides a programming interface that allows developers to access and control various attributes of the graphics card, such as temperature, power consumption, usage, performance status, etc. AMD, another major GPU manufacturer, has a GPU Linux power management framework that is a complex system composed of kernel modules, user space tools, and ACPI methods, in which ACPI and BIOS are involved.
[0004] GPU power management solutions for embedded environments have already provided good support for the balance between power consumption and performance. The disadvantage is that the solutions are often complex and require the participation of kernel space, user space, BIOS, ACPI, etc. GPU power management functions are not supported in some systems with simpler operating environments (such as those without BIOS / UEFI / ACPI). Summary of the invention
[0005] Based on this, it is necessary to provide a method, device and equipment for dynamic power management of an embedded system graphics processor in order to solve the above technical problems.
[0006] A dynamic power management method for a graphics processor of an embedded system, the method comprising: Defines the power consumption level of a graphics processor.
[0007] The embedded system enters the initialization phase, initializes the state sampling module and decision module of the graphics processor, and defines the decision strategy in the decision module.
[0008] The state sampling module is used to periodically collect state data of the graphics processor; the state data includes the utilization rate of the graphics processor and the current power state of the graphics processor.
[0009] The decision module obtains the GPU utilization from the state sampling module, and determines the corresponding GPU target level according to the GPU utilization and the decision strategy.
[0010] The target level is compared with the current power state to determine the handling strategy.
[0011] The execution module manages the power of the graphics processor according to the processing strategy.
[0012] In one embodiment, the decision strategy includes: the software does not make any settings for the GPU power management, and the GPU performs power management according to its own firmware program; manually setting the GPU power parameters through the debugging interface; low power strategy; high power strategy; standard power strategy; using the minimum GPU clock strategy; using the minimum GPU memory clock strategy; and using the GPU power management strategy of maximum peak power.
[0013] In one of the embodiments, the power consumption level includes three levels; the first level is a low power consumption state, the second level is a standard power consumption state, and the third level is a high power consumption state; corresponding parameter setting values are set for each power consumption level, and the parameters include: core voltage, core frequency, and video memory frequency.
[0014] In one embodiment, the target level is compared to the current power state to determine a processing strategy, including: The target level is compared to the current power state.
[0015] If the target level is greater than the current power state, the processing strategy is to increase the current power state of the graphics processor by one level.
[0016] If the target level is less than the current power state, the processing strategy is to reduce the current power state of the graphics processor by one level.
[0017] If the target level is lower than the current power state, the processing strategy is to keep the current power state of the graphics processor unchanged and continue to determine the target level at the next moment.
[0018] In one embodiment, the execution module performs power management on the graphics processor according to the processing strategy, including: When the processing strategy is to increase the current power state of the graphics processor by one level, the frequency and voltage of the first-level GPU are increased, and then the decision-making loop for the next moment is entered.
[0019] When the processing strategy is to reduce the current power state of the graphics processor by one level, the frequency and voltage of the first-level GPU are reduced, and then the decision-making loop of the next moment is entered.
[0020] In one of the embodiments, the method further includes: if a fan air adjustment module exists, after increasing or decreasing the frequency and voltage of the GPU, adjusting the fan speed according to the frequency and voltage of the GPU.
[0021] A dynamic power management device for a graphics processor of an embedded system, the device comprising: The power consumption level setting unit is used to define the power consumption level of the graphics processor.
[0022] The sampling unit is used to periodically collect the state data of the graphics processor using the state sampling module when the embedded system enters the initialization phase; the state data includes the utilization rate of the graphics processor and the current power state of the graphics processor.
[0023] The decision unit is used to initialize the decision unit and define the decision strategy when the embedded system enters the initialization phase; obtain the graphics processor utilization from the state sampling unit, and determine the corresponding GPU target level according to the graphics processor utilization and the decision strategy; compare the target level with the current power state to determine the processing strategy.
[0024] The execution unit is used to manage the power of the graphics processor according to the processing policy.
[0025] In one embodiment, the decision strategies in the decision unit include: the software does not make any settings for the GPU power management, and the GPU performs power management according to its own firmware program; manually setting the GPU power parameters through the debugging interface; low power strategy; high power strategy; standard power strategy; using the minimum GPU clock strategy; using the minimum GPU memory clock strategy; and using the GPU power management strategy of maximum peak power.
[0026] In one of the embodiments, the power consumption level in the power consumption level setting unit includes three levels; the first level is a low power consumption state, the second level is a standard power consumption state, and the third level is a high power consumption state; corresponding parameter setting values are set for each power consumption level, and the parameters include: core voltage, core frequency, and video memory frequency.
[0027] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0028] The above-mentioned embedded system graphics processor dynamic power management method, device and equipment, the method includes: defining the energy consumption level of the graphics processor; when the embedded system enters the initialization stage, the state sampling module and decision module of the graphics processor are initialized, and the decision strategy is defined in the decision module; the state sampling module is used to periodically collect the state data of the graphics processor; the state data includes the graphics processor utilization rate and the current power state of the graphics processor; the decision module obtains the graphics processor utilization rate from the state sampling module, and determines the corresponding GPU target level according to the graphics processor utilization rate and the decision strategy; compares the target level with the current power state to determine the processing strategy; the execution module performs power management on the graphics processor according to the processing strategy. This method can achieve a considerable degree of GPU power management support in embedded systems with simple operating environments; users can add more policy definitions according to the actual hardware conditions to achieve GPU power management at different granularities. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of a flow chart of a dynamic power management method for a graphics processor of an embedded system in one embodiment; Figure 2 A flowchart of dynamic power management of a graphics processor in another embodiment; Figure 3 A structural block diagram of a dynamic power management device for a graphics processor of an embedded system in one embodiment; Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] The software module of the dynamic power management method for the embedded system graphics processor proposed in this application is mainly divided into three levels, namely the configuration interface layer, the driver management layer and the hardware setting layer. The calling relationship of these three levels is: the configuration interface layer calls the driver management layer, the driver management layer calls the hardware setting layer, and the hardware setting layer is the bottom layer.
[0032] After each layer of modules is initialized or defined, it provides a callable program interface for the upper layer. The upper layer modules determine the scheduling strategy and method, and the bottom layer of hardware settings is responsible for the final hardware settings.
[0033] GPU dynamic power management requires support from both software systems and GPU hardware.
[0034] In one embodiment, Figure 1 As shown, a method for dynamic power management of a graphics processor of an embedded system is provided, the method comprising the following steps: Step 100: Define the power consumption level of the graphics processor.
[0035] Specifically, the definition of the power consumption level parameter can make a specific quantitative definition of the managed power consumption level so that the software system can make power consumption switching decisions.
[0036] Step 102: The embedded system enters the initialization phase, initializes the state sampling module and decision module of the graphics processor, and defines a decision strategy in the decision module.
[0037] Specifically, power management policies are some high-level abstractions of power management. They are related to the operating state of the graphics processor (i.e., graphics card, also referred to as GPU) but not absolutely corresponding. A policy can cover a group of GPU operating states with similar states. Users can add more policy definitions based on the actual hardware conditions to achieve GPU power management at different granularities.
[0038] Step 104: using a state sampling module to periodically collect state data of the graphics processor; the state data includes the utilization rate of the graphics processor and the current power state of the graphics processor.
[0039] Specifically, after the system is started, the state sampling module is responsible for periodically collecting data on the GPU state.
[0040] Step 106: The decision module obtains the GPU utilization from the state sampling module, and determines the corresponding GPU target level according to the GPU utilization and the decision strategy.
[0041] Specifically, the decision module also starts running after the system is started. First, the power management strategy is converted into a data structure that the system can recognize. Then the GPU utilization is obtained from the sampling module. The task volume is obtained through comprehensive calculation with the decision strategy. Finally, the GPU target level that matches the task volume is obtained.
[0042] Step 108: Compare the target level with the current power state and determine a processing strategy.
[0043] Specifically, the embedded host software system interprets the power consumption level and handles the switching logic.
[0044] If the target level is greater than the current GPU power state, the frequency and voltage of the first-level GPU are increased, and then the next decision cycle is entered; if the target level is less than the current GPU power state, the execution module interface is called to reduce the frequency and voltage of the first-level GPU, and then the next decision cycle is entered; if the target level is equal to the current GPU power state, the frequency and voltage of the first-level GPU are increased, and then nothing is done and the next decision cycle is directly entered.
[0045] The system's GPU dynamic power management process is as follows Figure 2 shown.
[0046] Step 110: The execution module performs power management on the graphics processor according to the processing strategy.
[0047] In the above-mentioned embedded system graphics processor dynamic power management method, the method includes: defining the energy consumption level of the graphics processor; when the embedded system enters the initialization stage, the state sampling module and the decision module of the graphics processor are initialized, and the decision strategy is defined in the decision module; the state sampling module is used to periodically collect the state data of the graphics processor; the state data includes the utilization rate of the graphics processor and the current power state of the graphics processor; the decision module obtains the utilization rate of the graphics processor from the state sampling module, and determines the corresponding GPU target level according to the utilization rate of the graphics processor and the decision strategy; the target level is compared with the current power state to determine the processing strategy; the execution module performs power management on the graphics processor according to the processing strategy. This method can achieve a considerable degree of GPU power management support in an embedded system with a simple operating environment; users can add more policy definitions according to the actual hardware conditions to achieve GPU power management at different granularities.
[0048] In one embodiment, the decision strategy in step 102 includes: the software does not make any settings for the power management of the GPU, and the GPU performs power management according to its own firmware program; manually setting the power parameters of the GPU through the debugging interface; low power strategy; high power strategy; standard power strategy; using the minimum GPU clock strategy; using the minimum GPU memory clock strategy; and using the GPU power management strategy of maximum peak power.
[0049] Specifically, after defining the typical power consumption state, we can continue to define several management strategies for the system to perform dynamic power management on the GPU, specifically: enum gpu_dpm_forced_level { GPU_DPM_LEVEL_AUTO = 0x1,GPU_DPM_LEVEL MANUAL, GPU_DPM_LEVEL_LOW, GPU_DPM_LEVEL_HIGH, GPU_DPM_LEVEL_PROFILE_STANDARD. GPU_DPM_LEVEL_PROFILE_MIN_SCLK, GPU_DPM_LEVEL_PROFILE_MIN_MCLK, GPU_DPM_LEVEL _PROFILE_PEAK, }; These management strategies are the GPU dynamic power management methods supported by the system. The GPU can only select one of these strategies at a time. Strategy meaning: GPU_DPM_LEVEL_AUTO: The software does not make any settings for GPU power management, and the GPU manages power according to its own firmware program; GPU_DPM_LEVEL_MANUAL: Manually set the GPU power parameters through the debug interface; GPU_DPM_LEVEL_LOW: low power policy; GPU_DPM_LEVEL_HIGH: high power policy; GPU_DPM_LEVEL_PROFILE_STANDARD: Standard power policy; GPU_DPM_LEVEL_PROFILE_MIN_SCLK: Use the minimum GPU clock strategy GPU_DPM_LEVEL_PROFILE_MIN_MCLK: Use the minimum GPU memory clock strategy; GPU_DPM_LEVEL_PROFILE_PEAK: Use the GPU power management policy with maximum peak power.
[0050] In one embodiment, the power consumption level defined in step 100 includes three levels; the first level is a low power consumption state, the second level is a standard power consumption state, and the third level is a high power consumption state; corresponding parameter setting values are set for each power consumption level, and the parameters include: core voltage, core frequency, and video memory frequency.
[0051] Specifically, several typical power consumption states of a GPU are defined as shown in Table 1.
[0052] Table 1 Definition of three typical power consumption states
[0053] In one embodiment, step 108 includes: comparing the target level and the current power state; if the target level is greater than the current power state, the processing strategy is to increase the current power state of the graphics processor by one level; if the target level is less than the current power state, the processing strategy is to reduce the current power state of the graphics processor by one level; if the target level is less than the current power state, the processing strategy is to keep the current power state of the graphics processor unchanged and continue to determine the target level at the next moment.
[0054] In one embodiment, step 110 includes: when the processing strategy is to increase the current power state of the graphics processor by one level, the frequency and voltage of the first-level GPU are increased, and then the decision loop for the next moment is entered; when the processing strategy is to decrease the current power state of the graphics processor by one level, the frequency and voltage of the first-level GPU are decreased, and then the decision loop for the next moment is entered.
[0055] In one of the embodiments, the method further includes: if a fan air adjustment module exists, after increasing or decreasing the frequency and voltage of the GPU, adjusting the fan speed according to the frequency and voltage of the GPU.
[0056] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0057] In one embodiment, Figure 3 As shown, a dynamic power management device for a graphics processor of an embedded system is provided, comprising: a power consumption level setting unit, a sampling unit, a decision unit and an execution unit, wherein: The power consumption level setting unit is used to define the power consumption level of the graphics processor.
[0058] The sampling unit is used to periodically collect the state data of the graphics processor using the state sampling module when the embedded system enters the initialization phase; the state data includes the utilization rate of the graphics processor and the current power state of the graphics processor.
[0059] The decision unit is used to initialize the decision unit and define the decision strategy when the embedded system enters the initialization phase; obtain the graphics processor utilization from the state sampling unit, and determine the corresponding GPU target level according to the graphics processor utilization and the decision strategy; compare the target level with the current power state to determine the processing strategy.
[0060] The execution unit is used to manage the power of the graphics processor according to the processing policy.
[0061] In one embodiment, the decision strategies in the decision unit include: the software does not make any settings for the GPU power management, and the GPU performs power management according to its own firmware program; manually setting the GPU power parameters through the debugging interface; low power strategy; high power strategy; standard power strategy; using the minimum GPU clock strategy; using the minimum GPU memory clock strategy; and using the GPU power management strategy of maximum peak power.
[0062] In one of the embodiments, the power consumption level in the power consumption level setting unit includes three levels; the first level is a low power consumption state, the second level is a standard power consumption state, and the third level is a high power consumption state; corresponding parameter setting values are set for each power consumption level, and the parameters include: core voltage, core frequency, and video memory frequency.
[0063] In one of the embodiments, the decision unit is further used to compare the target level with the current power state; if the target level is greater than the current power state, the processing strategy is to increase the current power state of the graphics processor by one level; if the target level is less than the current power state, the processing strategy is to reduce the current power state of the graphics processor by one level; if the target level is less than the current power state, the processing strategy is to keep the current power state of the graphics processor unchanged and continue to determine the target level at the next moment.
[0064] In one of the embodiments, the execution unit is further configured to, when the processing strategy is to increase the current power state of the graphics processor by one level, increase the frequency and voltage of the first-level GPU, and then enter the decision loop at the next moment; when the processing strategy is to decrease the current power state of the graphics processor by one level, decrease the frequency and voltage of the first-level GPU, and then enter the decision loop at the next moment.
[0065] In one of the embodiments, the execution unit is further configured to adjust the fan speed according to the frequency and voltage of the GPU after increasing or decreasing the frequency and voltage of the GPU if a fan air adjustment module exists.
[0066] For the specific definition of the dynamic power management device for an embedded system graphics processor, please refer to the definition of the dynamic power management method for an embedded system graphics processor in the above text, which will not be repeated here. Each module in the above-mentioned dynamic power management device for an embedded system graphics processor can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0067] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a dynamic power management method for an embedded system graphics processor is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse, etc.
[0068] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0069] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the above method embodiment when executing the computer program.
[0070] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0071] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A dynamic power management method for an embedded system graphics processor, characterized in that: The method comprises: Define the power consumption level of the graphics processor; The embedded system enters the initialization phase, initializes the state sampling module and decision module of the graphics processor, and defines the decision strategy in the decision module; The state sampling module is used to periodically collect state data of the graphics processor; the state data includes the utilization rate of the graphics processor and the current power state of the graphics processor; The decision module obtains the graphics processor utilization from the state sampling module, and determines the corresponding GPU target level according to the graphics processor utilization and the decision strategy; comparing the target level with the current power state to determine a processing strategy; The execution module performs power management on the graphics processor according to the processing strategy.
2. The method according to claim 1, characterized in that The decision-making strategies include: The software does not make any settings for GPU power management. The GPU manages power according to its own firmware program. Manually set the GPU power parameters through the debugging interface; Low power strategy; High power strategy; Standard power strategy; Use the minimum GPU clock strategy; Use the minimum GPU memory clock strategy; And a GPU power management strategy that uses maximum peak power.
3. The method according to claim 1, characterized in that The power consumption level includes three levels; the first level is a low power consumption state, the second level is a standard power consumption state, and the third level is a high power consumption state; Corresponding parameter setting values are set for each power consumption level, and the parameters include: core voltage, core frequency and video memory frequency.
4. The method according to claim 1, characterized in that Comparing the target level with the current power state and determining a processing strategy includes: comparing the target level to the current power state; If the target level is greater than the current power state, the processing strategy is to increase the current power state of the graphics processor by one level; If the target level is less than the current power state, the processing strategy is to reduce the current power state of the graphics processor by one level; If the target level is less than the current power state, the processing strategy is to keep the current power state of the graphics processor unchanged and continue to determine the target level at the next moment.
5. The method according to claim 4, characterized in that The execution module performs power management on the graphics processor according to the processing strategy, including: When the processing strategy is to increase the current power state of the graphics processor by one level, the frequency and voltage of the first-level GPU are increased, and then the decision cycle of the next moment is entered; When the processing strategy is to reduce the current power state of the graphics processor by one level, the frequency and voltage of the first-level GPU are reduced, and then the decision-making loop of the next moment is entered.
6. The method according to claim 5, characterized in that The method further includes: if there is a fan air adjustment module, after increasing or decreasing the frequency and voltage of the GPU, adjusting the fan speed according to the frequency and voltage of the GPU.
7. A dynamic power management device for an embedded system graphics processor, characterized in that: The device comprises: A power consumption level setting unit, used for defining the power consumption level of the graphics processor; A sampling unit, used for sampling the state of the graphics processor when the embedded system enters the initialization phase, and using the state sampling module to periodically collect state data of the graphics processor; the state data includes the utilization rate of the graphics processor and the current power state of the graphics processor; A decision unit, configured to initialize the decision unit and define a decision strategy when the embedded system enters an initialization phase; obtain a graphics processor utilization rate from the state sampling unit, and determine a corresponding GPU target level according to the graphics processor utilization rate and the decision strategy; and compare the target level with the current power state to determine a processing strategy; The execution unit is used to perform power management on the graphics processor according to the processing strategy.
8. The device according to claim 7, characterized in that The decision-making strategy in the decision-making unit includes: The software does not make any settings for GPU power management. The GPU manages power according to its own firmware program. Manually set the GPU power parameters through the debugging interface; Low power strategy; High power strategy; Standard power strategy; Use the minimum GPU clock strategy; Use the minimum GPU memory clock strategy; And a GPU power management strategy that uses maximum peak power.
9. The device according to claim 7, characterized in that The power consumption level in the power consumption level setting unit includes three levels; the first level is a low power consumption state, the second level is a standard power consumption state, and the third level is a high power consumption state; Corresponding parameter setting values are set for each power consumption level, and the parameters include: core voltage, core frequency and video memory frequency.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.