Skip to content

Commit 45fb8b8

Browse files
authored
set gpu index rather than gpu uuid for env NVIDIA_VISIBLE_DEVICES (#50)
1 parent dff44dc commit 45fb8b8

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
@@ -108,13 +108,13 @@ func (m *NvidiaDevicePlugin) Allocate(ctx context.Context,
108108
if id < 0 {
109109
return buildErrResponse(reqs, podReqGPU), nil
110110
}
111-
111+
log.Infof("gpu index %v,uuid: %v", id, candidateDevID)
112112
// 1. Create container requests
113113
for _, req := range reqs.ContainerRequests {
114114
reqGPU := uint(len(req.DevicesIDs))
115115
response := pluginapi.ContainerAllocateResponse{
116116
Envs: map[string]string{
117-
envNVGPU: candidateDevID,
117+
envNVGPU: fmt.Sprintf("%v", id),
118118
EnvResourceIndex: fmt.Sprintf("%d", id),
119119
EnvResourceByPod: fmt.Sprintf("%d", podReqGPU),
120120
EnvResourceByContainer: fmt.Sprintf("%d", reqGPU),

0 commit comments

Comments
 (0)