Skip to content

Commit 3773bc3

Browse files
authored
Merge pull request #408 from jaypipes/issue407
fix PCI address in filepath for graphics cards
2 parents 8018747 + b36d6a3 commit 3773bc3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: pkg/gpu/gpu_linux.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,11 @@ func (i *Info) load() error {
9090
continue
9191
}
9292
pathParts := strings.Split(dest, "/")
93+
// The PCI address of the graphics card is the *last* PCI address in
94+
// the filepath...
9395
pciAddress := ""
94-
for _, part := range pathParts {
96+
for x := len(pathParts) - 1; x >= 0; x-- {
97+
part := pathParts[x]
9598
if reValidPCIAddress.MatchString(part) {
9699
pciAddress = part
97100
break

0 commit comments

Comments
 (0)