mirror of
https://github.com/clearml/clearml-agent
synced 2025-06-26 18:16:15 +00:00
Protect dynamic GPUs from failing to parse worker GPU index
This commit is contained in:
parent
1011544533
commit
f50ba005b5
@ -1109,7 +1109,11 @@ class Worker(ServiceCommandSection):
|
|||||||
if w.id.startswith(worker_name) and w.id != self.worker_id]
|
if w.id.startswith(worker_name) and w.id != self.worker_id]
|
||||||
gpus = []
|
gpus = []
|
||||||
for w in our_workers:
|
for w in our_workers:
|
||||||
gpus += [int(g) for g in w.split(':')[-1].lower().replace('gpu', '').split(',')]
|
for g in w.split(':')[-1].lower().replace('gpu', '').split(','):
|
||||||
|
try:
|
||||||
|
gpus += [int(g.strip())]
|
||||||
|
except (ValueError, TypeError):
|
||||||
|
print("INFO: failed parsing GPU int('{}') - skipping".format(g))
|
||||||
available_gpus = list(set(gpu_indexes) - set(gpus))
|
available_gpus = list(set(gpu_indexes) - set(gpus))
|
||||||
|
|
||||||
return available_gpus
|
return available_gpus
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user