Power consumption control method, device, apparatus, storage medium and computer program product

By monitoring the lifecycle events of the GPU driver and the workload container, the power consumption mode of the GPU is dynamically switched, which solves the problem of power consumption mode setting failure in the existing technology and realizes efficient operation and energy consumption management of the GPU workload.

CN120448103BActive Publication Date: 2026-03-24MOORE THREADS TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing technologies cannot reasonably control the power consumption of graphics processing units (GPUs), leading to the failure of power mode settings, affecting the operation of GPU load, and failing to meet different performance requirements.

Method used

By monitoring GPU driver configuration events and load container lifecycle events, the GPU power consumption mode can be dynamically switched to either the lowest or highest power consumption mode to meet the performance requirements of different GPU loads and save power when there is no load.

Benefits of technology

It effectively saves power consumption while meeting the performance requirements of different GPU loads, avoiding stuttering and energy waste caused by failed power mode settings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448103B_ABST
    Figure CN120448103B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a power consumption control method, device, equipment, storage medium and computer program product. The power consumption control method comprises: in response to a monitored configuration event of a GPU driver, setting a power consumption mode of the GPU to a first power consumption mode; in response to a monitored life cycle event of a load container, managing the life cycle of the load container and setting the power consumption mode of the GPU to the first power consumption mode or a second power consumption mode; wherein the first power consumption mode is a mode corresponding to the lowest power consumption in a plurality of power consumption modes supported by the GPU; and the second power consumption mode is a mode corresponding to the highest power consumption in the plurality of power consumption modes. Embodiments of the present application switch the power consumption mode of the GPU between the first power consumption mode and the second power consumption mode based on the life cycle of the load container, so as to meet the performance requirement of the GPU load in the second power consumption mode and save power consumption in the first power consumption mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power consumption control technology, and in particular to a power consumption control method, apparatus, device, storage medium, and computer program product. Background Technology

[0002] Computer power consumption control is crucial for improving performance and extending battery life. Excessive power consumption leads to overheating, reduced system stability, and shortened battery life. Therefore, properly managing the power consumption of the graphics processing unit (GPU) has become an essential technology. However, current technologies often fail to adequately control GPU power consumption to meet varying performance demands. Summary of the Invention

[0003] In view of this, embodiments of this application provide a power consumption control method, apparatus, device, storage medium, and computer program product, which improves the accuracy of power consumption control.

[0004] The technical solution of this application embodiment is implemented as follows:

[0005] In a first aspect, embodiments of this application provide a power consumption control method applied to container maintenance, comprising:

[0006] In response to a monitored configuration event from the GPU driver, the GPU's power mode is set to the first power mode.

[0007] In response to a monitored lifecycle event of a load container, the lifecycle of the load container is managed, and the power mode of the GPU is set to either a first power mode or a second power mode; the load container is a container used to perform GPU load.

[0008] Wherein, the first power consumption mode is the mode corresponding to the lowest power consumption among the multiple power consumption modes supported by the GPU; the second power consumption mode is the mode corresponding to the highest power consumption among the multiple power consumption modes.

[0009] Secondly, embodiments of this application also provide a power consumption control device applied to operation and maintenance containers, including:

[0010] The first power consumption control module is used to set the GPU's power consumption mode to the first power consumption mode in response to the monitored configuration event of the GPU driver.

[0011] The second power consumption control module is used to manage the lifecycle of the load container in response to the monitored lifecycle events of the load container, and to set the power consumption mode of the GPU to the first power consumption mode or the second power consumption mode; the load container is a container used to perform GPU load.

[0012] Wherein, the first power consumption mode is the mode corresponding to the lowest power consumption among the multiple power consumption modes supported by the GPU; the second power consumption mode is the mode corresponding to the highest power consumption among the multiple power consumption modes.

[0013] Thirdly, embodiments of this application also provide a power consumption control device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any of the power consumption control methods described above.

[0014] Fourthly, embodiments of this application also provide a storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the power consumption control method described in any of the above claims.

[0015] Fifthly, embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the power consumption control method described in any of the above claims.

[0016] In summary, in the power consumption control method provided in this application embodiment, in response to a monitored GPU driver configuration event, the GPU's power consumption mode is set to a first power consumption mode; in response to a monitored load container lifecycle event, the lifecycle of the load container is managed, and the GPU's power consumption mode is set to either the first power consumption mode or a second power consumption mode; the load container is a container used to execute GPU load; wherein, the first power consumption mode is the mode corresponding to the lowest power consumption among multiple power consumption modes supported by the GPU; and the second power consumption mode is the mode corresponding to the highest power consumption among the multiple power consumption modes. Based on the load container lifecycle, this application embodiment switches the GPU's power consumption mode between the first power consumption mode corresponding to the lowest power consumption or the second power consumption mode corresponding to the highest power consumption, thereby satisfying the performance requirements of different GPU loads in the second power consumption mode and saving power in the first power consumption mode. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form part of this specification, are embodiments consistent with this application and, together with the specification, serve to illustrate the technical solutions of this application.

[0018] Figure 1 A schematic diagram illustrating the implementation process of a power consumption control method provided in an embodiment of this application;

[0019] Figure 2 A schematic diagram illustrating the implementation flow of a driver installation method provided in an embodiment of this application;

[0020] Figure 3A schematic diagram illustrating the implementation process of a load container lifecycle management method provided in this application embodiment;

[0021] Figure 4 A block diagram illustrating the implementation of a power consumption control method provided in an embodiment of this application;

[0022] Figure 5 A schematic diagram illustrating an implementation scenario of a driver installation method provided in this application embodiment;

[0023] Figure 6 A schematic diagram illustrating an implementation scenario of a load container lifecycle management method provided in this application embodiment;

[0024] Figure 7 A schematic diagram of a power consumption control device provided in an embodiment of this application;

[0025] Figure 8 This is a schematic diagram of the hardware entity of a computer device provided in an embodiment of this application. Detailed Implementation

[0026] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0027] It should be understood that the phrases "embodiments of this application" or "foreign embodiments" throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, "embodiments of this application" or "in the foreign embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0028] Furthermore, the accompanying drawings are merely illustrative diagrams of embodiments of this application and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0029] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this disclosure. The singular forms “a,” “said,” and “the” as used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0030] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used herein is for descriptive purposes only and is not intended to limit the scope of this application.

[0032] Controlling a computer's power consumption is crucial for improving performance and extending battery life. Excessive power consumption can lead to overheating, reduced system stability, and shortened battery life. Therefore, properly managing the power consumption of the graphics processing unit (GPU) has become an essential technique.

[0033] Among the related technologies for GPU power consumption control, one method is to set an automatic adjustment mode to enable the GPU to automatically control power consumption. In automatic adjustment mode, the GPU dynamically sets the power consumption mode according to the current load. However, when setting the power consumption mode, factors such as the software version, software process, or hardware configuration of the system hosting the GPU may cause the power consumption mode setting to fail. Therefore, the load and power consumption level of some GPUs in the GPU cluster cannot be accurately configured, thus affecting the operation of the GPU load.

[0034] For example, in related technologies, when the GPU dynamically adjusts its performance state (P-state) based on the current workload by setting an automatic power mode (Auto Performance State, Auto-P-State), the P-state ranges from P0 to P15. The automatic adjustment mode typically sets the GPU's P-state to P4 or P5. When there is no load on the GPU, this results in wasted energy. Even when the GPU receives a high-power process and needs to switch to P15, the switch from P4 or P5 to P15 may still cause GPU lag.

[0035] For example, when it's necessary to adjust the GPU's power consumption level from P0 to P5, hardware enabling issues, such as the graphics card and video memory being disabled in P0 mode, might prevent the power consumption mode from switching to P5. Alternatively, software processes or other issues could also prevent the power consumption mode from switching, making it impossible to accurately configure the GPU load and power consumption level, thus affecting the GPU's performance.

[0036] Based on the above problems, this application proposes a power consumption control method. Based on the life cycle of the load container, the power consumption mode of the GPU is switched between a first power consumption mode corresponding to the lowest power consumption or a second power consumption mode corresponding to the highest power consumption. Thus, the performance requirements of different GPU loads can be met in the second power consumption mode, while power consumption is saved in the first power consumption mode.

[0037] Figure 1 This is a schematic diagram illustrating the implementation flow of a power consumption control method provided in an embodiment of this application. Figure 1 As shown, the power consumption control method applied to container operation and maintenance includes at least steps S101 to S102.

[0038] Step S101: In response to the monitored configuration event of the GPU driver, the power consumption mode of the GPU is set to the first power consumption mode; wherein, the first power consumption mode is the mode corresponding to the lowest power consumption among the multiple power consumption modes supported by the GPU.

[0039] Among them, Kubernetes GPU cluster is a system that manages and schedules GPU resources in a Kubernetes cluster. Kubernetes cluster uses the Kubernetes platform to implement container orchestration and cluster management. The Kubernetes platform is a platform used to implement container orchestration and cluster management.

[0040] Here, the operation and maintenance container is a GPU operation and maintenance container, which is a tool for managing GPU resources through the Kubernetes platform.

[0041] The GPU driver configuration event is the event for configuring the GPU driver combination, which is a combination of driver modules and related software libraries. When configuring a GPU driver combination, you can first determine the version of the driver combination corresponding to the GPU, and then configure that version of the GPU driver combination. The driver module is the GPU driver program, which is used to control and manage the GPU so that the GPU's resources are identified and utilized.

[0042] In some embodiments, the GPU supports multiple power modes. Taking a power mode range of P0 to P15 supported by the GPU as an example, P0 can represent the mode corresponding to the highest power consumption among P0 to P15; P15 can represent the mode corresponding to the lowest power consumption among P0 to P15, i.e., the first power mode. In the first power mode, the GPU will automatically reduce its performance and frequency to save energy.

[0043] In some embodiments, when the container management system detects a GPU driver configuration event, it installs a driver module for the GPU in response to the GPU driver configuration event, ensuring that subsequently created containers can use the GPU's resources. When installing the driver module for the GPU, no containers have been created yet, and there is no load on the GPU. Therefore, the GPU's power mode can be set to the first power mode, which corresponds to the lowest power consumption among the multiple power modes supported by the GPU.

[0044] For example, cluster administrators can configure GPU driver combinations, and the operation and maintenance container can monitor events related to these configurations, i.e., GPU driver configuration events. When the operation and maintenance container detects a GPU driver configuration event, it notifies the container used to install the driver module to respond to the configuration event and install the driver module. During the driver module installation process, a built-in program within the container sets the GPU's power mode to the lowest power mode among the multiple power modes supported by the GPU.

[0045] It is important to emphasize that when there are multiple GPUs on the host, the power consumption mode of each GPU is set independently. Therefore, when installing the driver module on the GPU, if there is no load on any of the GPUs, the power consumption mode of each GPU can be set to the first power consumption mode. If there is a load on a certain GPU, the power consumption mode of that GPU can be set to the first power consumption mode with the lowest power consumption or the second power consumption mode with the highest power consumption among the multiple power consumption modes supported by the GPU, depending on the actual situation.

[0046] Step S102: In response to the monitored lifecycle event of the load container, manage the lifecycle of the load container and set the power consumption mode of the GPU to the first power consumption mode or the second power consumption mode; the load container is a container used to perform GPU load; the second power consumption mode is the mode corresponding to the highest power consumption among the plurality of power consumption modes.

[0047] In some embodiments, a user may send a declaration to create a load container as needed, and the operation and maintenance container responds to the declaration to manage the lifecycle of the load container.

[0048] Here, a load container can be understood as a GPU load container, which is a container used to execute GPU loads, where GPU loads are the tasks carried by the GPU.

[0049] The aforementioned lifecycle events for load loader containers are events generated in response to receiving a declaration to create a load loader container. After monitoring a load loader container's lifecycle event, the operation and maintenance container can respond to the event, create the corresponding load loader container, and execute the operations corresponding to the start, run, stop, and delete stages of the load loader container's lifecycle, based on the actual stage of the load loader container's lifecycle management. It can be understood that executing the operations corresponding to the start, run, stop, and delete stages of the load loader container is all part of the process of managing the load loader container's lifecycle.

[0050] In some embodiments, the GPU supports multiple power modes. Taking a range of power modes supported by the GPU from P0 to P15 as an example, P0 can represent the mode corresponding to the highest power consumption among P0 to P15, i.e., the second power mode. In the second power mode, the GPU will operate at the highest possible frequency and performance level.

[0051] In some embodiments, when the operation and maintenance container monitors a lifecycle event of a load container, it manages the lifecycle of the load container in response to the lifecycle event. Different stages of the load container's lifecycle correspond to different load conditions on the GPU. Therefore, the GPU's power consumption mode can be set to either the first power consumption mode (corresponding to the lowest power consumption) or the second power consumption mode (corresponding to the highest power consumption) among the multiple power consumption modes supported by the GPU, based on the specific stage of the load container's lifecycle, to determine the GPU's power consumption mode according to the GPU load.

[0052] For example, a user can issue a declaration to create a load container, and the declaration of creating the load container can be monitored by the operational container, i.e., the lifecycle event of the load container. When the operational container detects the lifecycle event of the load container, it can notify the container that manages the lifecycle of the load container. In response to the lifecycle event, the container that manages the lifecycle of the load container configures the container runtime to manage the lifecycle of the load container. When managing the lifecycle of the load container through the container runtime, the program configured by the container that manages the lifecycle of the load container can set the power mode of the GPU to a first power mode or a second power mode.

[0053] In some embodiments, managing the lifecycle of a load container includes creating the load container, during which the GPU's power mode can be set to a second power mode. It is understood that when a load container is created, a load exists on the GPU, and the GPU's power mode can be set to the second power mode to meet the power consumption requirements of the GPU load.

[0054] In the above embodiments, when creating a load container, if there is a load on the GPU, the GPU's power consumption mode is set to the second power consumption mode, which is the highest power consumption among the multiple power consumption modes supported by the GPU, thereby meeting the performance requirements of different GPU loads.

[0055] In some embodiments, if creating a load container fails when the GPU's power mode is set to the second power mode, the load container creation operation is canceled. It is understood that if setting the GPU's power mode to the second power mode fails, the energy required for the GPU load after creating the load container may not be met, therefore the load container creation operation can be canceled.

[0056] In some embodiments, the operation and maintenance container can detect the lifecycle of the load container. If the operation of creating the load container is canceled when the GPU's power mode fails to be set to the second power mode, the load container can be recreated within a limited time after the GPU's power mode is successfully set to the second power mode during the creation of other load containers.

[0057] In some embodiments, managing the lifecycle of a load container includes deleting the load container. After deleting the load container, the GPU's power mode can be set to a first power mode. It is understood that after deleting the load container, there is no load on the GPU, and the GPU's power mode can be set to the first power mode to reduce power consumption.

[0058] In the above embodiments, after the load container is deleted and there is no load on the GPU, the GPU's power consumption mode is set to the first power consumption mode, which corresponds to the lowest power consumption among the multiple power consumption modes supported by the GPU, thereby saving power consumption.

[0059] In some embodiments, when multiple GPUs exist on the host, some GPUs may be occupied by different load containers simultaneously. After deleting a load container, the GPU may still be occupied by other load containers, resulting in a remaining load on the GPU. This prevents the GPU's power mode from being set to the first power mode. In this case, the deleted load container is still successfully deleted, but the GPU can only be set to the first power mode after all load containers occupying the GPU have been deleted.

[0060] For example, multiple GPUs on a host machine are labeled GPU1, GPU2, GPU3, and GPU4. There are two load containers: a first load container and a second load container. The first load container occupies GPU1 and GPU2, while the second load container occupies GPU2, GPU3, and GPU4. After deleting the first load container, GPU1 is no longer under load, so its power mode can be set to the first power mode. However, GPU2 remains under load due to the second load container, preventing it from being set to the first power mode. Despite this, the first load container is successfully deleted. After deleting the second load container, GPUs 2, 3, and 4 are all free of load, and their power modes can all be set to the first power mode.

[0061] In this embodiment, based on the lifecycle of the load container, the power consumption mode of the GPU is switched between the first power consumption mode corresponding to the lowest power consumption or the second power consumption mode corresponding to the highest power consumption. Thus, the performance requirements of different GPU loads can be met in the second power consumption mode, while power consumption is saved in the first power consumption mode.

[0062] In some embodiments, the operation and maintenance container is configured with a first hook program; the step of setting the power consumption mode of the GPU to a first power consumption mode in response to a monitored GPU driver configuration event includes: installing a driver module for the GPU in response to a monitored GPU driver configuration event; and setting the power consumption mode of the GPU to the first power consumption mode through the first hook program in response to the event of installing the driver module for the GPU.

[0063] In a Kubernetes GPU cluster, a management container can be used to install driver modules and create load loader containers for the GPU, enabling the load loader containers in the Kubernetes GPU cluster to utilize the resources in the GPU nodes through the resource scheduling mechanism.

[0064] In some embodiments, before creating the workload container, the Kubernetes GPU cluster administrator can configure the GPU driver combination. The operations container can monitor events that trigger the administrator's GPU driver combination configuration (i.e., GPU driver configuration events). When the operations container detects a GPU driver configuration event, it installs the driver module for the GPU in response.

[0065] The first hook procedure is used to respond to the event of installing the GPU driver module and set the GPU's power mode to the first power mode.

[0066] Here, hooks can be used to monitor and intervene in system-level or application-level event flows. The first hook, configured within the operational container, is used in response to an event indicating that a GPU driver module is installed, to set the GPU's power mode to a first power mode. The first power mode is the lowest power mode among several power modes supported by the GPU.

[0067] In some embodiments, a first hook program can be configured for the operation and maintenance container to execute after the GPU driver module is installed. The first hook program monitors the event of the GPU driver module installation. After the first hook program detects the operation of installing the GPU driver module, it sets the GPU's power consumption mode to a first power consumption mode.

[0068] In some embodiments, the first hook program can be configured within a driver installation container. The driver installation container is a container used to install driver modules for the GPU. When the maintenance container detects an event indicating that a driver module is being installed on the GPU, it can notify the driver installation container to install the driver module for the GPU in response to the event. After the first hook program detects that the driver installation container has installed the driver module for the GPU, it sets the GPU's power consumption mode to a first power consumption mode.

[0069] In the above embodiments, after the driver module is installed on the GPU, there is no load container, that is, there is no load on the GPU. The first hook program sets the power consumption mode of the GPU to the first power consumption mode corresponding to the lowest power consumption, thereby saving power consumption.

[0070] In some embodiments, the first hook procedure is further configured to determine a power control flag, and, if the power control flag indicates that power control is enabled, set the GPU's power mode to a first power mode.

[0071] Here, the power consumption control flag is used to indicate whether power consumption control is enabled.

[0072] In some embodiments, a gating system can be configured to enable and disable power consumption control based on the gating system.

[0073] In some embodiments, a power control flag can be determined by a first hook procedure to determine whether power control is enabled. If the power control flag indicates that power control is enabled, the first hook procedure can, in response to an event of GPU driver module installation, set the GPU's power mode to a first power mode.

[0074] In some embodiments, the first hook procedure is further configured to terminate power control when the power control flag indicates that power control is not enabled.

[0075] In some embodiments, a power control flag can be determined via a first hook procedure to determine whether power control is enabled. If the power control flag indicates that power control is not enabled, the first hook procedure intervenes in the power control operation of the operational container, ending power control. It is understood that after ending power control, the operational container will not set the GPU's power mode.

[0076] In some embodiments, the first hook procedure is further configured to set a driver installation identifier in the GPU after the driver module is installed on the GPU; the driver installation identifier indicates that the GPU has a driver module installed.

[0077] In some embodiments, the first hook program can monitor events of GPU driver module installation. After monitoring that the GPU has installed a driver module, the first hook program sets a driver installation flag in the GPU so that relevant programs in subsequent operations can directly determine that a driver module is installed in the GPU based on the driver installation flag.

[0078] In some embodiments, a second hook program is configured in the operation and maintenance container; the second hook program is used to determine whether the GPU has a driver module installed, and if the GPU has a driver module installed, to manage the lifecycle of the load container.

[0079] Here, the second hook is a hook configured in the operation and maintenance container to determine whether the GPU has a driver module installed.

[0080] In some embodiments, a second hook program can be configured for the operation and maintenance container to determine whether a driver module is installed on the GPU. This second hook program monitors and determines whether a driver module is installed on the GPU. If a driver module is installed on the GPU, the operation and maintenance container can manage the lifecycle of the workload container. If no driver module is installed on the GPU, the operation and maintenance container needs to install the driver module for the GPU. It is understood that if a driver module is not installed on the GPU, the system cannot recognize and utilize the GPU's resources, which will affect the management of the workload container's lifecycle.

[0081] In some embodiments, after the driver module is installed on the GPU, a first hook program can be used to set a driver installation identifier in the GPU to indicate that the driver module is installed. A second hook program can be used to determine whether the driver installation identifier exists in the GPU. If the driver installation identifier exists in the GPU, the lifecycle of the workload container can be managed through the operation and maintenance container; if the driver installation identifier does not exist in the GPU, the driver module needs to be installed on the GPU through the operation and maintenance container.

[0082] In some embodiments, the second hook can be configured within a container runtime container. The container runtime container is used to configure the container runtime. When the operation and maintenance container monitors a lifecycle event of the load container, it can notify the container runtime container to configure the container runtime in response to the load container's lifecycle event, thereby managing the lifecycle of the load container through the container runtime. When the second hook detects that the container runtime is managing the lifecycle of the load container, it can set the GPU's power mode to a first power mode or a second power mode.

[0083] In some embodiments, a third hook program is configured in the operation and maintenance container; the third hook program is used to set the power consumption mode of the GPU to a second power consumption mode when the load container is created.

[0084] Here, the third hook is a hook configured in the operation and maintenance container to set the GPU's power mode to the second power mode when the load container is created.

[0085] The second power mode is the mode with the highest power consumption among the multiple power modes supported by the GPU.

[0086] In some embodiments, a third hook can be configured to execute when a load container is created, and this third hook can monitor events related to the creation of the load container. When the third hook detects the operation of creating a load container, it sets the GPU's power mode to a second power mode.

[0087] In some embodiments, the third hook can be configured within a container runtime container. The container runtime container is used to configure the container runtime. When the operation and maintenance container monitors a lifecycle event of the load container, it can notify the container runtime container to configure the container runtime in response to the load container's lifecycle event, thereby managing the load container's lifecycle through the container runtime. Managing the load container's lifecycle includes creating the load container; when the second hook monitors the container runtime creating a load container, it can set the GPU's power mode to a second power mode.

[0088] In the above embodiments, when creating a load container, the GPU's power consumption mode is set to the second power consumption mode via a third hook program, thus bringing GPU power consumption control to the forefront and avoiding GPU lag during power consumption mode adjustment. Furthermore, after creating the load container, when there is a load on the GPU, the third hook program sets the GPU's power consumption mode to the second power consumption mode corresponding to the highest power consumption, satisfying the performance requirements of different GPU loads.

[0089] In some embodiments, a fourth hook program is configured in the operation and maintenance container; the fourth hook program is used to set the power consumption mode of the GPU to the first power consumption mode when the load container is deleted.

[0090] Here, the fourth hook is a hook configured in the operation and maintenance container to set the GPU's power mode to the first power mode when the load container is deleted.

[0091] The first power mode is the mode with the lowest power consumption among the multiple power modes supported by the GPU.

[0092] In some embodiments, a fourth hook can be configured to execute when a load container is deleted, thereby monitoring the event of the load container deletion. When the fourth hook detects the operation of deleting a load container, it sets the GPU's power mode to the first power mode.

[0093] In some embodiments, the fourth hook can be configured within a container runtime container. The container runtime container is used to configure the container runtime. When the operation and maintenance container monitors a lifecycle event of the load container, it can notify the container runtime container to respond to the load container's lifecycle event and configure the container runtime to manage the load container's lifecycle through the container runtime. Managing the load container's lifecycle includes deleting the load container. When the fourth hook detects that the container runtime has deleted a load container, it can set the GPU's power mode to a first power mode.

[0094] In the above embodiments, after the load container is deleted and there is no load on the GPU, the power consumption mode of the GPU is set to the first power consumption mode corresponding to the lowest power consumption through the fourth hook program, thereby saving power consumption.

[0095] In some embodiments, upon detecting a configuration event of the GPU driver, the GPU power mode is set to a first power mode in response to the configuration event of the GPU driver via a driver installation container; the driver installation container is configured via an operations container.

[0096] Here, the driver installation container is a container used to install driver modules for the GPU. The first power mode is the mode with the lowest power consumption among the multiple power modes supported by the GPU.

[0097] In some embodiments, when the operation and maintenance container detects an event indicating that a GPU driver module has been installed, it can notify the driver installation container to set the GPU's power mode to a first power mode in response to the event. Accordingly, in response to the GPU driver module installation event, a driver module can also be installed for the GPU.

[0098] In some embodiments, when a lifecycle event of a load container is detected, the container runtime container responds to the lifecycle event of the load container, manages the lifecycle of the load container, and sets the power consumption mode of the GPU to a first power consumption mode or a second power consumption mode; the container runtime container is configured through the operation and maintenance container.

[0099] Here, the container runtime container is a container used to configure the container runtime.

[0100] The second power mode is the mode with the highest power consumption among the multiple power modes supported by the GPU.

[0101] In some embodiments, when the operation and maintenance container monitors a lifecycle event of the load container, it can notify the container runtime to respond to the lifecycle event of the load container, configure the container runtime to manage the lifecycle of the load container through the container runtime, and set the power consumption mode of the GPU to a first power consumption mode or a second power consumption mode.

[0102] In this embodiment, based on the lifecycle of the load container, the power consumption mode of the GPU is switched between the first power consumption mode corresponding to the lowest power consumption or the second power consumption mode corresponding to the highest power consumption. Thus, the performance requirements of different GPU loads can be met in the second power consumption mode, while power consumption is saved in the first power consumption mode.

[0103] It is understandable that managing the lifecycle of a workload container involves managing and controlling its various stages, from creation, startup, and operation to stopping and deletion. Different stages of the workload container's lifecycle correspond to different load conditions on the GPU. Therefore, the GPU's power mode can be set to either a first or second power mode based on the specific stage of the workload container's lifecycle, thus determining the GPU's power mode according to the GPU load.

[0104] The following describes the application of the power consumption control method provided in the embodiments of this application in a real-world scenario.

[0105] The following problems exist in the process of implementing GPU power consumption control using related technologies:

[0106] Among the related technologies for GPU power consumption control, one method is to set an automatic adjustment mode to enable the GPU to automatically control power consumption. In automatic adjustment mode, the GPU dynamically sets the power consumption mode according to the current load. However, when setting the power consumption mode, factors such as the software version, software process, or hardware configuration of the system hosting the GPU may cause the power consumption mode setting to fail. Therefore, the load and power consumption level of some GPUs in the GPU cluster cannot be accurately configured, thus affecting the operation of the GPU load.

[0107] For example, in related technologies, when the GPU dynamically adjusts its performance state (P-state) based on the current workload by setting an automatic power mode (Auto Performance State, Auto-P-State), the P-state ranges from P0 to P15. The automatic adjustment mode typically sets the GPU's P-state to P4 or P5. When there is no load on the GPU, this results in wasted energy. Even when the GPU receives a high-power process and needs to switch to P15, the switch from P4 or P5 to P15 may still cause GPU lag.

[0108] For example, when it's necessary to adjust the GPU's power consumption level from P0 to P5, hardware enabling issues, such as the graphics card and video memory being disabled in P0 mode, might prevent the power consumption mode from switching to P5. Alternatively, software processes or other issues could also prevent the power consumption mode from switching, making it impossible to accurately configure the GPU load and power consumption level, thus affecting the GPU's performance.

[0109] Based on the above problems, this application proposes a power consumption control method. Based on the life cycle of the load container, the power consumption mode of the GPU is switched between a first power consumption mode corresponding to the lowest power consumption or a second power consumption mode corresponding to the highest power consumption. Thus, the performance requirements of different GPU loads can be met in the second power consumption mode, while power consumption is saved in the first power consumption mode.

[0110] In some embodiments, feature gating can be set in the GPU operation and maintenance container (corresponding to the operation and maintenance container in the above embodiments) to control the opening and closing of power consumption control through the switch of feature gating, and whether power consumption control is enabled can be indicated by the power consumption control flag.

[0111] In some embodiments, the GPU operation and maintenance container is configured with a GPU driver installation container (corresponding to the driver installation container in the above embodiments). A hook program (corresponding to the first hook program in the above embodiments) can be set in the GPU driver installation container to be executed after the GPU driver is installed (corresponding to the driver module in the above embodiments).

[0112] Figure 2 This is a schematic diagram illustrating the implementation flow of a driver installation method provided in an embodiment of this application, as shown below. Figure 2 As shown, the driver installation method includes at least steps S201 to S205.

[0113] Step S201: Install the driver.

[0114] In some embodiments, a GPU driver (corresponding to the driver module in the above embodiments) can be installed for the GPU through a GPU driver installation container.

[0115] Step S202: Check if the feature gating is open.

[0116] In some embodiments, the hook program executed after installing the GPU driver can check whether feature gating is enabled. If feature gating is enabled (corresponding to the power control flag indicating that power control is enabled in the above embodiments), step S203 is executed; if feature gating is disabled, i.e., feature gating is not enabled (corresponding to the power control flag indicating that power control is not enabled in the above embodiments), step S205 is executed.

[0117] Step S203: Set power saving mode.

[0118] Taking the range of power consumption modes supported by the GPU as P0 to P15 as an example, P15 can represent the mode corresponding to the lowest power consumption among P0 to P15, that is, the power saving mode (corresponding to the first power consumption mode in the above embodiment). In the power saving mode, the GPU will automatically reduce its performance and frequency to save energy.

[0119] The GPU's power mode is set to power-saving mode by a hook program executed after the GPU driver is installed.

[0120] Step S204: Create an identifier file.

[0121] Create an identifier file (corresponding to the driver installation identifier in the above embodiment) on the current GPU to indicate that the GPU has a driver installed.

[0122] Step S205: Exit power consumption control.

[0123] The GPU maintenance container exits power control (corresponding to the end of power control in the above embodiment). After the GPU maintenance container exits power control, the power mode of the GPU is not set.

[0124] In the above embodiments, after installing the driver module for the GPU through the GPU driver installation container, the GPU's power consumption mode is set to power saving mode when there is no load on the GPU, thus saving power consumption.

[0125] In some embodiments, the GPU operation and maintenance container is configured with a GPU container runtime container (corresponding to the container runtime container in the above embodiments). Hooks that execute when creating a GPU load container (corresponding to the load container in the above embodiments) and hooks that execute when deleting a GPU load container (corresponding to the fourth hook in the above embodiments) can be respectively set in the GPU container runtime container.

[0126] Figure 3 This is a schematic diagram illustrating the implementation process of a load container lifecycle management method provided in an embodiment of this application, as shown below. Figure 3 As shown, the load container lifecycle management method includes at least steps S301 to S308.

[0127] Step S301: Configure the custom container runtime.

[0128] In some embodiments, a custom container runtime (corresponding to the container runtime in the above embodiments) can be configured through a GPU container runtime to manage the lifecycle of GPU workload containers.

[0129] Step S302: Create a GPU load container.

[0130] Create GPU load containers by using a custom container runtime.

[0131] Step S303: Check if the identification file exists.

[0132] The hook program executed when the GPU load container is created checks whether the identifier file exists. If the identifier file exists, step S304 is executed; if the identifier file does not exist, step S308 is executed.

[0133] Step S304: Set performance mode.

[0134] Taking the range of power consumption modes supported by the GPU as P0 to P15 as an example, P0 can represent the mode corresponding to the highest power consumption among P0 to P15, that is, the performance mode (corresponding to the second power consumption mode in the above embodiment). In performance mode, the GPU will run at the highest possible frequency and performance level.

[0135] The GPU's power mode is set to performance mode by a hook procedure executed when the GPU load container is created.

[0136] Step S305: Delete the GPU load container.

[0137] Delete the GPU load container by customizing the container runtime.

[0138] Step S306: Check if the identification file exists.

[0139] The hook program executed when the GPU load container is deleted checks whether the identifier file exists. If the identifier file exists, step S307 is executed; if the identifier file does not exist, step S308 is executed.

[0140] Step S307: Set power saving mode.

[0141] Taking the range of power consumption modes supported by the GPU as P0 to P15 as an example, P15 can represent the mode corresponding to the lowest power consumption among P0 to P15, i.e., power saving mode. In power saving mode, the GPU will automatically reduce its performance and frequency to save energy.

[0142] The GPU's power mode is set to power saving mode by a hook program executed when the GPU load container is deleted.

[0143] Step S308: Exit lifecycle management.

[0144] GPU container runtime exits a custom container runtime to exit the management of the GPU load container's lifecycle.

[0145] In the above embodiments, after creating the GPU load container, when there is a load on the GPU, the GPU power consumption mode is set to performance mode to meet the performance requirements of the GPU load, thereby improving the operating efficiency of the GPU load; after deleting the GPU load container, when there is no load on the GPU, the GPU power consumption mode is set to power saving mode to reduce the GPU's energy consumption, thereby saving power.

[0146] Figure 4 This is a block diagram illustrating the implementation of a power consumption control method provided in an embodiment of this application; as shown below. Figure 4 As shown, in each round of power control, the administrator (i.e., the cluster administrator of the Kubernetes GPU cluster) only needs to update the GPU driver installation container image and the GPU container runtime container image, and enable feature gating to control the power consumption mode of the GPU according to the power consumption control method of this application, which improves the convenience of controlling the power consumption mode of the GPU.

[0147] Figure 5 This is a schematic diagram illustrating an implementation scenario of a driver installation method provided in an embodiment of this application; as shown below. Figure 5 As shown, the driver combination (corresponding to the GPU driver combination in the above embodiment) can be configured by the administrator (i.e. the cluster manager of the Kubernetes GPU cluster). The event of configuring the driver combination can be monitored by the GPU operation and maintenance container. When the operation and maintenance container detects the event of configuring the driver combination, it notifies the GPU driver installation container to install the driver for the GPU.

[0148] Figure 6 This is a schematic diagram illustrating an implementation scenario of a load container lifecycle management method provided in an embodiment of this application; as shown... Figure 6 As shown, the load container lifecycle management method includes at least steps S601 to S612.

[0149] Step S601: The user sends a creation declaration.

[0150] Here, the creation declaration is for creating a GPU load container.

[0151] In some embodiments, a user can create a GPU load container by sending a declaration to create the GPU load container.

[0152] Step S602: Kubernetes monitoring creates a declaration and notifies kubelet.

[0153] Here, the Kubernetes cluster uses the Kubernetes platform to implement container orchestration and cluster management.

[0154] In some embodiments, when a user sends a declaration to create a GPU load loader container, the declaration can be monitored by Kubernetes. Once Kubernetes detects the declaration, it can send the declaration to kubelet.

[0155] Step S603: kubelet calls the advanced container runtime.

[0156] Here, kubelet is a component in the Kubernetes cluster responsible for managing containers on the GPU nodes within the cluster. Advanced container runtimes are used to manage the lifecycle of GPU-loaded containers through API interfaces; these advanced container runtimes can be containerd, docker, etc.

[0157] In some embodiments, after receiving a declaration to create a GPU workload container, kubelet can call the advanced container runtime through the Application Programming Interface (API) to process the declaration and create the GPU workload container.

[0158] Step S604: Start the custom container runtime in the advanced container runtime environment.

[0159] Here, the custom container runtime is the container runtime within a GPU container runtime.

[0160] In some embodiments, upon receiving a declaration to create a GPU workload container, the advanced container runtime can launch a GPU container runtime configured with a custom container runtime to manage the lifecycle of the GPU workload container through the custom container runtime.

[0161] Step S605: Customize the container runtime to manage the lifecycle of the GPU load container.

[0162] In some embodiments, the lifecycle of a GPU load container can be managed by a custom container runtime, which performs the operation of creating a GPU load container.

[0163] Step S606: Check if the host identification file exists.

[0164] In some embodiments, the existence of the host identity file can be checked by a custom container runtime. If the host identity file exists, step S607 is executed; if the host identity file does not exist, step S612 is executed.

[0165] Step S607: Configure the container lifecycle hook program.

[0166] Configuring container lifecycle hooks includes configuring the time points for creating and deleting GPU workload containers, the paths of the hooks executed after creating and deleting GPU workload containers.

[0167] In some embodiments, a container lifecycle hook can be configured to create and delete GPU load containers according to the lifecycle hook.

[0168] Step S608: Create a container hook program and set the performance mode.

[0169] Here, the container hook is the hook that is executed after the GPU load container is created.

[0170] In some embodiments, a hook procedure can be configured to be executed after the GPU load container is created. After the GPU load container is created, the power mode of the GPU is set to performance mode by the hook procedure executed after the GPU load container is created.

[0171] Step S609, Setup failed: Container startup failed.

[0172] The GPU load container fails to start if setting the GPU's power mode to performance mode fails.

[0173] Step S610: Delete the container hook program setting to power saving mode.

[0174] Here, the container deletion hook is the hook that is executed after the GPU load container is deleted.

[0175] In some embodiments, a hook procedure can be configured to be executed after the GPU load container is deleted. After the GPU load container is deleted, the hook procedure executed after deleting the GPU load container sets the GPU's power mode to power-saving mode.

[0176] Step S611, Setup failed: Container destroyed successfully.

[0177] Even if setting the GPU's power mode to power saving mode fails, the container is still successfully destroyed (deleted).

[0178] Step S612: Modify the runtime configuration of the low-level container.

[0179] Here, low-level container runtimes are used to create, run, and delete GPU workload containers. Low-level container runtimes can be runc, crun, etc.

[0180] In cases where you are unable to create, run, or delete a GPU workload container, or if creating a GPU workload container fails, you can modify the low-level container runtime configuration to exit the low-level container runtime's management of the GPU workload container's lifecycle.

[0181] In the above embodiments, when a GPU load is created and there is a load on the GPU, the GPU's power consumption mode is set to performance mode to meet the performance requirements of the GPU load, thereby improving the operating efficiency of the GPU load; when a GPU load is deleted and there is no load on the GPU, the GPU's power consumption mode is set to power saving mode to reduce the GPU's energy consumption, thereby saving power.

[0182] Figure 7 This is a schematic diagram of a power consumption control device provided in an embodiment of this application. Figure 7 As shown, the power consumption control device 700 is applied to the operation and maintenance container, including a first power consumption control module 701 and a second power consumption control module 702, wherein:

[0183] The first power consumption control module 701 is used to set the power consumption mode of the GPU to the first power consumption mode in response to the monitored configuration event of the GPU driver.

[0184] The second power consumption control module 702 is used to manage the lifecycle of the load container in response to the monitored lifecycle event of the load container, and set the power consumption mode of the GPU to the first power consumption mode or the second power consumption mode; the load container is a container used to perform GPU load.

[0185] Wherein, the first power consumption mode is the mode corresponding to the lowest power consumption among the multiple power consumption modes supported by the GPU; the second power consumption mode is the mode corresponding to the highest power consumption among the multiple power consumption modes.

[0186] In some embodiments, the operation and maintenance container is configured with a first hook program; the first power consumption control module 701 is configured to install a driver module for the GPU in response to a monitored GPU driver configuration event; and in response to the GPU driver module installation event, to set the power consumption mode of the GPU to the first power consumption mode through the first hook program.

[0187] In some embodiments, the first hook program is further configured to determine a power control flag, and, if the power control flag indicates that power control is enabled, set the power mode of the GPU to the first power mode.

[0188] In some embodiments, the first hook program is further configured to terminate power control when the power control flag indicates that power control is not enabled.

[0189] In some embodiments, the first hook program is further configured to set a driver installation identifier in the GPU after the driver module is installed on the GPU; the driver installation identifier indicates that the GPU has the driver module installed.

[0190] In some embodiments, the operation and maintenance container is configured with a second hook program; the second hook program is used to determine whether the GPU has the driver module installed, and if the GPU has the driver module installed, to manage the lifecycle of the load container.

[0191] In some embodiments, managing the lifecycle of the load container includes creating the load container; the second power control module 702 is further configured to create the load container and set the power consumption mode of the GPU to the second power consumption mode.

[0192] In some embodiments, the second power control module 702 is further configured to cancel the operation of creating the load container if the power mode of the GPU fails to be set to the second power mode.

[0193] In some embodiments, the operation and maintenance container is configured with a third hook program; the third hook program is used to set the power consumption mode of the GPU to the second power consumption mode when the load container is created.

[0194] In some embodiments, managing the lifecycle of the load container includes deleting the load container; the second power control module 702 is further configured to delete the load container and set the power consumption mode of the GPU to the first power consumption mode.

[0195] In some embodiments, the operation and maintenance container is configured with a fourth hook program; the fourth hook program is used to set the power consumption mode of the GPU to the first power consumption mode when the load container is deleted.

[0196] In some embodiments, the first power consumption control module 701 is further configured to, upon monitoring a configuration event of the GPU driver, set the power consumption mode of the GPU to the first power consumption mode in response to the configuration event of the GPU driver via a driver installation container; the driver installation container is configured via the operation and maintenance container.

[0197] In some embodiments, the second power consumption control module 702 is further configured to, upon monitoring the lifecycle event of the load container, manage the lifecycle of the load container in response to the lifecycle event of the load container through the container runtime container, and set the power consumption mode of the GPU to the first power consumption mode or the second power consumption mode; the container runtime container is configured through the operation and maintenance container.

[0198] The descriptions of the apparatus embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. In some embodiments, the functions or modules included in the apparatus provided in this application can be used to perform the methods described in the method embodiments above. For technical details not disclosed in the apparatus embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0199] This application provides a computer device including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements some or all of the steps in the above-described method.

[0200] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements some or all of the steps in the above-described method. The computer-readable storage medium can be transient or non-transient.

[0201] This application provides a computer program including computer-readable code, wherein when the computer-readable code is executed in a computer device, a processor in the computer device performs some or all of the steps in the above-described method.

[0202] This application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium; in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0203] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between them, while their similarities or commonalities can be referred to interchangeably. The descriptions of the above embodiments of the device, storage medium, computer program, and computer program product are similar to the descriptions of the above method embodiments and have similar beneficial effects. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0204] Figure 8 This application provides a hardware entity diagram of a computer device as an embodiment of the present application, such as... Figure 8 As shown, the hardware entity of the computer device 800 includes a processor 801 and a memory 802, wherein the memory 802 stores a computer program that can run on the processor 801, and the processor 801 executes the program to implement the steps in the method of any of the above embodiments.

[0205] The memory 802 stores computer programs that can run on the processor. The memory 802 is configured to store instructions and applications that can be executed by the processor 801. It can also cache data to be processed or already processed (e.g., image data, audio data, voice communication data and video communication data) in the processor 801 and various modules in the computer device 800. It can be implemented by flash memory or random access memory (RAM).

[0206] When the processor 801 executes a program, it can implement the steps of any of the power consumption control methods described above. The processor 801 typically controls the overall operation of the computer device 800.

[0207] This application provides a computer storage medium that stores one or more programs, which can be executed by one or more processors to implement the steps of the power consumption control method as described in any of the above embodiments.

[0208] It should be noted that the descriptions of the storage medium and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0209] The aforementioned processor can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor. It is understood that other electronic devices can also implement the functions of the aforementioned processor, and this application does not specifically limit the specific implementation.

[0210] The aforementioned computer storage media / memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it can be various terminals that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0211] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above steps / processes do not imply a sequential order of execution; the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0212] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0213] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0214] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0215] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0216] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.

[0217] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, magnetic disks, or optical disks.

[0218] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A power consumption control method, characterized in that, Applied to the operation and maintenance of containers, the method includes: In response to a monitored GPU driver configuration event, the GPU power mode is set to the first power mode; the GPU driver configuration event is an event that configures a GPU driver combination. In response to monitored lifecycle events of the load container, the lifecycle of the load container is managed, and the power consumption mode of the GPU is set to a first power consumption mode or a second power consumption mode based on the specific stage of the lifecycle; the load container is a container used to perform GPU load. Wherein, the first power consumption mode is the mode corresponding to the lowest power consumption among the multiple power consumption modes supported by the GPU; the second power consumption mode is the mode corresponding to the highest power consumption among the multiple power consumption modes.

2. The power consumption control method according to claim 1, characterized in that, The operation and maintenance container is configured with a first hook program; The step of setting the GPU's power mode to a first power mode in response to a monitored GPU driver configuration event includes: In response to a monitored configuration event of the GPU driver, install the driver module for the GPU; In response to the event of installing the driver module on the GPU, the power consumption mode of the GPU is set to the first power consumption mode via the first hook procedure.

3. The power consumption control method according to claim 2, characterized in that, The first hook program is also used to determine a power control flag, and when the power control flag indicates that power control is enabled, to set the power mode of the GPU to the first power mode.

4. The power consumption control method according to claim 3, characterized in that, The first hook program is also used to end power control when the power control flag indicates that power control is not enabled.

5. The power consumption control method according to claim 2, characterized in that, The first hook program is also used to set a driver installation identifier in the GPU after the driver module is installed on the GPU; the driver installation identifier indicates that the GPU has the driver module installed.

6. The power consumption control method according to claim 2, characterized in that, The operation and maintenance container is configured with a second hook program; the second hook program is used to determine whether the GPU has the driver module installed, and if the GPU has the driver module installed, to manage the lifecycle of the load container.

7. The power consumption control method according to claim 1, characterized in that, Managing the lifecycle of the load container includes creating the load container; managing the lifecycle of the load container and setting the GPU's power consumption mode to either the first power consumption mode or the second power consumption mode includes: Create the load container and set the GPU's power consumption mode to the second power consumption mode.

8. The power consumption control method according to claim 7, characterized in that, When creating the load container, the method further includes: If setting the GPU's power mode to the second power mode fails, cancel the operation of creating the load container.

9. The power consumption control method according to claim 7, characterized in that, The operation and maintenance container is configured with a third hook program; the third hook program is used to set the power consumption mode of the GPU to the second power consumption mode when the load container is created.

10. The power consumption control method according to claim 1, characterized in that, Managing the lifecycle of the load container includes deleting the load container; managing the lifecycle of the load container and setting the GPU's power mode to either the first power mode or the second power mode includes: Delete the load container and set the GPU's power consumption mode to the first power consumption mode.

11. The power consumption control method according to claim 10, characterized in that, The operation and maintenance container is configured with a fourth hook program; the fourth hook program is used to set the power consumption mode of the GPU to the first power consumption mode when the load container is deleted.

12. The power consumption control method according to any one of claims 1 to 11, characterized in that, The method further includes: Upon monitoring a configuration event of the GPU driver, the driver installation container responds to the configuration event by setting the power consumption mode of the GPU to the first power consumption mode; the driver installation container is configured through the operation and maintenance container.

13. The power consumption control method according to any one of claims 1 to 11, characterized in that, The method further includes: Upon monitoring the lifecycle events of the load container, the container runtime container responds to the lifecycle events of the load container, manages the lifecycle of the load container, and sets the power consumption mode of the GPU to either the first power consumption mode or the second power consumption mode; the container runtime container is configured through the operation and maintenance container.

14. A power consumption control device, characterized in that, The device, used for operating and maintaining containers, includes: The first power consumption control module is used to set the GPU's power consumption mode to the first power consumption mode in response to a monitored configuration event of the GPU driver; the configuration event of the GPU driver is an event that configures the GPU driver combination. The second power consumption control module is used to manage the lifecycle of the load container in response to the monitored lifecycle event of the load container, and set the power consumption mode of the GPU to the first power consumption mode or the second power consumption mode based on the specific stage of the lifecycle; the load container is a container used to perform GPU load. Wherein, the first power consumption mode is the mode corresponding to the lowest power consumption among the multiple power consumption modes supported by the GPU; the second power consumption mode is the mode corresponding to the highest power consumption among the multiple power consumption modes.

15. A power consumption control device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the power consumption control method according to any one of claims 1 to 13.

16. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the power consumption control method according to any one of claims 1 to 13.

17. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the power consumption control method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Low power consumption mode switching method of embedded real time operating system

    CN105807892A

  • Power consumption management method and device, image processor and storage medium

    CN115562469A

  • Power consumption management method and device of microkernel operating system, storage medium and operating system

    CN117908660A