Return unknown GPU if device info is nil

This commit is contained in:
2026-02-16 14:12:19 +02:00
parent 8cafe93b33
commit 8dfe7b3a0e
+16
View File
@@ -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"