Skip to content

Commit

Permalink
VRAMAvailablePercentage added (#10)
Browse files Browse the repository at this point in the history
* vram available added

* type cange to int64

* Dup fix
  • Loading branch information
chetan-spheron authored Nov 11, 2024
1 parent 202908e commit bd4d859
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 50 deletions.
1 change: 1 addition & 0 deletions docs/proto/provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@
| `modelid` | [string](#string) | | |
| `interface` | [string](#string) | | |
| `memory_size` | [string](#string) | | |
| `vram_available_percentage` | [int64](#int64) | | |



Expand Down
24 changes: 13 additions & 11 deletions go/inventory/v1/gpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ func (r *GPU) Dup() GPU {

func (s *GPUInfo) Dup() GPUInfo {
res := GPUInfo{
Vendor: s.Vendor,
VendorID: s.VendorID,
Name: s.Name,
ModelID: s.ModelID,
Interface: s.Interface,
MemorySize: s.MemorySize,
Vendor: s.Vendor,
VendorID: s.VendorID,
Name: s.Name,
ModelID: s.ModelID,
Interface: s.Interface,
MemorySize: s.MemorySize,
VRAMAvailablePercentage: s.VRAMAvailablePercentage,
}

return res
Expand All @@ -45,11 +46,12 @@ func (s GPUInfoS) Dup() GPUInfoS {

for _, n := range s {
res = append(res, GPUInfo{
Vendor: n.Vendor,
Name: n.Name,
ModelID: n.ModelID,
Interface: n.Interface,
MemorySize: n.MemorySize,
Vendor: n.Vendor,
Name: n.Name,
ModelID: n.ModelID,
Interface: n.Interface,
MemorySize: n.MemorySize,
VRAMAvailablePercentage: n.VRAMAvailablePercentage,
})
}

Expand Down
117 changes: 78 additions & 39 deletions go/inventory/v1/gpu.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions proto/provider/akash/inventory/v1/gpu.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ message GPUInfo {
(gogoproto.jsontag) = "memory_size",
(gogoproto.moretags) = "yaml:\"memory_size\""
];
int64 vram_available_percentage = 7 [
(gogoproto.customname) = "VRAMAvailablePercentage",
(gogoproto.jsontag) = "vram_available_percentage",
(gogoproto.moretags) = "yaml:\"vram_available_percentage\""
];
}

// GPUInfo reports GPU inventory details
Expand Down

0 comments on commit bd4d859

Please sign in to comment.