Skip to content

Commit 5298f7d

Browse files
committed
Cant find the bug :/
Signed-off-by: ghokun <[email protected]>
1 parent 4656f9b commit 5298f7d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
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.4.8
48+
- image: ghcr.io/kuartis/kuartis-virtual-gpu-device-plugin:0.4.9
4949
name: kuartis-virtual-gpu-device-plugin-ctr
5050
command:
5151
- /usr/bin/virtual-gpu-device-plugin

pkg/gpu/nvidia/metrics.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ func collectMetrics(w http.ResponseWriter, r *http.Request) {
7777
log.Printf("Found %d containers", len(containers.Containers))
7878
containerMap := make(map[string]containerInfo)
7979
for _, container := range containers.GetContainers() {
80-
log.Printf("Found container %+v", container)
8180
containerMap[container.GetId()] = containerInfo{
8281
Node: node,
8382
Namespace: container.GetLabels()["io.kubernetes.pod.namespace"],
@@ -87,6 +86,7 @@ func collectMetrics(w http.ResponseWriter, r *http.Request) {
8786
ContainerId: container.GetId(),
8887
}
8988
}
89+
log.Printf("Current map %+v", containerMap)
9090
collected := []metric{}
9191
for i := 0; i < getDeviceCount(); i++ {
9292
d, ret := nvml.DeviceGetHandleByIndex(i)
@@ -97,7 +97,7 @@ func collectMetrics(w http.ResponseWriter, r *http.Request) {
9797
for _, process := range processes {
9898
containerId := getContainerId(process.Pid)
9999
container := containerMap[containerId]
100-
log.Printf("Found container %+v for process: %d", container, process.Pid)
100+
log.Printf("Using %s Found container %+v for process: %d", containerId, container, process.Pid)
101101
collected = append(collected, metric{
102102
Pid: process.Pid,
103103
UsedGpuMemory: process.UsedGpuMemory,

0 commit comments

Comments
 (0)