mirror of
https://github.com/EnumeratedDev/stormfetch.git
synced 2026-09-15 23:46:12 +00:00
Return unknown GPU if device info is nil
This commit is contained in:
@@ -92,8 +92,24 @@ func GetGPUModels(hiddenGPUs []int) []GPU {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if device info is set
|
||||||
|
if gpu.DeviceInfo == nil {
|
||||||
|
ret = append(ret, GPU{
|
||||||
|
PCIAddress: gpu.Address,
|
||||||
|
Vendor: "Unknown",
|
||||||
|
Name: "GPU",
|
||||||
|
Product: "Unknown",
|
||||||
|
Subsystem: "Unknown",
|
||||||
|
Driver: "Unknown",
|
||||||
|
VramTotal: "Unknown",
|
||||||
|
VramUsed: "Unknown",
|
||||||
|
})
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// Set alternative names for vendors
|
// Set alternative names for vendors
|
||||||
var vendor string
|
var vendor string
|
||||||
|
|
||||||
switch gpu.DeviceInfo.Vendor.ID {
|
switch gpu.DeviceInfo.Vendor.ID {
|
||||||
case "1002":
|
case "1002":
|
||||||
vendor = "AMD"
|
vendor = "AMD"
|
||||||
|
|||||||
Reference in New Issue
Block a user