Skip to content

Commit

Permalink
Cant find the bug :/
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 4656f9b commit 5298f7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 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.8
- image: ghcr.io/kuartis/kuartis-virtual-gpu-device-plugin:0.4.9
name: kuartis-virtual-gpu-device-plugin-ctr
command:
- /usr/bin/virtual-gpu-device-plugin
Expand Down
4 changes: 2 additions & 2 deletions pkg/gpu/nvidia/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func collectMetrics(w http.ResponseWriter, r *http.Request) {
log.Printf("Found %d containers", len(containers.Containers))
containerMap := make(map[string]containerInfo)
for _, container := range containers.GetContainers() {
log.Printf("Found container %+v", container)
containerMap[container.GetId()] = containerInfo{
Node: node,
Namespace: container.GetLabels()["io.kubernetes.pod.namespace"],
Expand All @@ -87,6 +86,7 @@ func collectMetrics(w http.ResponseWriter, r *http.Request) {
ContainerId: container.GetId(),
}
}
log.Printf("Current map %+v", containerMap)
collected := []metric{}
for i := 0; i < getDeviceCount(); i++ {
d, ret := nvml.DeviceGetHandleByIndex(i)
Expand All @@ -97,7 +97,7 @@ func collectMetrics(w http.ResponseWriter, r *http.Request) {
for _, process := range processes {
containerId := getContainerId(process.Pid)
container := containerMap[containerId]
log.Printf("Found container %+v for process: %d", container, process.Pid)
log.Printf("Using %s Found container %+v for process: %d", containerId, container, process.Pid)
collected = append(collected, metric{
Pid: process.Pid,
UsedGpuMemory: process.UsedGpuMemory,
Expand Down

0 comments on commit 5298f7d

Please sign in to comment.