Skip to content

Commit 475e1a3

Browse files
committed
replace podreqgpu with containerreqgpu
Signed-off-by: 630445639 <[email protected]>
1 parent 9aa8c1a commit 475e1a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/gpu/nvidia/allocate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (m *NvidiaDevicePlugin) buildErrResponse(reqs *pluginapi.AllocateRequest, p
3434
},
3535
}
3636
if m.mps {
37-
response.Envs[EnvPercentage] = fmt.Sprintf("%d", 100*podReqGPU/getGPUMemory())
37+
response.Envs[EnvPercentage] = fmt.Sprintf("%d", 100*uint(len(req.DevicesIDs))/getGPUMemory()) //
3838
}
3939
responses.ContainerResponses = append(responses.ContainerResponses, &response)
4040
}
@@ -125,7 +125,7 @@ func (m *NvidiaDevicePlugin) Allocate(ctx context.Context,
125125
},
126126
}
127127
if m.mps {
128-
response.Envs[EnvPercentage] = fmt.Sprintf("%d", 100*podReqGPU/getGPUMemory())
128+
response.Envs[EnvPercentage] = fmt.Sprintf("%d", 100*reqGPU/getGPUMemory())
129129
}
130130
responses.ContainerResponses = append(responses.ContainerResponses, &response)
131131
}

0 commit comments

Comments
 (0)