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() {
_gpuFeatureMAP["GPU_POWER"] = GPU_POWER;
_gpuFeatureMAP["GPU_TEMP"] = GPU_TEMP;
_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";
_baseName = "sensor";
......
......@@ -42,6 +42,9 @@ enum GPU_FEATURE {
GPU_POWER = 1,
GPU_TEMP = 2,
GPU_FAN = 3,
GPU_MEM_USED = 4,
GPU_MEM_TOT = 5,
GPU_MEM_FREE = 6,
};
/**
......@@ -109,6 +112,15 @@ class nvmlSensorBase : public SensorBase {
case GPU_FAN:
feature = "GPU_FAN";
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;
}
......
......@@ -49,7 +49,7 @@ struct counters_t {
// unsigned int clockspeed_graphics;
// unsigned int clockspeed_sm;
// unsigned int clockspeed_mem;
// nvmlMemory_t memory;
nvmlMemory_t memory;
unsigned int power;
// unsigned long long ecc_counts;
// nvmlUtilization_t utilization;
......@@ -154,6 +154,18 @@ void nvmlSensorGroup::read() {
err = nvmlDeviceGetFanSpeed(env.device,&(counters.fanspeed));
reading.value = counters.fanspeed;
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);
#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