geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::NVMLDevicePoolImp Class Reference

#include <NVMLDevicePoolImp.hpp>

Inheritance diagram for geopm::NVMLDevicePoolImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::NVMLDevicePoolImp:
Collaboration graph
[legend]

Public Member Functions

 NVMLDevicePoolImp (const int num_cpu)
 
virtual ~NVMLDevicePoolImp ()
 
virtual int num_gpu (void) const override
 Number of GPUs on the platform. More...
 
virtual std::unique_ptr< cpu_set_t, std::function< void(cpu_set_t *)> > cpu_affinity_ideal_mask (int gpu_idx) const override
 CPU Affinitization mask for a particular GPU. More...
 
virtual uint64_t frequency_status_sm (int gpu_idx) const override
 Get the NVML device streaming multiprocessor frequency in MHz. More...
 
virtual std::vector< unsigned int > frequency_supported_sm (int gpu_idx) const override
 Get the supported NVML device streaming multiprocessor frequencies in MHz. More...
 
virtual uint64_t utilization (int gpu_idx) const override
 Get the NVML device utilization metric. More...
 
virtual uint64_t power (int gpu_idx) const override
 Get the NVML device power in milliwatts. More...
 
virtual uint64_t power_limit (int gpu_idx) const override
 Get the NVML device power limit in milliwatts. More...
 
virtual uint64_t frequency_status_mem (int gpu_idx) const override
 Get the NVML device memory subsystem frequency in MHz. More...
 
virtual uint64_t throttle_reasons (int gpu_idx) const override
 Get the current NVML device clock throttle reasons. More...
 
virtual uint64_t temperature (int gpu_idx) const override
 Get the current NVML device temperature. More...
 
virtual uint64_t energy (int gpu_idx) const override
 Get the total energy consumed counter value for an NVML device in millijoules. More...
 
virtual uint64_t performance_state (int gpu_idx) const override
 Get the current performance state of an NVML device. More...
 
virtual uint64_t throughput_rx_pcie (int gpu_idx) const override
 Get the pcie receive throughput over a 20ms period for an NVML device. More...
 
virtual uint64_t throughput_tx_pcie (int gpu_idx) const override
 Get the pcie transmit throughput over a 20ms period for an NVML device. More...
 
virtual uint64_t utilization_mem (int gpu_idx) const override
 Get the NVML device memory Utilization metric. More...
 
virtual std::vector< int > active_process_list (int gpu_idx) const override
 Get the list of PIDs with an active context on an NVML device. More...
 
virtual void frequency_control_sm (int gpu_idx, int min_freq, int max_freq) const override
 Set min and max frequency for NVML device. More...
 
virtual void frequency_reset_control (int gpu_idx) const override
 Reset min and max frequency for NVML device. More...
 
virtual void power_control (int gpu_idx, int setting) const override
 Set power limit for NVML device. More...
 
virtual bool is_privileged_access (void) const override
 
virtual void reset (void) override
 
- Public Member Functions inherited from geopm::NVMLDevicePool
 NVMLDevicePool ()=default
 
virtual ~NVMLDevicePool ()=default
 

Constructor & Destructor Documentation

◆ NVMLDevicePoolImp()

geopm::NVMLDevicePoolImp::NVMLDevicePoolImp ( const int  num_cpu)

◆ ~NVMLDevicePoolImp()

geopm::NVMLDevicePoolImp::~NVMLDevicePoolImp ( )
virtual

Member Function Documentation

◆ active_process_list()

std::vector< int > geopm::NVMLDevicePoolImp::active_process_list ( int  gpu_idx) const
overridevirtual

Get the list of PIDs with an active context on an NVML device.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
List of PIDs that are associated with a context on the specified NVML device.

Implements geopm::NVMLDevicePool.

◆ cpu_affinity_ideal_mask()

std::unique_ptr< cpu_set_t, std::function< void(cpu_set_t *)> > geopm::NVMLDevicePoolImp::cpu_affinity_ideal_mask ( int  gpu_idx) const
overridevirtual

CPU Affinitization mask for a particular GPU.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
CPU to GPU idea affinitization bitmask.

Implements geopm::NVMLDevicePool.

◆ energy()

uint64_t geopm::NVMLDevicePoolImp::energy ( int  gpu_idx) const
overridevirtual

Get the total energy consumed counter value for an NVML device in millijoules.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
GPU energy consumption in millijoules.

Implements geopm::NVMLDevicePool.

◆ frequency_control_sm()

void geopm::NVMLDevicePoolImp::frequency_control_sm ( int  gpu_idx,
int  min_freq,
int  max_freq 
) const
overridevirtual

Set min and max frequency for NVML device.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
[in]min_freqTarget min frequency in MHz.
[in]max_freqTarget max frequency in MHz.

Implements geopm::NVMLDevicePool.

◆ frequency_reset_control()

void geopm::NVMLDevicePoolImp::frequency_reset_control ( int  gpu_idx) const
overridevirtual

Reset min and max frequency for NVML device.

Parameters
[in]gpu_idxThe index indicating a particular GPU.

Implements geopm::NVMLDevicePool.

◆ frequency_status_mem()

uint64_t geopm::NVMLDevicePoolImp::frequency_status_mem ( int  gpu_idx) const
overridevirtual

Get the NVML device memory subsystem frequency in MHz.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
GPU memory frequency in MHz.

Implements geopm::NVMLDevicePool.

◆ frequency_status_sm()

uint64_t geopm::NVMLDevicePoolImp::frequency_status_sm ( int  gpu_idx) const
overridevirtual

Get the NVML device streaming multiprocessor frequency in MHz.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
GPU streaming multiproccesor frequency in MHz.

Implements geopm::NVMLDevicePool.

◆ frequency_supported_sm()

std::vector< unsigned int > geopm::NVMLDevicePoolImp::frequency_supported_sm ( int  gpu_idx) const
overridevirtual

Get the supported NVML device streaming multiprocessor frequencies in MHz.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
GPU supported streaming multiproccesor frequencies in MHz.

Implements geopm::NVMLDevicePool.

◆ is_privileged_access()

bool geopm::NVMLDevicePoolImp::is_privileged_access ( void  ) const
overridevirtual

Implements geopm::NVMLDevicePool.

◆ num_gpu()

int geopm::NVMLDevicePoolImp::num_gpu ( void  ) const
overridevirtual

Number of GPUs on the platform.

Returns
Number of NVML GPUs.

Implements geopm::NVMLDevicePool.

◆ performance_state()

uint64_t geopm::NVMLDevicePoolImp::performance_state ( int  gpu_idx) const
overridevirtual

Get the current performance state of an NVML device.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
GPU performance state, defined by the NVML API as 0 to 15, with 0 being maximum performance, 15 being minimum performance, and 32 being unknown.

Implements geopm::NVMLDevicePool.

◆ power()

uint64_t geopm::NVMLDevicePoolImp::power ( int  gpu_idx) const
overridevirtual

Get the NVML device power in milliwatts.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
GPU power consumption in milliwatts.

Implements geopm::NVMLDevicePool.

◆ power_control()

void geopm::NVMLDevicePoolImp::power_control ( int  gpu_idx,
int  setting 
) const
overridevirtual

Set power limit for NVML device.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
[in]settingPower cap in milliwatts.

Implements geopm::NVMLDevicePool.

◆ power_limit()

uint64_t geopm::NVMLDevicePoolImp::power_limit ( int  gpu_idx) const
overridevirtual

Get the NVML device power limit in milliwatts.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
GPU power limit in milliwatts.

Implements geopm::NVMLDevicePool.

◆ reset()

void geopm::NVMLDevicePoolImp::reset ( void  )
overridevirtual

Implements geopm::NVMLDevicePool.

◆ temperature()

uint64_t geopm::NVMLDevicePoolImp::temperature ( int  gpu_idx) const
overridevirtual

Get the current NVML device temperature.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
GPU temperature in Celsius.

Implements geopm::NVMLDevicePool.

◆ throttle_reasons()

uint64_t geopm::NVMLDevicePoolImp::throttle_reasons ( int  gpu_idx) const
overridevirtual

Get the current NVML device clock throttle reasons.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
GPU clock throttle reasons as defined in nvml.h.

Implements geopm::NVMLDevicePool.

◆ throughput_rx_pcie()

uint64_t geopm::NVMLDevicePoolImp::throughput_rx_pcie ( int  gpu_idx) const
overridevirtual

Get the pcie receive throughput over a 20ms period for an NVML device.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
GPU pcie receive throughput in kilobytes per second.

Implements geopm::NVMLDevicePool.

◆ throughput_tx_pcie()

uint64_t geopm::NVMLDevicePoolImp::throughput_tx_pcie ( int  gpu_idx) const
overridevirtual

Get the pcie transmit throughput over a 20ms period for an NVML device.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
GPU pcie transmit throughput in kilobytes per second.

Implements geopm::NVMLDevicePool.

◆ utilization()

uint64_t geopm::NVMLDevicePoolImp::utilization ( int  gpu_idx) const
overridevirtual

Get the NVML device utilization metric.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
GPU streaming multiprocessor utilization percentage as a whole number from 0 to 100.

Implements geopm::NVMLDevicePool.

◆ utilization_mem()

uint64_t geopm::NVMLDevicePoolImp::utilization_mem ( int  gpu_idx) const
overridevirtual

Get the NVML device memory Utilization metric.

Parameters
[in]gpu_idxThe index indicating a particular GPU.
Returns
GPU memory utilization percentage as a whole number from 0 to 100.

Implements geopm::NVMLDevicePool.


The documentation for this class was generated from the following files: