harmonytask task with no gpu

This commit is contained in:
Andrew Jackson (Ajax) 2023-08-29 10:19:18 -05:00
parent c73f35dcea
commit 4f2650b0c0

View File

@ -219,8 +219,12 @@ func (h *taskTypeHandler) AssertMachineHasCapacity() error {
if r.Gpu-h.Cost.Gpu < 0 {
return errors.New("Did not accept " + h.Name + " task: out of available GPU")
}
gpuRamSum := lo.Sum(h.Cost.GpuRam)
if gpuRamSum == 0 {
goto enoughGpuRam
}
for _, u := range r.GpuRam {
if u >= lo.Sum(h.Cost.GpuRam) {
if u >= gpuRamSum {
goto enoughGpuRam
}
}