11.08., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

Commit a115ed1f authored by Weronika's avatar Weronika

added memory sensors to the nvml plugin

parent 132f8520
...@@ -37,6 +37,9 @@ nvmlConfigurator::nvmlConfigurator() { ...@@ -37,6 +37,9 @@ nvmlConfigurator::nvmlConfigurator() {
_gpuFeatureMAP["GPU_POWER"] = GPU_POWER; _gpuFeatureMAP["GPU_POWER"] = GPU_POWER;
_gpuFeatureMAP["GPU_TEMP"] = GPU_TEMP; _gpuFeatureMAP["GPU_TEMP"] = GPU_TEMP;
_gpuFeatureMAP["GPU_FAN"] = GPU_FAN; _gpuFeatureMAP["GPU_FAN"] = GPU_FAN;
_gpuFeatureMAP["GPU_MEM_USED"] = GPU_MEM_USED;
_gpuFeatureMAP["GPU_MEM_FREE"] = GPU_MEM_FREE;
_gpuFeatureMAP["GPU_MEM_TOT"] = GPU_MEM_TOT;
_groupName = "group"; _groupName = "group";
_baseName = "sensor"; _baseName = "sensor";
...@@ -46,7 +49,7 @@ nvmlConfigurator::~nvmlConfigurator() {} ...@@ -46,7 +49,7 @@ nvmlConfigurator::~nvmlConfigurator() {}
void nvmlConfigurator::sensorBase(nvmlSensorBase& s, CFG_VAL config) { void nvmlConfigurator::sensorBase(nvmlSensorBase& s, CFG_VAL config) {
//ADD { //ADD {
BOOST_FOREACH (boost::property_tree::iptree::value_type &val, config) { BOOST_FOREACH (boost::property_tree::iptree::value_type &val, config) {
if (boost::iequals(val.first, "feature")) { if (boost::iequals(val.first, "feature")) {
gpuFeatureMap_t::iterator it = _gpuFeatureMAP.find(val.second.data()); gpuFeatureMap_t::iterator it = _gpuFeatureMAP.find(val.second.data());
......
...@@ -42,6 +42,9 @@ enum GPU_FEATURE { ...@@ -42,6 +42,9 @@ enum GPU_FEATURE {
GPU_POWER = 1, GPU_POWER = 1,
GPU_TEMP = 2, GPU_TEMP = 2,
GPU_FAN = 3, GPU_FAN = 3,
GPU_MEM_USED = 4,
GPU_MEM_TOT = 5,
GPU_MEM_FREE = 6,
}; };
/** /**
...@@ -109,6 +112,15 @@ class nvmlSensorBase : public SensorBase { ...@@ -109,6 +112,15 @@ class nvmlSensorBase : public SensorBase {
case GPU_FAN: case GPU_FAN:
feature = "GPU_FAN"; feature = "GPU_FAN";
break; break;
case GPU_MEM_USED:
feature = "GPU_MEM_USED";
break;
case GPU_MEM_TOT:
feature = "GPU_MEM_TOT";
break;
case GPU_MEM_FREE:
feature = "GPU_MEM_FREE";
break;
} }
LOG_VAR(ll) << leading << " Feature type: " << feature; LOG_VAR(ll) << leading << " Feature type: " << feature;
} }
......
...@@ -49,7 +49,7 @@ struct counters_t { ...@@ -49,7 +49,7 @@ struct counters_t {
// unsigned int clockspeed_graphics; // unsigned int clockspeed_graphics;
// unsigned int clockspeed_sm; // unsigned int clockspeed_sm;
// unsigned int clockspeed_mem; // unsigned int clockspeed_mem;
// nvmlMemory_t memory; nvmlMemory_t memory;
unsigned int power; unsigned int power;
// unsigned long long ecc_counts; // unsigned long long ecc_counts;
// nvmlUtilization_t utilization; // nvmlUtilization_t utilization;
...@@ -154,6 +154,18 @@ void nvmlSensorGroup::read() { ...@@ -154,6 +154,18 @@ void nvmlSensorGroup::read() {
err = nvmlDeviceGetFanSpeed(env.device,&(counters.fanspeed)); err = nvmlDeviceGetFanSpeed(env.device,&(counters.fanspeed));
reading.value = counters.fanspeed; reading.value = counters.fanspeed;
break; break;
case(GPU_MEM_USED):
err = nvmlDeviceGetMemoryInfo (env.device, &(counters.memory));
reading.value = counters.memory.used;
break;
case(GPU_MEM_TOT):
err = nvmlDeviceGetMemoryInfo (env.device, &(counters.memory));
reading.value = counters.memory.total;
break;
case(GPU_MEM_FREE):
err = nvmlDeviceGetMemoryInfo (env.device, &(counters.memory));
reading.value = counters.memory.free;
break;
} }
s->storeReading(reading); s->storeReading(reading);
#ifdef DEBUG #ifdef DEBUG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment