Skip to content

Commit

Permalink
Add logs for preferred allocation
Browse files Browse the repository at this point in the history
Signed-off-by: ghokun <gokhun@gmail.com>
  • Loading branch information
ghokun committed Mar 24, 2022
1 parent a3cdfcb commit 97bcad9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/device-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
capabilities:
add: ["SYS_ADMIN"]
containers:
- image: ghcr.io/kuartis/kuartis-virtual-gpu-device-plugin:0.6.0
- image: ghcr.io/kuartis/kuartis-virtual-gpu-device-plugin:0.6.1
name: kuartis-virtual-gpu-device-plugin-ctr
command:
- /usr/bin/virtual-gpu-device-plugin
Expand Down
2 changes: 2 additions & 0 deletions pkg/gpu/nvidia/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ func (m *NvidiaDevicePlugin) GetDevicePluginOptions(context.Context, *pluginapi.

// GetPreferredAllocation returns the preferred allocation from the set of devices specified in the request
func (m *NvidiaDevicePlugin) GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error) {
log.Printf("GetPreferredAllocation request: %v", r)
response := &pluginapi.PreferredAllocationResponse{}
for _, req := range r.ContainerRequests {
// available vGPUs per physical GPU
Expand All @@ -224,6 +225,7 @@ func (m *NvidiaDevicePlugin) GetPreferredAllocation(ctx context.Context, r *plug
DeviceIDs: findAvailableDevicesOnSamePhysicalGPU(availableGpuMap, mustIncludeGpuMap, int(req.AllocationSize)),
})
}
log.Printf("GetPreferredAllocation response: %v", response)
return response, nil
}

Expand Down

0 comments on commit 97bcad9

Please sign in to comment.