Fix windows system memory lookup

This refines the gpu package error handling and fixes a bug with the
system memory lookup on windows.
This commit is contained in:
Daniel Hiltgen
2023-12-22 15:43:31 -08:00
parent 5fea4410be
commit a2ad952440
8 changed files with 68 additions and 20 deletions

View File

@@ -1,10 +1,14 @@
package gpu
type memInfo struct {
TotalMemory uint64 `json:"total_memory,omitempty"`
FreeMemory uint64 `json:"free_memory,omitempty"`
}
// Beginning of an `ollama info` command
type GpuInfo struct {
Library string `json:"library,omitempty"`
TotalMemory uint64 `json:"total_memory,omitempty"`
FreeMemory uint64 `json:"free_memory,omitempty"`
memInfo
Library string `json:"library,omitempty"`
// TODO add other useful attributes about the card here for discovery information
}