Skip to content

Commit 6c42a17

Browse files
committed
Fix partition names
1 parent 6a06b92 commit 6c42a17

File tree

2 files changed

+75
-69
lines changed

2 files changed

+75
-69
lines changed

dra-evolution/pkg/gen/nvidia.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package gen
22

33
import (
44
"fmt"
5+
"strings"
56

67
"github.com/NVIDIA/go-nvml/pkg/nvml/mock/dgxa100"
78
"github.com/kubernetes-sigs/wg-device-management/dra-evolution/pkg/api"
@@ -98,8 +99,13 @@ func dgxa100Pool(nodeName, poolName string, gpus int) (*api.ResourcePool, error)
9899
}
99100

100101
func instanceToPartition(instance newresourceapi.NamedResourcesInstance, partitionAttrs map[string]bool) api.DevicePartition {
102+
name := strings.TrimPrefix(instance.Name, "gpu-0-")
103+
if name == "gpu-0" {
104+
name = "whole"
105+
}
106+
101107
partition := api.DevicePartition{
102-
Name: instance.Name,
108+
Name: name,
103109
Attributes: attributesToDeviceAttributes(instance.Attributes, partitionAttrs),
104110
}
105111

0 commit comments

Comments
 (0)