mirror of
https://github.com/clearml/go-nvlib
synced 2025-03-04 02:57:44 +00:00
Merge branch 'fix-pci-id-case' into 'main'
Ensure pci bus ID is lower case See merge request nvidia/cloud-native/go-nvlib!25
This commit is contained in:
commit
0e10f084d1
@ -224,7 +224,7 @@ func (d *device) getClass() (Class, error) {
|
||||
}
|
||||
bytes = append(bytes, byte(b))
|
||||
}
|
||||
id := string(bytes)
|
||||
id := strings.ToLower(string(bytes))
|
||||
|
||||
if id != "0000" {
|
||||
id = strings.TrimPrefix(id, "0000")
|
||||
@ -232,7 +232,7 @@ func (d *device) getClass() (Class, error) {
|
||||
|
||||
device, err := nvpci.New().GetGPUByPciBusID(id)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("failed to construct PCI device: %v", ret)
|
||||
return 0, fmt.Errorf("failed to construct PCI device: %v", err)
|
||||
}
|
||||
|
||||
return Class(device.Class), nil
|
||||
|
Loading…
Reference in New Issue
Block a user