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

Commit 0d737bc2 authored by Weronika's avatar Weronika

added clock sensors to the nvml plugin

parent a115ed1f
...@@ -40,6 +40,9 @@ nvmlConfigurator::nvmlConfigurator() { ...@@ -40,6 +40,9 @@ nvmlConfigurator::nvmlConfigurator() {
_gpuFeatureMAP["GPU_MEM_USED"] = GPU_MEM_USED; _gpuFeatureMAP["GPU_MEM_USED"] = GPU_MEM_USED;
_gpuFeatureMAP["GPU_MEM_FREE"] = GPU_MEM_FREE; _gpuFeatureMAP["GPU_MEM_FREE"] = GPU_MEM_FREE;
_gpuFeatureMAP["GPU_MEM_TOT"] = GPU_MEM_TOT; _gpuFeatureMAP["GPU_MEM_TOT"] = GPU_MEM_TOT;
_gpuFeatureMAP["GPU_CLK_GP"] = GPU_CLK_GP;
_gpuFeatureMAP["GPU_CLK_SM"] = GPU_CLK_SM;
_gpuFeatureMAP["GPU_CLK_MEM"] = GPU_CLK_MEM;
_groupName = "group"; _groupName = "group";
_baseName = "sensor"; _baseName = "sensor";
......
...@@ -45,6 +45,9 @@ enum GPU_FEATURE { ...@@ -45,6 +45,9 @@ enum GPU_FEATURE {
GPU_MEM_USED = 4, GPU_MEM_USED = 4,
GPU_MEM_TOT = 5, GPU_MEM_TOT = 5,
GPU_MEM_FREE = 6, GPU_MEM_FREE = 6,
GPU_CLK_GP = 7,
GPU_CLK_SM = 8,
GPU_CLK_MEM = 9,
}; };
/** /**
...@@ -121,6 +124,15 @@ class nvmlSensorBase : public SensorBase { ...@@ -121,6 +124,15 @@ class nvmlSensorBase : public SensorBase {
case GPU_MEM_FREE: case GPU_MEM_FREE:
feature = "GPU_MEM_FREE"; feature = "GPU_MEM_FREE";
break; break;
case GPU_CLK_GP:
feature = "GPU_CLK_GP";
break;
case GPU_CLK_SM:
feature = "GPU_CLK_SM";
break;
case GPU_CLK_MEM:
feature = "GPU_CLK_MEM";
break;
} }
LOG_VAR(ll) << leading << " Feature type: " << feature; LOG_VAR(ll) << leading << " Feature type: " << feature;
} }
......
...@@ -46,9 +46,9 @@ struct counters_t { ...@@ -46,9 +46,9 @@ struct counters_t {
// unsigned int freq3; // unsigned int freq3;
unsigned int temperature; unsigned int temperature;
unsigned int fanspeed; unsigned int fanspeed;
// 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;
...@@ -166,6 +166,18 @@ void nvmlSensorGroup::read() { ...@@ -166,6 +166,18 @@ void nvmlSensorGroup::read() {
err = nvmlDeviceGetMemoryInfo (env.device, &(counters.memory)); err = nvmlDeviceGetMemoryInfo (env.device, &(counters.memory));
reading.value = counters.memory.free; reading.value = counters.memory.free;
break; break;
case(GPU_CLK_GP):
err = nvmlDeviceGetClock (env.device, NVML_CLOCK_GRAPHICS,NVML_CLOCK_ID_CURRENT,&(counters.clockspeed_graphics));
reading.value = counters.clockspeed_graphics;
break;
case(GPU_CLK_SM):
err = nvmlDeviceGetClock (env.device, NVML_CLOCK_SM,NVML_CLOCK_ID_CURRENT,&(counters.clockspeed_sm));
reading.value = counters.clockspeed_sm;
break;
case(GPU_CLK_MEM):
err = nvmlDeviceGetClock (env.device, NVML_CLOCK_MEM,NVML_CLOCK_ID_CURRENT,&(counters.clockspeed_mem));
reading.value = counters.clockspeed_mem;
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