Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func parseNvidiaNumaInfo(idx int, nvidiaTopoStr string) (int, error) {
}
klog.V(5).InfoS("nvidia-smi topo -m row output", "row output", words, "length", len(words))
if strings.Contains(words[0], fmt.Sprint(idx)) {
if words[numaAffinityColumnIndex] == "N/A" {
if len(words) <= numaAffinityColumnIndex || words[numaAffinityColumnIndex] == "N/A" {
klog.InfoS("current card has not established numa topology", "gpu row info", words, "index", idx)
return 0, nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ func Test_parseNvidiaNumaInfo(t *testing.T) {
want: 0,
wantErr: false,
},
{
name: "NUMA Affinity is empty",
idx: 0,
nvidiaTopoStr: `GPU0 CPU Affinity NUMA Affinity GPU NUMA ID
GPU0 X`,
want: 0,
wantErr: false,
},
}

for _, tt := range tests {
Expand Down