Skip to content

Commit f46c96b

Browse files
fix multi-gpu assignment (#1557)
Co-authored-by: Luke Lombardi <luke@beam.cloud>
1 parent be2fdbc commit f46c96b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

pkg/worker/gpu_info.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,18 @@ var resolveVisibleDevices = func() string {
6161
return os.Getenv("NVIDIA_VISIBLE_DEVICES")
6262
}
6363

64+
var allUUIDs []string
6465
for _, entry := range checkpoint.Data.PodDeviceEntries {
6566
if entry.PodUID != podUID || entry.ResourceName != "nvidia.com/gpu" {
6667
continue
6768
}
6869
for _, uuids := range entry.DeviceIDs {
69-
if len(uuids) > 0 {
70-
return strings.Join(uuids, ",")
71-
}
70+
allUUIDs = append(allUUIDs, uuids...)
7271
}
7372
}
73+
if len(allUUIDs) > 0 {
74+
return strings.Join(allUUIDs, ",")
75+
}
7476

7577
return os.Getenv("NVIDIA_VISIBLE_DEVICES")
7678
}

0 commit comments

Comments
 (0)