File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -497,7 +497,7 @@ def get_visible_devices():
497497 )
498498 for v in device_vars :
499499 try :
500- return tuple (int (i ) for i in os .environ [v ].split (',' ))
500+ return v , tuple (int (i ) for i in os .environ [v ].split (',' ))
501501 except ValueError :
502502 # Visible devices set via UUIDs or other non-integer identifiers.
503503 warning ("Setting visible devices via UUIDs or other non-integer"
@@ -507,7 +507,7 @@ def get_visible_devices():
507507 # Environment variable not set
508508 continue
509509
510- return None
510+ return None , None
511511
512512
513513@memoized_func
Original file line number Diff line number Diff line change @@ -1398,15 +1398,15 @@ def _physical_deviceid(self):
13981398 rank = self .comm .Get_rank () if self .comm != MPI .COMM_NULL else 0
13991399 logical_deviceid = rank
14001400
1401- visible_devices = get_visible_devices ()
1401+ visible_device_var , visible_devices = get_visible_devices ()
14021402 if visible_devices is None :
14031403 return logical_deviceid
14041404 else :
14051405 try :
14061406 return visible_devices [logical_deviceid ]
14071407 except IndexError :
14081408 errmsg = (f"A deviceid value of { logical_deviceid } is not valid "
1409- f"with VISIBLE_DEVICES ={ visible_devices } . Note that "
1409+ f"with { visible_device_var } ={ visible_devices } . Note that "
14101410 "deviceid corresponds to the logical index within the "
14111411 "visible devices, not the physical device index." )
14121412 raise ValueError (errmsg )
You can’t perform that action at this time.
0 commit comments