Skip to content

Commit 97bcad9

Browse files
committed
Add logs for preferred allocation
Signed-off-by: ghokun <[email protected]>
1 parent a3cdfcb commit 97bcad9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

manifests/device-plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ spec:
4545
capabilities:
4646
add: ["SYS_ADMIN"]
4747
containers:
48-
- image: ghcr.io/kuartis/kuartis-virtual-gpu-device-plugin:0.6.0
48+
- image: ghcr.io/kuartis/kuartis-virtual-gpu-device-plugin:0.6.1
4949
name: kuartis-virtual-gpu-device-plugin-ctr
5050
command:
5151
- /usr/bin/virtual-gpu-device-plugin

pkg/gpu/nvidia/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ func (m *NvidiaDevicePlugin) GetDevicePluginOptions(context.Context, *pluginapi.
201201

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

0 commit comments

Comments
 (0)