feat: use a metadata file
Some checks failed
Security Scan / tests (push) Has been cancelled

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2025-06-20 22:18:48 +02:00
parent 9a34fc8c66
commit ec137888ba
7 changed files with 164 additions and 55 deletions

View file

@ -25,15 +25,22 @@ func detectGPUVendor() (string, error) {
}
for _, gpu := range gpus {
if strings.ToUpper(gpu.DeviceInfo.Vendor.Name) == "NVIDIA" {
return "nvidia", nil
}
if strings.ToUpper(gpu.DeviceInfo.Vendor.Name) == "AMD" {
return "amd", nil
}
if strings.ToUpper(gpu.DeviceInfo.Vendor.Name) == "INTEL" {
return "intel", nil
if gpu.DeviceInfo != nil {
if gpu.DeviceInfo.Vendor != nil {
gpuVendorName := strings.ToUpper(gpu.DeviceInfo.Vendor.Name)
if gpuVendorName == "NVIDIA" {
return "nvidia", nil
}
if gpuVendorName == "AMD" {
return "amd", nil
}
if gpuVendorName == "INTEL" {
return "intel", nil
}
return "nvidia", nil
}
}
}
return "", nil