Power consumption control method and device, equipment, storage medium and computer program product
By monitoring the life cycle events of the GPU driver and load container and dynamically switching the power consumption mode of the GPU, the problem of inaccurate GPU power consumption configuration in the existing technology is solved, and the effect of saving energy consumption under high performance requirements is achieved.
Patent Information
- Application Number
- CN202510504128.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-04-21
AI Technical Summary
The existing technology cannot reasonably control the power consumption of graphics processors (GPUs), resulting in the inability to accurately configure under changing performance requirements, affecting the operation of GPU load and may cause waste of energy consumption or lag in operation.
By monitoring configuration events of GPU drivers and lifecycle events of load containers, dynamically switch the power mode of the GPU and set it to the lowest power mode or the highest power mode to meet the performance requirements of different GPU loads and save power.
It realizes the ability to meet the performance requirements of different GPUs while reducing energy consumption and avoids lag in operation and waste of energy consumption.
Smart Images

Figure CN120448103A_ABST
Abstract
Description
Technical Field
[0001] The present 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 Art
[0002] Controlling computer power consumption is crucial for improving performance and extending battery life. Excessive power consumption can lead to excessive heat generation, reduced system stability, and shortened battery life. Therefore, properly managing the power consumption of graphics processing units (GPUs) has become essential. However, existing technologies have failed to adequately control GPU power consumption to meet fluctuating performance requirements. Summary of the Invention
[0003] In view of this, embodiments of the present application provide a power consumption control method, apparatus, device, storage medium, and computer program product to improve the accuracy of power consumption control.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a power consumption control method, which is applied to operating and maintaining a container, including:
[0006] In response to a monitored configuration event of the GPU driver, setting the power consumption mode of the GPU to a first power consumption mode;
[0007] In response to a monitored lifecycle event of a payload container, managing the lifecycle of the payload container and setting the power consumption mode of the GPU to the first power consumption mode or the second power consumption mode; the payload container is a container for executing GPU workloads;
[0008] The first power consumption mode is a mode corresponding to the lowest power consumption among multiple power consumption modes supported by the GPU; and the second power consumption mode is a mode corresponding to the highest power consumption among the multiple power consumption modes.
[0009] In a second aspect, an embodiment of the present application further provides a power consumption control device, which is applied to operating and maintaining a container, comprising:
[0010] A first power consumption control module is configured to set the power consumption mode of the GPU to a first power consumption mode in response to a monitored configuration event of the GPU driver;
[0011] a second power consumption control module, configured to manage the lifecycle of the payload container and set the power consumption mode of the GPU to the first power consumption mode or the second power consumption mode in response to a monitored lifecycle event of the payload container; the payload container is a container for executing GPU workloads;
[0012] The first power consumption mode is a mode corresponding to the lowest power consumption among multiple power consumption modes supported by the GPU; and the second power consumption mode is a mode corresponding to the highest power consumption among the multiple power consumption modes.
[0013] In a third aspect, an embodiment of the present application further provides a power consumption control device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any of the power consumption control methods described above when executing the computer program.
[0014] In a fourth aspect, an embodiment of the present application further provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the power consumption control method described in any one of the above items is implemented.
[0015] In a fifth aspect, an embodiment of the present application further provides a computer program product, comprising a computer program, which implements any of the power consumption control methods described above when executed by a processor.
[0016] In summary, in the power consumption control method provided in the embodiment of the present application, 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; in response to the monitored life cycle event of the load container, the life cycle of the load container is managed, and the power consumption mode of the GPU is set to the first power consumption mode or the second power consumption mode; the load container is a container for executing GPU loads; 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; and the second power consumption mode is the mode corresponding to the highest power consumption among the multiple power consumption modes. Based on the life cycle of the load container, the embodiment of the present application switches the power consumption mode of the GPU 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 meeting the performance requirements of different GPU loads in the second power consumption mode and saving power consumption in the first power consumption mode. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings herein are incorporated into the specification and constitute a part of this specification. These drawings are embodiments of the present application and are used together with the specification to illustrate the technical solutions of the present application.
[0018] Figure 1 A schematic diagram of an implementation flow of a power consumption control method provided in an embodiment of the present application;
[0019] Figure 2 A schematic diagram of the implementation flow of a driver installation method provided in an embodiment of the present application;
[0020] Figure 3A schematic diagram of an implementation flow of a load container lifecycle management method provided in an embodiment of the present application;
[0021] Figure 4 A block diagram of an implementation method of power consumption control provided in an embodiment of the present application;
[0022] Figure 5 A schematic diagram of an implementation scenario of a driver installation method provided in an embodiment of the present application;
[0023] Figure 6 A schematic diagram of an implementation scenario of a load container lifecycle management method provided in an embodiment of the present application;
[0024] Figure 7 A schematic diagram of a power consumption control device provided in an embodiment of the present application;
[0025] Figure 8 A hardware entity diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application.
[0027] It should be understood that the “embodiments of the present application” or “the aforementioned embodiments” mentioned throughout the specification mean that the specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, “in the embodiments of the present application” or “in the aforementioned embodiments” appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the 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 the present application. The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0028] In addition, the accompanying drawings are merely schematic illustrations of embodiments of the present application and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus their repeated descriptions will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0029] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit the present disclosure. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are 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 encompasses 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 each other. 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 "at the time of" or "when" or "in response to determining".
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing this application only and are not intended to limit this application.
[0032] Controlling computer power consumption is crucial for improving performance and extending battery life. Excessive power consumption can cause excessive heat generation, reduce system stability, and shorten battery life. Therefore, properly managing the power consumption of graphics processing units (GPUs) is essential.
[0033] In the related art, methods for controlling GPU power consumption can be used to automatically control GPU power consumption by setting an automatic adjustment mode. In automatic adjustment mode, the GPU dynamically adjusts its power consumption mode to the corresponding power consumption mode based on the current load. When the GPU sets the power consumption mode to the corresponding power consumption mode, the power consumption mode setting may fail due to factors such as the software version, software process, or hardware configuration of the system where the GPU is located. As a result, the load and power consumption levels of certain GPUs in the GPU cluster cannot be accurately configured, thereby affecting the operation of the GPU load.
[0034] For example, in related technologies, when the GPU is set to automatically adjust its performance state (P-State) based on the current workload, the P-State range is P0 to P15. The automatic adjustment mode typically sets the GPU's P-State to P4 or P5, which wastes energy when there's no load on the GPU. If the GPU receives a high-power process and needs to switch its P-State to P15, switching from P4 or P5 to P15 may still cause GPU lag.
[0035] For example, when adjusting the GPU's power consumption level from P0 to P5, hardware enablement issues may prevent the switch to P5, such as the graphics card and video memory being disabled in P0 mode. Alternatively, software issues may prevent the switch, making it impossible to accurately configure the GPU load and power consumption level, thus impacting GPU performance.
[0036] Based on the above problems, an embodiment of the present application proposes a power consumption control method, which switches the power consumption mode of the GPU between a first power consumption mode corresponding to the lowest power consumption or a second power consumption mode corresponding to the highest power consumption based on the life cycle of the load container. Thus, the performance requirements of different GPU loads can be met in the second power consumption mode, and power consumption can be saved in the first power consumption mode.
[0037] Figure 1 This is a schematic diagram of the implementation flow of a power consumption control method provided in an embodiment of the present application. Figure 1 As shown, when applied to the operation and maintenance container, the power consumption control method includes at least steps S101 to S102.
[0038] Step S101: In response to a monitored configuration event of a GPU driver, setting the power consumption mode of the GPU to a first power consumption mode; wherein the first power consumption mode is a mode corresponding to the lowest power consumption among multiple power consumption modes supported by the GPU.
[0039] Among them, the Kubernetes GPU cluster is a system for managing and scheduling GPU resources in the Kubernetes cluster. The Kubernetes cluster uses the Kubernetes platform to implement container orchestration and cluster management. The Kubernetes platform is a platform for implementing 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 an event for configuring a GPU driver assembly. The GPU driver assembly is a combination of a driver module and related software libraries. When configuring a GPU driver assembly, you can first determine the driver assembly version corresponding to the GPU and then configure that version of the GPU driver assembly. The driver module is the GPU driver program, which controls and manages the GPU to ensure that GPU resources are recognized and utilized.
[0042] In some embodiments, the GPU supports multiple power consumption modes. For example, if the power consumption modes supported by the GPU range from P0 to P15, P0 may represent the mode corresponding to the highest power consumption among P0 to P15; P15 may represent the mode corresponding to the lowest power consumption among P0 to P15, i.e., the first power consumption mode. In the first power consumption mode, the GPU will automatically reduce its performance and frequency to save energy.
[0043] In some embodiments, when the operation and maintenance container monitors a GPU driver configuration event, it installs a driver module for the GPU in response to the GPU driver configuration event to ensure that subsequently created containers can use GPU resources. When the driver module is installed for the GPU, the container has not yet been created. At this time, there is no load on the GPU, so the GPU power consumption mode can be set to the first power consumption mode corresponding to the lowest power consumption among multiple power consumption modes supported by the GPU.
[0044] For example, a cluster administrator can configure a GPU driver combination, and an operation and maintenance container can monitor events related to configuring the GPU driver combination, namely, GPU driver configuration events. When the operation and maintenance container monitors the GPU driver configuration event, it notifies a container for installing a driver module to install the driver module in response to the GPU driver configuration event. When the container for installing the driver module installs the driver module, a program built into the container for installing the driver module sets the GPU's power consumption mode to a first power consumption mode corresponding to the lowest power consumption among multiple power consumption modes supported by the GPU, through a program built into the container for installing the driver module.
[0045] It should be emphasized that when there are multiple GPUs on the host, the power consumption mode of each GPU is set independently. Therefore, when the GPU driver module is installed, if there is no load on each GPU, the power consumption mode of each GPU can be set to the first power consumption mode respectively; if there is a load on a certain GPU, the power consumption mode of the GPU can be set to 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 according to actual conditions.
[0046] Step S102: In response to the monitored lifecycle events 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 for executing GPU load; the second power consumption mode is the mode corresponding to the highest power consumption among the multiple power consumption modes.
[0047] In some embodiments, a user may send a declaration to create a load container as required, and the operation and maintenance container manages the life cycle of the load container in response to the declaration to create the load container.
[0048] Here, the load container can be understood as a GPU load container, which is a container for executing GPU load, wherein the GPU load is a task carried by the GPU.
[0049] The aforementioned payload container lifecycle events are events generated in response to receiving a declaration to create a payload container. After monitoring the payload container lifecycle events, the operation and maintenance container can create a corresponding payload container in response to the payload container lifecycle events and, based on the actual stage of managing the payload container's lifecycle, perform operations corresponding to the payload container's start, run, stop, and delete phases. It will be understood that performing the aforementioned operations corresponding to the payload container's start, run, stop, and delete phases is part of the process of managing the payload container's lifecycle.
[0050] In some embodiments, the GPU supports multiple power consumption modes. For example, if the power consumption modes supported by the GPU range from P0 to P15, P0 may represent the mode corresponding to the highest power consumption among P0 to P15, i.e., the second power consumption mode. In the second power consumption 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 payload container, it manages the lifecycle of the payload container in response to the lifecycle event of the payload container. Different stages of the lifecycle of the payload container correspond to different load conditions on the GPU. Therefore, according to the specific stage of the lifecycle of the payload container, the power consumption mode of the GPU can be set to the first power consumption mode corresponding to the lowest power consumption or the second power consumption mode corresponding to the highest power consumption among multiple power consumption modes supported by the GPU, so as to determine the power consumption mode of the GPU according to the GPU load.
[0052] For example, a user may issue a statement to create a payload container, and the operation and maintenance container may monitor the statement to create the payload container, i.e., the lifecycle event of the payload container. When the operation and maintenance container monitors the lifecycle event of the payload container, the operation and maintenance container may notify the container that manages the lifecycle of the payload container. The container that manages the lifecycle of the payload container may configure the container runtime in response to the lifecycle event of the payload container to manage the lifecycle of the payload container through the container runtime. When the lifecycle of the payload container is managed through the container runtime, the power consumption mode of the GPU may be set to the first power consumption mode or the second power consumption mode through a program configured by the container that manages the lifecycle of the payload container.
[0053] In some embodiments, managing the lifecycle of a payload container includes creating a payload container. When creating the payload container, the power consumption mode of the GPU may be set to the second power consumption mode. It is understood that when the payload container is created, if there is a load on the GPU, the power consumption mode of the GPU may be set to the second power consumption mode to meet the energy consumption required by the GPU load.
[0054] In the above embodiment, when creating a load container, if there is a load on the GPU, the power consumption mode of the GPU is set to the second power consumption mode corresponding to 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, when creating a payload container, if the GPU power consumption mode fails to be set to the second power consumption mode, the operation of creating the payload container is canceled. It is understood that if the GPU power consumption mode fails to be set to the second power consumption mode, the energy consumption required by the GPU load after the payload container is created may not be met, so the operation of creating the payload container may be canceled.
[0056] In some embodiments, the operation and maintenance container can detect the life cycle of the load container. In the case where the operation of creating the load container is canceled when the power consumption mode of the GPU fails to be set to the second power consumption mode, the load container can be recreated after the power consumption mode of the GPU is successfully set to the second power consumption mode during the process of creating other load containers within a limited time.
[0057] In some embodiments, managing the lifecycle of a payload container includes deleting the payload container. After deleting the payload container, the power consumption mode of the GPU can be set to the first power consumption mode. It is understood that after deleting the payload container, there is no load on the GPU, and the power consumption mode of the GPU can be set to the first power consumption mode to reduce energy consumption.
[0058] In the above embodiment, after deleting the load container, when 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 among multiple power consumption modes supported by the GPU, thereby saving power consumption.
[0059] In some embodiments, if multiple GPUs exist on a host, some GPUs may be simultaneously occupied by different payload containers. After deleting a payload container, the GPU may still be occupied by other payload containers, resulting in a load on the GPU, making it impossible to set the GPU's power consumption mode to the first power consumption mode. In this case, the deleted payload container is still deleted successfully, but the GPU must wait until all payload containers occupying the GPU are deleted before the power consumption mode can be set to the first power consumption mode.
[0060] For example, multiple GPUs on the host are marked as GPU1, GPU2, GPU3, and GPU4 respectively. There are currently two load containers, namely the first load container and the second load container. The first load container occupies GPU1 and GPU2, and the second load container occupies GPU2, GPU3, and GPU4. After deleting the first load container, there is no load on GPU1, so the power consumption mode of GPU1 can be set to the first power consumption mode, but GPU2 is still occupied by the second load container, resulting in a load on GPU2. The power consumption mode of GPU2 cannot be set to the first power consumption mode, but the first load container is still deleted successfully. After deleting the second load container, there is no load on GPU2, GPU3, and GPU4, and the power consumption modes of GPU2, GPU3, and GPU4 can all be set to the first power consumption mode.
[0061] In an embodiment of the present application, 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, and power consumption can be saved in the first power consumption mode.
[0062] In some embodiments, a first hook program is configured in the operation and maintenance container; in response to the monitored GPU driver configuration event, the power consumption mode of the GPU is set to the first power consumption mode, including: in response to the monitored GPU driver configuration event, installing a driver module for the GPU; in response to the GPU driver module installation event, setting the power consumption mode of the GPU to the first power consumption mode through the first hook program.
[0063] Among them, in the Kubernetes GPU cluster, the driver module can be installed for the GPU and the load container can be created through the operation and maintenance container, so that the load container in the Kubernetes GPU cluster can use the resources in the GPU node through the resource scheduling mechanism.
[0064] In some embodiments, before creating a payload container, a cluster administrator of the Kubernetes GPU cluster can configure a GPU driver combination, and an operations and maintenance container can monitor events indicating administrator configuration of the GPU driver combination (i.e., GPU driver configuration events). When the operations and maintenance container monitors the GPU driver configuration event, it installs a driver module for the GPU in response to the GPU driver configuration event.
[0065] The first hook program is used to set the power consumption mode of the GPU to the first power consumption mode in response to an event that the GPU installs the driver module.
[0066] Here, the hook program can be used to monitor and intervene in system-level or application-level event flows. The first hook program is configured in the operation and maintenance container. This first hook program is used to set the GPU's power consumption mode to a first power consumption mode in response to an event in which the GPU driver module is installed. The first power consumption mode corresponds to the lowest power consumption among multiple power consumption modes supported by the GPU.
[0067] In some embodiments, a first hook program can be configured for the operation and maintenance container to be executed after the GPU driver module is installed. The first hook program monitors the GPU driver module installation event. After the first hook program monitors the GPU driver module installation operation, it sets the GPU power consumption mode to the first power consumption mode.
[0068] In some embodiments, the first hook program may be configured in a driver installation container. The driver installation container is a container for installing a driver module for a GPU. When the operation and maintenance container detects an event indicating that a GPU has installed a driver module, the operation and maintenance container may 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, the operation and maintenance container may set the GPU's power consumption mode to the first power consumption mode.
[0069] In the above embodiment, after the driver module is installed on the GPU, there is no load container, that is, when 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 first hook program, thereby saving power consumption.
[0070] In some embodiments, the first hook program is further configured to determine a power consumption control flag, and set the power consumption mode of the GPU to the first power consumption mode when the power consumption control flag indicates that power consumption control is enabled.
[0071] Here, the power consumption control flag is a flag used to indicate whether to enable power consumption control.
[0072] In some embodiments, gating may be set to enable and disable power consumption control according to the gating control.
[0073] In some embodiments, a power consumption control flag may be determined by a first hook program to determine whether to enable power consumption control according to the first hook program. If the power consumption control flag indicates that power consumption control is enabled, the first hook program may set the power consumption mode of the GPU to the first power consumption mode in response to an event of the GPU installing a driver module.
[0074] In some embodiments, the first hook program is further configured to terminate the power consumption control when the power consumption control flag indicates that the power consumption control is not enabled.
[0075] In some embodiments, a power consumption control flag can be determined by a first hook procedure to determine whether to enable power consumption control. If the power consumption control flag indicates that power consumption control is not enabled, the first hook procedure intervenes in the power consumption control operation of the operation and maintenance container to terminate power consumption control. It is understood that after terminating power consumption control, the operation and maintenance container does not set the power consumption mode of the GPU.
[0076] In some embodiments, the first hook program is further configured to set a driver installation flag in the GPU after the driver module is installed on the GPU; the driver installation flag indicates that the GPU has the driver module installed.
[0077] In some embodiments, the event of GPU driver module installation can be monitored by a first hook program. After monitoring the GPU driver module installation, the first hook program sets a driver installation identifier in the GPU so that related programs in subsequent operations can directly determine whether the driver module is installed in the GPU based on the driver installation identifier.
[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 is installed with a driver module, and manage the life cycle of the load container if the GPU is installed with a driver module.
[0079] Here, the second hook program is a hook program configured in the operation and maintenance container and is used 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 the GPU has a driver module installed. If the GPU has a driver module installed, the operation and maintenance container can manage the lifecycle of the payload container. If the GPU does not have a driver module installed, the operation and maintenance container must install the driver module for the GPU. It is understood that if the GPU does not have a driver module installed, the system cannot identify and utilize the GPU's resources, which will affect the management of the payload container's lifecycle.
[0081] In some embodiments, after the GPU has installed the driver module, a first hook procedure can be used to set a driver installation flag in the GPU, thereby indicating that the GPU has installed the driver module. A second hook procedure can be used to determine whether the driver installation flag exists in the GPU. If the driver installation flag exists in the GPU, the lifecycle of the payload container can be managed through the operation and maintenance container. If the driver installation flag does not exist in the GPU, the driver module must be installed for the GPU through the operation and maintenance container.
[0082] In some embodiments, the second hook program can be configured in a container runtime container. The container runtime container is a container used to configure the container runtime. When the operation and maintenance container monitors the lifecycle events of the load container, it can notify the container runtime container to respond to the lifecycle events of the load container and configure the container runtime to manage the lifecycle of the load container through the container runtime. When the second hook program monitors the container runtime managing the lifecycle of the load container, it can set the power consumption mode of the GPU to the first power consumption mode or the second power consumption 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 the second power consumption mode when creating the load container.
[0084] Here, the third hook program is a hook program configured in the operation and maintenance container, and is used to set the power consumption mode of the GPU to the second power consumption mode when creating a load container.
[0085] The second power consumption mode is a mode corresponding to the highest power consumption among multiple power consumption modes supported by the GPU.
[0086] In some embodiments, a third hook program can be configured for the operation and maintenance container to be executed when a payload container is created, and the third hook program can be used to monitor the event of payload container creation. When the third hook program monitors the operation of payload container creation, the GPU power consumption mode is set to the second power consumption mode.
[0087] In some embodiments, the third hook program can be configured in the container runtime container. The container runtime container is a container for configuring the container runtime. When the operation and maintenance container monitors the lifecycle event of the load container, it can notify the container runtime container to respond to the lifecycle event of the load container and configure the container runtime to manage the lifecycle of the load container through the container runtime. Managing the lifecycle of the load container includes creating a load container. When the second hook program monitors the creation of the load container by the container runtime, the power consumption mode of the GPU can be set to the second power consumption mode.
[0088] In the above embodiment, when creating a load container, the GPU's power consumption mode is set to the second power consumption mode via a third hook procedure, bringing GPU power consumption control to the forefront and avoiding GPU operation lags during power consumption mode adjustment. Furthermore, after the load container is created, if a load is present on the GPU, the third hook procedure sets the GPU's power consumption mode to the second power consumption mode corresponding to the highest power consumption, thus meeting 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 deleting the load container.
[0090] Here, the fourth hook program is a hook program configured in the operation and maintenance container, and is used to set the power consumption mode of the GPU to the first power consumption mode when the load container is deleted.
[0091] The first power consumption mode is a mode corresponding to the lowest power consumption among multiple power consumption modes supported by the GPU.
[0092] In some embodiments, a fourth hook program can be configured for the operation and maintenance container to be executed when a payload container is deleted, and the fourth hook program can monitor the event of deleting the payload container. When the fourth hook program monitors the operation of deleting the payload container, the power consumption mode of the GPU is set to the first power consumption mode.
[0093] In some embodiments, the fourth hook program can be configured in a container runtime container. The container runtime container is a container for configuring the container runtime. When the operation and maintenance container monitors the lifecycle event of the load container, it can notify the container runtime container to respond to the lifecycle event of the load container and configure the container runtime to manage the lifecycle of the load container through the container runtime. Managing the lifecycle of the load container includes deleting the load container. When the fourth hook program monitors the container runtime deleting the load container, the power consumption mode of the GPU can be set to the first power consumption mode.
[0094] In the above embodiment, after the load container is deleted, when 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, when a GPU-driven configuration event is monitored, the power consumption mode of the GPU is set to the first power consumption mode by driving an installation container in response to the GPU-driven configuration event; the driver installation container is configured through an operation and maintenance container.
[0096] Here, the driver installation container is a container for installing a driver module for the GPU. The first power consumption mode is a mode corresponding to the lowest power consumption among multiple power consumption 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 consumption mode to the first power consumption mode in response to the event. Accordingly, in response to the event indicating that a GPU driver module has been installed, the driver module can also be installed for the GPU.
[0098] In some embodiments, when the lifecycle events of the load container are monitored, 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 the first power consumption mode or the 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 consumption mode is a mode corresponding to the highest power consumption among multiple power consumption modes supported by the GPU.
[0101] In some embodiments, when the operation and maintenance container monitors the lifecycle events of the load container, it can notify the container runtime container to respond to the lifecycle events 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 the first power consumption mode or the second power consumption mode.
[0102] In an embodiment of the present application, 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, and power consumption can be saved in the first power consumption mode.
[0103] It is understood that managing the lifecycle of a payload container is the process of managing and controlling each stage of the payload container, from creation, startup, operation, to termination and deletion. Different stages of the payload container lifecycle correspond to different GPU loads. Therefore, the GPU power consumption mode can be set to the first power consumption mode or the second power consumption mode based on the specific stage of the payload container lifecycle, thereby determining the GPU power consumption mode based on GPU load.
[0104] The following describes the application of the power consumption control method provided in the embodiment of the present application in actual scenarios.
[0105] The following problems exist in the process of implementing GPU power consumption control in related technologies:
[0106] In the related art, methods for controlling GPU power consumption can be used to automatically control GPU power consumption by setting an automatic adjustment mode. In automatic adjustment mode, the GPU dynamically adjusts its power consumption mode to the corresponding power consumption mode based on the current load. When the GPU sets the power consumption mode to the corresponding power consumption mode, the power consumption mode setting may fail due to factors such as the software version, software process, or hardware configuration of the system where the GPU is located. As a result, the load and power consumption levels of certain GPUs in the GPU cluster cannot be accurately configured, thereby affecting the operation of the GPU load.
[0107] For example, in related technologies, when the GPU is set to automatically adjust its performance state (P-State) based on the current workload, the P-State range is P0 to P15. The automatic adjustment mode typically sets the GPU's P-State to P4 or P5, which wastes energy when there's no load on the GPU. If the GPU receives a high-power process and needs to switch its P-State to P15, switching from P4 or P5 to P15 may still cause GPU lag.
[0108] For example, when adjusting the GPU's power consumption level from P0 to P5, hardware enablement issues may prevent the switch to P5, such as the graphics card and video memory being disabled in P0 mode. Alternatively, software issues may prevent the switch, making it impossible to accurately configure the GPU load and power consumption level, thus impacting GPU performance.
[0109] Based on the above problems, an embodiment of the present application proposes a power consumption control method, which switches the power consumption mode of the GPU between a first power consumption mode corresponding to the lowest power consumption or a second power consumption mode corresponding to the highest power consumption based on the life cycle of the load container. Thus, the performance requirements of different GPU loads can be met in the second power consumption mode, and power consumption can be 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 embodiment) to control the opening and closing of power consumption control through the switch of feature gating, and the power consumption control flag can be used to indicate whether power consumption control is turned on.
[0111] In some embodiments, a GPU driver installation container (corresponding to the driver installation container in the above embodiment) is configured in the GPU operation and maintenance container. A hook program (corresponding to the first hook program in the above embodiment) that is executed after the GPU driver program (corresponding to the driver module in the above embodiment) is installed can be set in the GPU driver installation container.
[0112] Figure 2 A schematic diagram of the implementation flow of a driver installation method provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the driver installation method at least includes steps S201 to S205.
[0113] Step S201: Install the driver.
[0114] In some embodiments, a driver program (corresponding to the driver module in the above embodiments) may be installed for the GPU via a GPU driver installation container.
[0115] Step S202: Check whether feature gating is enabled.
[0116] In some embodiments, a hook program executed after the GPU driver is installed can be used to check whether the feature gating is turned on. When the feature gating is turned on (corresponding to the power consumption control flag indicating that power consumption control is turned on in the above embodiment), step S203 is executed; when the feature gating is turned off, that is, the feature gating is not turned on (corresponding to the power consumption control flag indicating that power consumption control is not turned on in the above embodiment), step S205 is executed.
[0117] Step S203: Set the power saving mode.
[0118] For example, if the power consumption modes supported by the GPU range from P0 to P15, P15 may represent the mode corresponding to the lowest power consumption among P0 to P15, i.e., power saving mode (corresponding to the first power consumption mode in the above embodiment). In power saving mode, the GPU will automatically reduce its performance and frequency to save energy.
[0119] The power consumption mode of the GPU is set to the power saving mode through a hook program executed after the GPU driver is installed.
[0120] Step S204: Create an identification file.
[0121] An identification file (corresponding to the driver installation identification in the above embodiment) is created on the current GPU to indicate that the GPU has a driver installed thereon through the identification file.
[0122] Step S205: exit power consumption control.
[0123] The GPU operation and maintenance container exits the power consumption control (corresponding to the end of the power consumption control in the above embodiment). After the GPU operation and maintenance container exits the power consumption control, the power consumption mode of the GPU is not set.
[0124] In the above embodiment, after the driver module is installed for the GPU through the GPU driver installation container, when there is no load on the GPU, the power consumption mode of the GPU is set to the power saving mode, thereby saving power consumption.
[0125] In some embodiments, a GPU container runtime container (corresponding to the container runtime container in the above embodiment) is configured in the GPU operation and maintenance container. A hook program (corresponding to the third hook program in the above embodiment) executed when creating a GPU payload container (corresponding to the payload container in the above embodiment) and a hook program (corresponding to the fourth hook program in the above embodiment) executed when deleting a GPU payload container can be set in the GPU container runtime container.
[0126] Figure 3 A schematic diagram of the implementation process of a load container lifecycle management method provided in an embodiment of the present application is shown as follows: Figure 3 As shown, the load container lifecycle management method includes at least steps S301 to S308.
[0127] Step S301: Configure a custom container runtime.
[0128] In some embodiments, a custom container runtime (corresponding to the container runtime in the above embodiments) can be configured through the GPU container runtime container to manage the life cycle of the GPU payload container through the custom container runtime.
[0129] Step S302: Create a GPU load container.
[0130] Create a GPU payload container using a custom container runtime.
[0131] Step S303: Check whether the identification file exists.
[0132] The hook program executed when creating the GPU load container checks whether the identification file exists. If the identification file exists, step S304 is executed; if the identification file does not exist, step S308 is executed.
[0133] Step S304: Set the performance mode.
[0134] Taking the 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, 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 power mode is set to performance mode through a hook procedure executed when the GPU load container is created.
[0136] Step S305: Delete the GPU load container.
[0137] Delete the GPU payload container via a custom container runtime.
[0138] Step S306: Check whether the identification file exists.
[0139] The hook program executed when deleting the GPU load container is used to check whether the identification file exists. If the identification file exists, step S307 is executed; if the identification file does not exist, step S308 is executed.
[0140] Step S307: Set the power saving mode.
[0141] For example, if the power consumption range of a GPU is P0 to P15, P15 represents the lowest power consumption mode 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] Sets the GPU's power consumption mode to power saving mode by deleting a hook procedure that is executed when the GPU loads a container.
[0143] Step S308: Exit life cycle management.
[0144] The GPU container runtime container exits the custom container runtime to stop managing the lifecycle of the GPU payload container.
[0145] In the above embodiment, after creating a GPU load container, if there is a load on the GPU, the power consumption mode of the GPU is set to the performance mode, which meets the performance requirements of the GPU load, thereby improving the operating efficiency of the GPU load; after deleting the GPU load container, if there is no load on the GPU, the power consumption mode of the GPU is set to the power saving mode, which reduces the energy consumption of the GPU, thereby saving power consumption.
[0146] Figure 4 This is a block diagram of an implementation method of power consumption control provided in an embodiment of the present application; Figure 4 As shown, in each round of power consumption control, the administrator (i.e., the cluster manager of the Kubernetes GPU cluster) only needs to update the GPU driver installation container image and the GPU container runtime container image, and turn on the feature gating to control the GPU power consumption mode according to the power consumption control method of this application, thereby improving the convenience of controlling the GPU power consumption mode.
[0147] Figure 5 A schematic diagram of an implementation scenario of a driver installation method provided in an embodiment of the present application; Figure 5 As shown, the administrator (i.e., the cluster manager of the Kubernetes GPU cluster) can configure the driver combination (corresponding to the GPU driver combination in the above embodiment), and the GPU operation and maintenance container can monitor the event of configuring the driver combination. When the operation and maintenance container monitors the event of configuring the driver combination, it notifies the GPU driver installation container to install the driver for the GPU.
[0148] Figure 6 A schematic diagram of an implementation scenario of a load container lifecycle management method provided in an embodiment of the present application; 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 statement.
[0150] Here, the creation statement is a statement for creating a GPU load container.
[0151] In some embodiments, a user may create a GPU payload container by sending a statement to create a GPU payload container.
[0152] Step S602: Kubernetes monitors the creation 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 container, the declaration to create a GPU load container can be monitored by Kubernetes. After Kubernetes monitors the declaration to create a GPU load container, it can send the declaration to create a GPU load container 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 GPU nodes in the cluster. Advanced container runtimes, such as containerd, Docker, and others, manage the lifecycle of GPU-loaded containers through APIs.
[0157] In some embodiments, after receiving the declaration to create a GPU payload container, kubelet can call the advanced container runtime through the application programming interface (API) to process the declaration to create a GPU payload container through the advanced container runtime to realize the creation of the GPU payload container.
[0158] Step S604: The advanced container runtime starts the custom container runtime.
[0159] Here, the custom container runtime is the container runtime in the GPU container runtime container.
[0160] In some embodiments, after receiving the declaration to create a GPU payload container, the advanced container runtime can start the custom container runtime configured with the GPU container runtime container to manage the lifecycle of the GPU payload container through the custom container runtime.
[0161] Step S605: The custom container runtime manages the lifecycle of the GPU load container.
[0162] In some embodiments, the lifecycle of the GPU payload container can be managed by a custom container runtime to perform operations to create a GPU payload container.
[0163] Step S606: Check whether the host identification file exists.
[0164] In some embodiments, the custom container runtime may check whether the host identification file exists. If the host identification file exists, step S607 is executed; if the host identification file does not exist, step S612 is executed.
[0165] Step S607: Configure the container lifecycle hook program.
[0166] Configuring the container lifecycle hook program includes configuring the time nodes for creating and deleting GPU load containers, the path of the hook program executed after creating the GPU load container, and the path of the hook program executed after deleting the GPU load container.
[0167] In some embodiments, a container lifecycle hook procedure may be configured to create a GPU payload container and delete a GPU payload container according to the lifecycle hook procedure.
[0168] Step S608: Create a container hook program to set the performance mode.
[0169] Here, the container creation hook program is a hook program executed after the GPU load container is created.
[0170] In some embodiments, a hook program executed after the GPU payload container is created may be configured to set the power consumption mode of the GPU to the performance mode through the hook program executed after the GPU payload container is created.
[0171] Step S609: Setting failed: container startup failed.
[0172] If the GPU power mode fails to be set to performance mode, the GPU load container fails to start.
[0173] Step S610: Delete the container hook program to set the power saving mode.
[0174] Here, the container deletion hook program is a hook program executed after the GPU load container is deleted.
[0175] In some embodiments, a hook program executed after deleting the GPU payload container may be configured. After deleting the GPU payload container, the power consumption mode of the GPU is set to the power saving mode by the hook program executed after deleting the GPU payload container.
[0176] Step S611, setting failed: container destroyed successfully.
[0177] Even if setting the GPU power consumption mode to power saving mode fails, the container is still successfully destroyed (deleted).
[0178] Step S612: Modify the low-level container runtime configuration.
[0179] Here, the low-level container runtime is used to create, run, and delete GPU payload containers. The low-level container runtime can be runc, crun, etc.
[0180] If you cannot create, run, or delete a GPU payload container, or if creation of a GPU payload container fails, you can modify the low-level container runtime configuration to exit the low-level container runtime's management of the GPU payload container lifecycle.
[0181] In the above embodiment, after the GPU load is created, when there is a load on the GPU, the power consumption mode of the GPU is set to the performance mode, which meets the performance requirements of the GPU load and thus improves the operating efficiency of the GPU load; after the GPU load is deleted, when there is no load on the GPU, the power consumption mode of the GPU is set to the power saving mode, which reduces the energy consumption of the GPU and thus saves power consumption.
[0182] Figure 7 This is a schematic diagram of a power consumption control device provided in an embodiment of the present 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] A first power consumption control module 701 is configured to set the power consumption mode of the GPU to a first power consumption mode in response to a monitored configuration event of the GPU driver;
[0184] a second power consumption control module 702, configured to manage the lifecycle of a payload container and set the power consumption mode of the GPU to the first power consumption mode or the second power consumption mode in response to a monitored lifecycle event of the payload container; the payload container is a container for executing GPU workloads;
[0185] The first power consumption mode is a mode corresponding to the lowest power consumption among multiple power consumption modes supported by the GPU; and the second power consumption mode is a mode corresponding to the highest power consumption among the multiple power consumption modes.
[0186] In some embodiments, a first hook program is configured in the operation and maintenance container; the first power consumption control module 701 is used to install a driver module for the GPU in response to a monitored GPU driver configuration event; in response to the GPU driver module installation event, the power consumption mode of the GPU is set 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 consumption control flag, and set the power consumption mode of the GPU to the first power consumption mode when the power consumption control flag indicates that power consumption control is enabled.
[0188] In some embodiments, the first hook program is further configured to terminate power consumption control when the power consumption control flag indicates that power consumption 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 in the GPU; the driver installation identifier indicates that the driver module is installed in the GPU.
[0190] 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 is installed with the driver module, and manage the life cycle of the load container when the GPU is installed with the driver module.
[0191] In some embodiments, managing the life cycle of the payload container includes creating the payload container; the second power consumption control module 702 is further used to create the payload container and set the power consumption mode of the GPU to the second power consumption mode.
[0192] In some embodiments, the second power consumption control module 702 is further configured to cancel the operation of creating the load container if the power consumption mode of the GPU fails to be set to the second power consumption mode.
[0193] 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 the second power consumption mode when creating the load container.
[0194] In some embodiments, managing the life cycle of the payload container includes deleting the payload container; the second power consumption control module 702 is further used to delete the payload container and set the power consumption mode of the GPU to the first power consumption mode.
[0195] 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.
[0196] In some embodiments, the first power consumption control module 701 is further used to, when monitoring a configuration event driven by the GPU, set the power consumption mode of the GPU to the first power consumption mode by driving the installation container in response to the configuration event driven by the GPU; the driver installation container is configured through the operation and maintenance container.
[0197] In some embodiments, the second power consumption control module 702 is further used to manage the life cycle 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 by responding to the life cycle event of the load container through the container runtime container when the life cycle event of the load container is monitored; the container runtime container is configured through the operation and maintenance container.
[0198] The description of the above device embodiment is similar to the description of the above method embodiment and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to perform the methods described in the above method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0199] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0200] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps in the above method. The computer-readable storage medium may be transient or non-transient.
[0201] An embodiment of the present application provides a computer program, including computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0202] An embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, implements some or all of the steps in the above method. The computer program product can be implemented specifically by hardware, software, or a combination thereof. In some embodiments, the computer program product is embodied as a computer storage medium. In other embodiments, the computer program product is 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 the various embodiments, and their similarities or similarities can be referenced to each other. The descriptions of the above device, storage medium, computer program, and computer program product embodiments are similar to the descriptions of the above method embodiments and have similar beneficial effects as the method embodiments. 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 description of the method embodiments of this application for understanding.
[0204] Figure 8 A hardware entity diagram of a computer device provided in an embodiment of the present application is shown as follows: 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 be run on the processor 801, and the processor 801 implements the steps of the method of any of the above embodiments when executing the program.
[0205] The memory 802 stores computer programs that can be run on the processor. The memory 802 is configured to store instructions and applications executable by the processor 801. It can also cache data to be processed or processed by the processor 801 and various modules in the computer device 800 (for example, image data, audio data, voice communication data, and video communication data). This can be implemented through flash memory (FLASH) or random access memory (RAM).
[0206] When the processor 801 executes the program, the steps of any of the above power consumption control methods can be implemented. The processor 801 generally controls the overall operation of the computer device 800.
[0207] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the power consumption control method of any of the above embodiments.
[0208] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0209] The processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It is understood that the electronic device that implements the functions of the processor may also be other electronic devices, which are not specifically limited in the embodiments of the present application.
[0210] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); it can also be various terminals including 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 "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned steps / processes does not mean the order of execution, and 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 the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0212] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the 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 schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0214] The units described above as separate components may or may not be physically separated, and the components displayed 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 according to actual needs to achieve the purpose of the scheme of this embodiment.
[0215] In addition, all functional units in the embodiments of the present 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 above-mentioned integrated units can be implemented in the form of 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 implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.
[0217] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0218] The above is only an implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present 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 configuration event of the GPU driver, setting the power consumption mode of the GPU to a first power consumption mode; In response to a monitored lifecycle event of a payload container, managing the lifecycle of the payload container and setting the power consumption mode of the GPU to the first power consumption mode or the second power consumption mode; the payload container is a container for executing GPU workloads; The first power consumption mode is a mode corresponding to the lowest power consumption among multiple power consumption modes supported by the GPU; and the second power consumption mode is a mode corresponding to the highest power consumption among the multiple power consumption modes.
2. The power consumption control method according to claim 1, wherein: A first hook program is configured in the operation and maintenance container; The step of setting the power consumption mode of the GPU to the first power consumption mode in response to the monitored configuration event of the GPU driver includes: In response to a monitored GPU driver configuration event, installing a driver module for the GPU; In response to an event in which the GPU installs a driver module, the power consumption mode of the GPU is set to the first power consumption mode through the first hook program.
3. The power consumption control method according to claim 2, wherein: The first hook program is further configured to determine a power consumption control flag, and set the power consumption mode of the GPU to the first power consumption mode when the power consumption control flag indicates that power consumption control is enabled.
4. The power consumption control method according to claim 3, wherein: The first hook program is further configured to terminate power consumption control when the power consumption control flag indicates that power consumption control is not enabled.
5. The power consumption control method according to claim 2, wherein: The first hook program is further configured to set a driver installation identifier in the GPU after the driver module is installed in the GPU; the driver installation identifier indicates that the driver module is installed in the GPU.
6. The power consumption control method according to claim 2, wherein: A second hook program is configured in the operation and maintenance container; the second hook program is used to determine whether the GPU is installed with the driver module, and manage the life cycle of the load container when the GPU is installed with the driver module.
7. The power consumption control method according to claim 1, wherein: Managing the life cycle of the payload container includes creating the payload container; and managing the life cycle of the payload container and setting the power consumption mode of the GPU to the first power consumption mode or the second power consumption mode includes: The load container is created, and the power consumption mode of the GPU is set to the second power consumption mode.
8. The power consumption control method according to claim 7, wherein: When creating the load container, the method further includes: In a case where the power consumption mode of the GPU fails to be set to the second power consumption mode, the operation of creating the payload container is canceled.
9. The power consumption control method according to claim 7, wherein: 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 the second power consumption mode when creating the load container.
10. The power consumption control method according to claim 1, wherein: Managing the life cycle of the payload container includes deleting the payload container; and managing the life cycle of the payload container and setting the power consumption mode of the GPU to the first power consumption mode or the second power consumption mode includes: The load container is deleted, and the power consumption mode of the GPU is set to the first power consumption mode.
11. The power consumption control method according to claim 10, wherein: 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.
12. The power consumption control method according to any one of claims 1 to 11, characterized in that: The method further comprises: When a configuration event of the GPU driver is monitored, the power consumption mode of the GPU is set to the first power consumption mode by driving an installation container in response to the configuration event of the GPU driver; 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 comprises: When the lifecycle events of the load container are monitored, 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 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: Applied to the operation and maintenance of containers, the device includes: A first power consumption control module is configured to set the power consumption mode of the GPU to a first power consumption mode in response to a monitored configuration event of the GPU driver; a second power consumption control module, configured to manage the lifecycle of the payload container and set the power consumption mode of the GPU to the first power consumption mode or the second power consumption mode in response to a monitored lifecycle event of the payload container; the payload container is a container for executing GPU workloads; The first power consumption mode is a mode corresponding to the lowest power consumption among multiple power consumption modes supported by the GPU; and the second power consumption mode is a 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, wherein: When the processor executes the computer program, the power consumption control method according to any one of claims 1 to 13 is implemented.
16. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the power consumption control method according to any one of claims 1 to 13 is implemented.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the power consumption control method according to any one of claims 1 to 13 is implemented.
Citation Information
Patent Citations
Low power consumption mode switching method of embedded real time operating system
CN105807892A
Container-based application management method and device
CN113296880A
Power consumption management method and device, electronic equipment, graphics processor and storage medium
CN114879829A
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