Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tsoc
superbenchmark
Commits
d7a56e0b
Commit
d7a56e0b
authored
Apr 21, 2026
by
one
Browse files
SysInfo: Simplify smi commands
parent
511807b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
superbench/tools/system_info.py
superbench/tools/system_info.py
+13
-11
No files found.
superbench/tools/system_info.py
View file @
d7a56e0b
...
@@ -286,23 +286,26 @@ def get_gpu_amd(self):
...
@@ -286,23 +286,26 @@ def get_gpu_amd(self):
return
gpu_dict
return
gpu_dict
def
_
mer
ge_hygon_gpu_json_info
(
self
,
gpu_info
,
command
):
def
_ge
t
_hygon_gpu_json_info
(
self
,
command
):
"""
Merge
Hygon GPU info from json command output.
"""
Get
Hygon GPU info from json command output.
Args:
Args:
gpu_info (dict): GPU info keyed by card id.
command (str): Command to get GPU info in json format.
command (str): Command to get GPU info in json format.
Returns:
dict: Hygon GPU info keyed by card id.
"""
"""
gpu_info
=
{}
command_output
=
self
.
_run_cmd
(
command
)
command_output
=
self
.
_run_cmd
(
command
)
command_info
=
json
.
loads
(
command_output
)
command_info
=
json
.
loads
(
command_output
)
for
card
,
card_info
in
command_info
.
items
():
for
card
,
card_info
in
command_info
.
items
():
if
not
card
.
startswith
(
'card'
):
if
not
card
.
startswith
(
'card'
):
continue
continue
if
card
not
in
gpu_info
:
gpu_info
[
card
]
=
{}
gpu_info
[
card
]
=
{}
for
key
,
value
in
card_info
.
items
():
for
key
,
value
in
card_info
.
items
():
if
key
:
if
key
:
gpu_info
[
card
][
key
]
=
value
gpu_info
[
card
][
key
]
=
value
return
gpu_info
def
get_gpu_hygon
(
self
):
def
get_gpu_hygon
(
self
):
"""Get hygon gpu info."""
"""Get hygon gpu info."""
...
@@ -336,12 +339,11 @@ def get_gpu_hygon(self):
...
@@ -336,12 +339,11 @@ def get_gpu_hygon(self):
'--showuse'
,
'--showuse'
,
'--showbw'
,
'--showbw'
,
]
]
for
option
in
hygon_json_info_options
:
command
=
'hy-smi --json {}'
.
format
(
' '
.
join
(
hygon_json_info_options
))
command
=
'hy-smi --json {}'
.
format
(
option
)
try
:
try
:
gpu_dict
[
'rocm_info'
]
=
self
.
_get_hygon_gpu_json_info
(
command
)
self
.
_merge_hygon_gpu_json_info
(
gpu_dict
[
'rocm_info'
],
command
)
except
Exception
:
except
Exception
:
logger
.
exception
(
'Error: get hygon gpu info failed with command: %s'
,
command
)
logger
.
exception
(
'Error: get hygon gpu info failed with command: %s'
,
command
)
try
:
try
:
gpu_dict
[
'topo'
]
=
self
.
_run_cmd
(
'hy-smi --showtopo'
)
gpu_dict
[
'topo'
]
=
self
.
_run_cmd
(
'hy-smi --showtopo'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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