Fixed is_alive to work with devices that can change name after init.

This commit is contained in:
Marc-Andre Ferland
2022-10-18 20:33:37 -04:00
parent cfd6751777
commit fcdb086daf
3 changed files with 36 additions and 23 deletions

View File

@ -130,7 +130,7 @@ def device_init(device_selection=None):
device_selection = device_selection.lower()
if device_selection.startswith('gpu:'):
device_selection = int(device_selection[4:])
if device_selection != 'current' and device_selection != 'gpu':
if device_selection != 'cuda' and device_selection != 'current' and device_selection != 'gpu':
if device_select(device_selection):
if isinstance(device_selection, int):
print(f'Setting GPU:{device_selection} as active')