Skip to content

Commit f4dcba2

Browse files
marifamdJeniferC99
authored andcommitted
[SWDEV-558993] Fix amd-smi list to not check for groups for bdf
Signed-off-by: Maisam Arif <[email protected]> Change-Id: I1ff9c0e00a9188435b0ee60e57c2678121dd8e72
1 parent 33850ca commit f4dcba2

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

amdsmi_cli/amdsmi_commands.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,20 @@ def list(self, args, multiple_devices=False, gpu=None):
228228
# Get gpu_id for logging
229229
gpu_id = self.helpers.get_gpu_id_from_device_handle(args.gpu)
230230

231-
# Only fetch data if group check passed; otherwise force "N/A"
232-
if _group_in_groups:
233-
try:
234-
bdf = amdsmi_interface.amdsmi_get_gpu_device_bdf(args.gpu)
235-
except amdsmi_exception.AmdSmiLibraryException as e:
236-
bdf = "N/A"
231+
# Always try to get BDF regardless of group check
232+
try:
233+
bdf = amdsmi_interface.amdsmi_get_gpu_device_bdf(args.gpu)
234+
except amdsmi_exception.AmdSmiLibraryException as e:
235+
bdf = "N/A"
236+
237+
# Only fetch UUID if group check passed; otherwise force "N/A"
238+
if _group_in_groups:
237239
try:
238240
uuid = amdsmi_interface.amdsmi_get_gpu_device_uuid(args.gpu)
239241
except amdsmi_exception.AmdSmiLibraryException:
240242
uuid = "N/A"
241243
else:
242-
# user not in render/video → everything is N/A
243-
bdf = "N/A"
244+
# user not in render/video → UUID is N/A
244245
uuid = "N/A"
245246

246247
try:

0 commit comments

Comments
 (0)