Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable pod attributes for gpu-sharing in gke #433

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/pkg/transformation/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ import (
var (
connectionTimeout = 10 * time.Second

gkeMigDeviceIDRegex = regexp.MustCompile(`^nvidia([0-9]+)/gi([0-9]+)$`)
// Allow for MIG devices with or without GPU sharing to match in GKE.
gkeMigDeviceIDRegex = regexp.MustCompile(`^nvidia([0-9]+)/gi([0-9]+)(/vgpu[0-9]+)?$`)
gkeVirtualGPUDeviceIDSeparator = "/vgpu"
)

Expand Down
14 changes: 14 additions & 0 deletions internal/pkg/transformation/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ func TestProcessPodMapper_WithD_Different_Format_Of_DeviceID(t *testing.T) {
PODGPUID: "b8ea3855-276c-c9cb-b366-c6fa655957c5",
NvidiaResourceNames: []string{"nvidia.com/a100"},
},
{
KubernetesGPUIDType: appconfig.DeviceName,
ResourceName: appconfig.NvidiaResourceName,
MetricMigProfile: "1g.10gb",
GPUInstanceID: 0,
PODGPUID: "nvidia0/gi0/vgpu0",
},
{
KubernetesGPUIDType: appconfig.DeviceName,
ResourceName: appconfig.NvidiaResourceName,
MetricMigProfile: "1g.10gb",
GPUInstanceID: 1,
PODGPUID: "nvidia0/gi1/vgpu0",
},
}

for _, tc := range testCases {
Expand Down
Loading