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

Update vGPU type regex to account for the RTX*-Ada GPU product string #43

Merged
merged 1 commit into from
Jul 1, 2024
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
12 changes: 12 additions & 0 deletions pkg/types/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ func TestParseVGPUType(t *testing.T) {
"bogus",
false,
},
{
"Valid RTX6000-Ada-2Q",
"RTX6000-Ada-2Q",
true,
},
}

for _, tc := range testCases {
Expand Down Expand Up @@ -218,6 +223,13 @@ func TestVGPUConfigAssertValid(t *testing.T) {
},
false,
},
{
"Valid config - RTX Ada device",
map[string]int{
"RTX6000-Ada-2Q": 24,
},
true,
},
}

for _, tc := range testCases {
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/vgpu_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
// timeSlicedRegex represents the format for a time-sliced, vGPU type name.
// It embeds the GPU type, framebuffer size in GB, and a letter representing the 'series'.
// Note: The framebuffer size can be '0' to represent 512MB (i.e. M60-0Q).
timeSlicedRegex = "^(?P<GPU>[A-Z0-9]+)-(?P<GB>0|[1-9][0-9]*)(?P<S>A|B|C|Q)$"
timeSlicedRegex = "^(?P<GPU>[A-Z0-9]+(-([a-zA-Z]+))*)-(?P<GB>0|[1-9][0-9]*)(?P<S>A|B|C|Q)$"
// migBackedRegex represents the format for a MIG-backed, vGPU type name.
// In addition to embedding all of the fields from 'timeSlicedRegex', it also
// contains the number of GPU instances and any additional attributes (i.e. media extensions).
Expand Down