Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
132f8520
Commit
132f8520
authored
Feb 20, 2020
by
Weronika Filinger
Browse files
added a fan sensor to the nvml plugin
parent
58de956d
Changes
3
Hide whitespace changes
Inline
Side-by-side
dcdbpusher/sensors/nvml/nvmlConfigurator.cpp
View file @
132f8520
...
...
@@ -36,6 +36,7 @@ nvmlConfigurator::nvmlConfigurator() {
_gpuFeatureMAP
[
"GPU_ENERGY"
]
=
GPU_ENERGY
;
_gpuFeatureMAP
[
"GPU_POWER"
]
=
GPU_POWER
;
_gpuFeatureMAP
[
"GPU_TEMP"
]
=
GPU_TEMP
;
_gpuFeatureMAP
[
"GPU_FAN"
]
=
GPU_FAN
;
_groupName
=
"group"
;
_baseName
=
"sensor"
;
...
...
dcdbpusher/sensors/nvml/nvmlSensorBase.h
View file @
132f8520
...
...
@@ -41,6 +41,7 @@ enum GPU_FEATURE {
GPU_ENERGY
=
0
,
GPU_POWER
=
1
,
GPU_TEMP
=
2
,
GPU_FAN
=
3
,
};
/**
...
...
@@ -105,6 +106,9 @@ class nvmlSensorBase : public SensorBase {
case
GPU_TEMP
:
feature
=
"GPU_TEMP"
;
break
;
case
GPU_FAN
:
feature
=
"GPU_FAN"
;
break
;
}
LOG_VAR
(
ll
)
<<
leading
<<
" Feature type: "
<<
feature
;
}
...
...
dcdbpusher/sensors/nvml/nvmlSensorGroup.cpp
View file @
132f8520
...
...
@@ -45,13 +45,13 @@ struct counters_t {
// unsigned int freq2;
// unsigned int freq3;
unsigned
int
temperature
;
//
unsigned int fanspeed;
unsigned
int
fanspeed
;
// 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;
// unsigned long long ecc_counts;
// nvmlUtilization_t utilization;
}
counters
;
...
...
@@ -147,14 +147,18 @@ void nvmlSensorGroup::read() {
reading
.
value
=
counters
.
power
;
break
;
case
(
GPU_TEMP
):
err
=
nvmlDeviceGetTemperature
(
env
.
device
,
NVML_TEMPERATURE_GPU
,
&
(
counters
.
temperature
));
reading
.
value
=
counters
.
temperature
;
break
;
err
=
nvmlDeviceGetTemperature
(
env
.
device
,
NVML_TEMPERATURE_GPU
,
&
(
counters
.
temperature
));
reading
.
value
=
counters
.
temperature
;
break
;
case
(
GPU_FAN
):
err
=
nvmlDeviceGetFanSpeed
(
env
.
device
,
&
(
counters
.
fanspeed
));
reading
.
value
=
counters
.
fanspeed
;
break
;
}
s
->
storeReading
(
reading
);
//
ifdef DEBUG
#
ifdef DEBUG
LOG
(
debug
)
<<
_groupName
<<
"::"
<<
s
->
getName
()
<<
" raw reading:
\"
"
<<
reading
.
value
<<
"
\"
"
;
//
endif
#
endif
}
}
catch
(
const
std
::
exception
&
e
)
{
LOG
(
error
)
<<
"Sensorgroup"
<<
_groupName
<<
" could not read value: "
<<
e
.
what
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment