geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
NVMLDevicePool.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 NVMLDEVICEPOOL_HPP_INCLUDE
7 #define NVMLDEVICEPOOL_HPP_INCLUDE
8 
9 #include <vector>
10 #include <string>
11 #include <cstdint>
12 
13 #include "geopm_sched.h"
14 
15 namespace geopm
16 {
17 
19  {
20  public:
21  NVMLDevicePool() = default;
22  virtual ~NVMLDevicePool() = default;
25  virtual int num_gpu(void) const = 0;
30  virtual std::unique_ptr<cpu_set_t, std::function<void(cpu_set_t *)> >
31  cpu_affinity_ideal_mask(int gpu_idx) const = 0;
37  virtual uint64_t frequency_status_sm(int gpu_idx) const = 0;
43  virtual std::vector<unsigned int> frequency_supported_sm(int gpu_idx) const = 0;
49  virtual uint64_t utilization(int gpu_idx) const = 0;
54  virtual uint64_t power (int gpu_idx) const = 0;
59  virtual uint64_t power_limit (int gpu_idx) const = 0;
64  virtual uint64_t frequency_status_mem(int gpu_idx) const = 0;
70  virtual uint64_t throttle_reasons(int gpu_idx) const = 0;
75  virtual uint64_t temperature(int gpu_idx) const = 0;
81  virtual uint64_t energy(int gpu_idx) const = 0;
89  virtual uint64_t performance_state(int gpu_idx) const = 0;
95  virtual uint64_t throughput_rx_pcie(int gpu_idx) const = 0;
101  virtual uint64_t throughput_tx_pcie(int gpu_idx) const = 0;
107  virtual uint64_t utilization_mem(int gpu_idx) const = 0;
114  virtual std::vector<int> active_process_list(int gpu_idx) const = 0;
115 
121  virtual void frequency_control_sm(int gpu_idx, int min_freq, int max_freq) const = 0;
125  virtual void frequency_reset_control(int gpu_idx) const = 0;
130  virtual void power_control(int gpu_idx, int setting) const = 0;
131 
132  virtual bool is_privileged_access(void) const = 0;
133  virtual void reset(void) = 0;
134  private:
135  };
136 
137  NVMLDevicePool &nvml_device_pool(int num_cpu);
138 }
139 #endif
Definition: NVMLDevicePool.hpp:19
virtual int num_gpu(void) const =0
Number of GPUs on the platform.
virtual uint64_t throughput_tx_pcie(int gpu_idx) const =0
Get the pcie transmit throughput over a 20ms period for an NVML device.
virtual std::vector< unsigned int > frequency_supported_sm(int gpu_idx) const =0
Get the supported NVML device streaming multiprocessor frequencies in MHz.
virtual void power_control(int gpu_idx, int setting) const =0
Set power limit for NVML device.
virtual bool is_privileged_access(void) const =0
virtual void reset(void)=0
virtual uint64_t temperature(int gpu_idx) const =0
Get the current NVML device temperature.
virtual std::vector< int > active_process_list(int gpu_idx) const =0
Get the list of PIDs with an active context on an NVML device.
virtual uint64_t power(int gpu_idx) const =0
Get the NVML device power in milliwatts.
virtual uint64_t throughput_rx_pcie(int gpu_idx) const =0
Get the pcie receive throughput over a 20ms period for an NVML device.
virtual ~NVMLDevicePool()=default
virtual std::unique_ptr< cpu_set_t, std::function< void(cpu_set_t *)> > cpu_affinity_ideal_mask(int gpu_idx) const =0
CPU Affinitization mask for a particular GPU.
virtual uint64_t throttle_reasons(int gpu_idx) const =0
Get the current NVML device clock throttle reasons.
virtual uint64_t utilization(int gpu_idx) const =0
Get the NVML device utilization metric.
virtual uint64_t energy(int gpu_idx) const =0
Get the total energy consumed counter value for an NVML device in millijoules.
virtual void frequency_reset_control(int gpu_idx) const =0
Reset min and max frequency for NVML device.
virtual uint64_t power_limit(int gpu_idx) const =0
Get the NVML device power limit in milliwatts.
virtual void frequency_control_sm(int gpu_idx, int min_freq, int max_freq) const =0
Set min and max frequency for NVML device.
virtual uint64_t performance_state(int gpu_idx) const =0
Get the current performance state of an NVML device.
virtual uint64_t utilization_mem(int gpu_idx) const =0
Get the NVML device memory Utilization metric.
virtual uint64_t frequency_status_mem(int gpu_idx) const =0
Get the NVML device memory subsystem frequency in MHz.
virtual uint64_t frequency_status_sm(int gpu_idx) const =0
Get the NVML device streaming multiprocessor frequency in MHz.
Definition: Agg.cpp:20
NVMLDevicePool & nvml_device_pool(const int num_cpu)
Definition: NVMLDevicePool.cpp:26