Skip to content

Commit

Permalink
This will go on forever
Browse files Browse the repository at this point in the history
Signed-off-by: ghokun <[email protected]>
  • Loading branch information
ghokun committed Mar 21, 2022
1 parent 5298f7d commit dd92a41
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
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.4.9
- image: ghcr.io/kuartis/kuartis-virtual-gpu-device-plugin:0.4.10
name: kuartis-virtual-gpu-device-plugin-ctr
command:
- /usr/bin/virtual-gpu-device-plugin
Expand Down
29 changes: 15 additions & 14 deletions pkg/gpu/nvidia/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,21 @@ func collectMetrics(w http.ResponseWriter, r *http.Request) {
log.Printf("Found %d processes on GPU %d", len(processes), i)
for _, process := range processes {
containerId := getContainerId(process.Pid)
container := containerMap[containerId]
log.Printf("Using %s Found container %+v for process: %d", containerId, container, process.Pid)
collected = append(collected, metric{
Pid: process.Pid,
UsedGpuMemory: process.UsedGpuMemory,
GpuIndex: i,
GpuUUID: getDeviceUUID(d),
Node: container.Node,
Namespace: container.Namespace,
Pod: container.Pod,
PodUid: container.PodUid,
Container: container.Container,
ContainerId: container.ContainerId,
})
if container, ok := containerMap[strings.TrimSpace(containerId)]; ok {
log.Printf("Using %s Found container %+v for process: %d", containerId, container, process.Pid)
collected = append(collected, metric{
Pid: process.Pid,
UsedGpuMemory: process.UsedGpuMemory,
GpuIndex: i,
GpuUUID: getDeviceUUID(d),
Node: container.Node,
Namespace: container.Namespace,
Pod: container.Pod,
PodUid: container.PodUid,
Container: container.Container,
ContainerId: container.ContainerId,
})
}
}
}

Expand Down

0 comments on commit dd92a41

Please sign in to comment.