Skip to content

Commit

Permalink
Update GPU message
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolargo committed Apr 13, 2024
1 parent 1de207e commit b688121
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions glances/plugins/gpu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def update(self):
# {
# "key": "gpu_id",
# "gpu_id": "nvidia1",
# "name": "Fake GeForce GTX2",
# "name": "Fake GeForce GTX1",
# "mem": 15,
# "proc": 8,
# "temperature": 65,
Expand Down Expand Up @@ -190,10 +190,15 @@ def msg_curse(self, args=None, max_width=None):
# Header
header = ''
if len(self.stats) > 1:
header += '{} {} '.format(len(self.stats),
'GPUs' if len(self.stats) > 1 else 'GPU')
if same_name:
header += '{}'.format(len(self.stats))
if same_name:
header += ' {}'.format(gpu_stats['name'])
else:
header += ' GPUs'
elif same_name:
header += '{}'.format(gpu_stats['name'])
else:
header += 'GPU'
msg = header[:17]
ret.append(self.curse_add_line(msg, "TITLE"))

Expand Down

0 comments on commit b688121

Please sign in to comment.