Commit d6370083 authored by Weronika's avatar Weronika

added the untilisation sensors to the nvml plugin

parent 925799e1
......@@ -77,3 +77,24 @@ group nvml_clock {
}
group nvml_utilisation {
default def1
sensor gpu_utl_memory {
mqttsuffix /util_mem
feature GPU_UTL_MEM
}
sensor gpu_utl_gpu {
mqttsuffix /util_gpu
feature GPU_UTL_GPU
}
}
......@@ -43,6 +43,8 @@ nvmlConfigurator::nvmlConfigurator() {
_gpuFeatureMAP["GPU_CLK_GP"] = GPU_CLK_GP;
_gpuFeatureMAP["GPU_CLK_SM"] = GPU_CLK_SM;
_gpuFeatureMAP["GPU_CLK_MEM"] = GPU_CLK_MEM;
_gpuFeatureMAP["GPU_UTL_MEM"] = GPU_UTL_MEM;
_gpuFeatureMAP["GPU_UTL_GPU"] = GPU_UTL_GPU;
_groupName = "group";
_baseName = "sensor";
......
......@@ -48,6 +48,8 @@ enum GPU_FEATURE {
GPU_CLK_GP = 7,
GPU_CLK_SM = 8,
GPU_CLK_MEM = 9,
GPU_UTL_MEM = 10,
GPU_UTL_GPU = 11,
};
/**
......@@ -133,6 +135,12 @@ class nvmlSensorBase : public SensorBase {
case GPU_CLK_MEM:
feature = "GPU_CLK_MEM";
break;
case GPU_UTL_MEM:
feature = "GPU_UTL_MEM";
break;
case GPU_UTL_GPU:
feature = "GPU_UTL_GPU";
break;
}
LOG_VAR(ll) << leading << " Feature type: " << feature;
}
......
......@@ -52,7 +52,7 @@ struct counters_t {
nvmlMemory_t memory;
unsigned int power;
// unsigned long long ecc_counts;
// nvmlUtilization_t utilization;
nvmlUtilization_t utilization;
} counters;
nvmlSensorGroup::nvmlSensorGroup(const std::string& name) :
......@@ -178,6 +178,15 @@ void nvmlSensorGroup::read() {
err = nvmlDeviceGetClock (env.device, NVML_CLOCK_MEM,NVML_CLOCK_ID_CURRENT,&(counters.clockspeed_mem));
reading.value = counters.clockspeed_mem;
break;
case(GPU_UTL_MEM):
err = nvmlDeviceGetUtilizationRates (env.device, &(counters.utilization));
reading.value = counters.utilization.memory;
break;
case(GPU_UTL_GPU):
err = nvmlDeviceGetUtilizationRates (env.device, &(counters.utilization));
reading.value = counters.utilization.gpu;
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