mirror of
https://github.com/EnumeratedDev/stormfetch.git
synced 2026-09-15 23:46:12 +00:00
Fallback to product name if subsystem can't be detected
This commit is contained in:
+7
-1
@@ -101,11 +101,17 @@ func GetGPUModels(hiddenGPUs []int) []GPU {
|
|||||||
vendor = gpu.DeviceInfo.Vendor.Name
|
vendor = gpu.DeviceInfo.Vendor.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fallback subsystem name to product name
|
||||||
|
subsystem := gpu.DeviceInfo.Subsystem.Name
|
||||||
|
if subsystem == "" || subsystem == "unknown" {
|
||||||
|
subsystem = gpu.DeviceInfo.Product.Name
|
||||||
|
}
|
||||||
|
|
||||||
ret = append(ret, GPU{
|
ret = append(ret, GPU{
|
||||||
PCIAddress: gpu.Address,
|
PCIAddress: gpu.Address,
|
||||||
Vendor: vendor,
|
Vendor: vendor,
|
||||||
Product: gpu.DeviceInfo.Product.Name,
|
Product: gpu.DeviceInfo.Product.Name,
|
||||||
Subsystem: gpu.DeviceInfo.Subsystem.Name,
|
Subsystem: subsystem,
|
||||||
Driver: gpu.DeviceInfo.Driver,
|
Driver: gpu.DeviceInfo.Driver,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user