(opts ...SystemStateOptions)
| 77 | } |
| 78 | |
| 79 | func GetSystemState(opts ...SystemStateOptions) (*SystemState, error) { |
| 80 | state := &SystemState{} |
| 81 | for _, opt := range opts { |
| 82 | opt(state) |
| 83 | } |
| 84 | |
| 85 | // Detection is best-effort here, we don't want to fail if it fails |
| 86 | state.GPUVendor, _ = xsysinfo.DetectGPUVendor() |
| 87 | xlog.Debug("GPU vendor", "gpuVendor", state.GPUVendor) |
| 88 | state.VRAM, _ = xsysinfo.TotalAvailableVRAM() |
| 89 | xlog.Debug("Total available VRAM", "vram", state.VRAM) |
| 90 | |
| 91 | state.getSystemCapabilities() |
| 92 | |
| 93 | return state, nil |
| 94 | } |