Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
dcdb
dcdb
Commits
a115ed1f
Commit
a115ed1f
authored
Feb 20, 2020
by
Weronika Filinger
Browse files
added memory sensors to the nvml plugin
parent
132f8520
Changes
3
Hide whitespace changes
Inline
Side-by-side
dcdbpusher/sensors/nvml/nvmlConfigurator.cpp
View file @
a115ed1f
...
...
@@ -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"
;
...
...
@@ -46,7 +49,7 @@ nvmlConfigurator::~nvmlConfigurator() {}
void
nvmlConfigurator
::
sensorBase
(
nvmlSensorBase
&
s
,
CFG_VAL
config
)
{
//ADD {
BOOST_FOREACH
(
boost
::
property_tree
::
iptree
::
value_type
&
val
,
config
)
{
if
(
boost
::
iequals
(
val
.
first
,
"feature"
))
{
gpuFeatureMap_t
::
iterator
it
=
_gpuFeatureMAP
.
find
(
val
.
second
.
data
());
...
...
dcdbpusher/sensors/nvml/nvmlSensorBase.h
View file @
a115ed1f
...
...
@@ -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
;
}
...
...
dcdbpusher/sensors/nvml/nvmlSensorGroup.cpp
View file @
a115ed1f
...
...
@@ -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
...
...
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