geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
DCGMDevicePool.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 - 2024 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef DCGMDEVICEPOOL_HPP_INCLUDE
7 #define DCGMDEVICEPOOL_HPP_INCLUDE
8 
9 namespace geopm
10 {
17  {
18  public:
19  enum m_field_id_e {
36  };
37 
38  DCGMDevicePool() = default;
39  virtual ~DCGMDevicePool() = default;
40 
43  virtual int num_device() const = 0;
55  virtual double sample(int gpu_idx, int field_id) const = 0;
56 
63  virtual void update(int gpu_idx) = 0;
65  // at which the DCGM engine will poll for metrics
67  virtual void update_rate(int field_update_rate) = 0;
71  virtual void max_storage_time(int max_storage_time) = 0;
76  virtual void max_samples(int max_samples) = 0;
77 
79  // This function may be called repeatedly with updated polling
80  // rate or storage settings.
81  virtual void polling_enable(void) = 0;
82 
84  virtual void polling_disable(void) = 0;
85  };
86 
88 }
89 #endif
Definition: DCGMDevicePool.hpp:17
virtual ~DCGMDevicePool()=default
virtual double sample(int gpu_idx, int field_id) const =0
Get the value for the provided geopm_field_id.
m_field_id_e
Definition: DCGMDevicePool.hpp:19
@ M_FIELD_ID_DRAM_ACTIVE
Field ID associated with DCGM DRAM Active metrics.
Definition: DCGMDevicePool.hpp:31
@ M_FIELD_ID_SM_ACTIVE
Field ID associated with DCGM SM Active metrics.
Definition: DCGMDevicePool.hpp:23
@ M_FIELD_ID_SM_OCCUPANCY
Field ID associated with SM Occupancy metrics.
Definition: DCGMDevicePool.hpp:27
@ M_NUM_FIELD_ID
Number of valid field ids.
Definition: DCGMDevicePool.hpp:35
virtual void polling_enable(void)=0
Enable DCGM data polling through setting the watch fields.
virtual int num_device() const =0
Number of GPUs that support DCGM on the platform.
virtual void max_storage_time(int max_storage_time)=0
Set maximum storage time for for DCGM devices. This is the maximum time a DCGM sample will be kept.
virtual void polling_disable(void)=0
Disable DCGM data polling through calling unwatchfields.
virtual void update(int gpu_idx)=0
Query DCGM for the latest value for an GPU. Note that this is the last value DCGM cached....
virtual void update_rate(int field_update_rate)=0
Set field update rate for DCGM devices. This is the rate.
virtual void max_samples(int max_samples)=0
Set maximum samples to store for for DCGM devices. This is the maximum number of DCGM samples that wi...
Definition: Agg.cpp:20
DCGMDevicePool & dcgm_device_pool()
Definition: DCGMDevicePool.cpp:18