Skip to content

Commit b5bebe6

Browse files
authored
feat: add support for ada lovelace and ampere GPU architecture (#197)
Signed-off-by: Amber Xue <ambermingxin@nvidia.com>
1 parent 8c48f2d commit b5bebe6

3 files changed

Lines changed: 61 additions & 8 deletions

File tree

docs/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Validates the local prerequisites required for installation and enrollment.
9292

9393
**What it checks:**
9494
- NVIDIA GPU presence
95-
- supported GPU architecture (`Hopper`, `Blackwell`, `Rubin`)
95+
- supported GPU architecture (`Hopper`, `Blackwell`, `Rubin`, `Ampere`, `Ada Lovelace`)
9696
- NVIDIA driver major version (`510` or newer)
9797
- DCGM HostEngine reachability
9898
- DCGM HostEngine minimum version (`4.2.3`)

internal/precheck/precheck.go

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
"github.com/NVIDIA/fleet-intelligence-agent/internal/dcgmversion"
3434
)
3535

36-
var supportedArchitectures = []string{"Hopper", "Blackwell", "Rubin"}
36+
var supportedArchitectures = []string{"Hopper", "Blackwell", "Rubin", "Ampere", "Ada Lovelace"}
3737

3838
const minimumDCGMVersion = "4.2.3"
3939
const minimumDriverMajorVersion = 510
@@ -206,11 +206,15 @@ func evaluateArchitecture(input *Input) Check {
206206
}
207207

208208
if !slices.ContainsFunc(supportedArchitectures, func(s string) bool {
209-
return strings.EqualFold(s, input.GPUInfo.Architecture)
209+
return architectureMatches(s, input.GPUInfo.Architecture)
210210
}) {
211211
return Check{
212-
Name: "gpu-architecture",
213-
Message: "Unsupported GPU architecture: " + input.GPUInfo.Architecture + "; supported architectures are Hopper, Blackwell, and Rubin",
212+
Name: "gpu-architecture",
213+
Message: fmt.Sprintf(
214+
"Unsupported GPU architecture: %s; supported architectures are %s",
215+
input.GPUInfo.Architecture,
216+
formatSupportedArchitectures(supportedArchitectures),
217+
),
214218
}
215219
}
216220

@@ -221,6 +225,31 @@ func evaluateArchitecture(input *Input) Check {
221225
}
222226
}
223227

228+
func architectureMatches(supported, detected string) bool {
229+
return normalizeArchitectureName(supported) == normalizeArchitectureName(detected)
230+
}
231+
232+
func normalizeArchitectureName(v string) string {
233+
normalized := strings.TrimSpace(strings.ToLower(v))
234+
normalized = strings.ReplaceAll(normalized, "-", "")
235+
normalized = strings.ReplaceAll(normalized, "_", "")
236+
normalized = strings.ReplaceAll(normalized, " ", "")
237+
return normalized
238+
}
239+
240+
func formatSupportedArchitectures(architectures []string) string {
241+
switch len(architectures) {
242+
case 0:
243+
return ""
244+
case 1:
245+
return architectures[0]
246+
case 2:
247+
return architectures[0] + " and " + architectures[1]
248+
default:
249+
return strings.Join(architectures[:len(architectures)-1], ", ") + ", and " + architectures[len(architectures)-1]
250+
}
251+
}
252+
224253
func evaluateDriver(input *Input) Check {
225254
if !gpuHardwareDetected(input) {
226255
return Check{

internal/precheck/precheck_test.go

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,30 @@ func TestEvaluateArchitecture(t *testing.T) {
5858
},
5959
wantPassed: true,
6060
},
61+
{
62+
name: "passes for ampere",
63+
input: Input{
64+
GPUInfo: gpuInfo("Ampere"),
65+
GPUDriverVersion: "575.57.08",
66+
},
67+
wantPassed: true,
68+
},
69+
{
70+
name: "passes for ada lovelace",
71+
input: Input{
72+
GPUInfo: gpuInfo("Ada Lovelace"),
73+
GPUDriverVersion: "575.57.08",
74+
},
75+
wantPassed: true,
76+
},
77+
{
78+
name: "passes for ada-lovelace",
79+
input: Input{
80+
GPUInfo: gpuInfo("Ada-Lovelace"),
81+
GPUDriverVersion: "575.57.08",
82+
},
83+
wantPassed: true,
84+
},
6185
{
6286
name: "fails for missing gpu",
6387
input: Input{
@@ -79,12 +103,12 @@ func TestEvaluateArchitecture(t *testing.T) {
79103
{
80104
name: "fails for unsupported architecture",
81105
input: Input{
82-
GPUInfo: gpuInfo("Ampere"),
106+
GPUInfo: gpuInfo("Turing"),
83107
GPUDriverVersion: "575.57.08",
84108
},
85109
wantPassed: false,
86110
wantMessages: []string{
87-
"Unsupported GPU architecture: Ampere; supported architectures are Hopper, Blackwell, and Rubin",
111+
"Unsupported GPU architecture: Turing; supported architectures are Hopper, Blackwell, Rubin, Ampere, and Ada Lovelace",
88112
},
89113
},
90114
{
@@ -118,7 +142,7 @@ func TestEvaluateArchitecture(t *testing.T) {
118142
func TestSupportedArchitectures(t *testing.T) {
119143
t.Parallel()
120144

121-
require.ElementsMatch(t, []string{"Hopper", "Blackwell", "Rubin"}, SupportedArchitectures())
145+
require.ElementsMatch(t, []string{"Hopper", "Blackwell", "Rubin", "Ampere", "Ada Lovelace"}, SupportedArchitectures())
122146
}
123147

124148
func TestEvaluateDriverAndNVAT(t *testing.T) {

0 commit comments

Comments
 (0)