From 100014022ce9a1266b7d49074aca57cc07dd3c89 Mon Sep 17 00:00:00 2001 From: chetan-spheron Date: Fri, 8 Nov 2024 17:31:13 +0530 Subject: [PATCH 1/3] vram available added --- docs/proto/provider.md | 1 + go/inventory/v1/gpu.pb.go | 133 ++++++++++++++------ proto/provider/akash/inventory/v1/gpu.proto | 5 + 3 files changed, 100 insertions(+), 39 deletions(-) diff --git a/docs/proto/provider.md b/docs/proto/provider.md index 229cef42..ca542c10 100644 --- a/docs/proto/provider.md +++ b/docs/proto/provider.md @@ -965,6 +965,7 @@ | `modelid` | [string](#string) | | | | `interface` | [string](#string) | | | | `memory_size` | [string](#string) | | | + | `vram_available_percentage` | [string](#string) | | | diff --git a/go/inventory/v1/gpu.pb.go b/go/inventory/v1/gpu.pb.go index aafd8b58..0980d970 100644 --- a/go/inventory/v1/gpu.pb.go +++ b/go/inventory/v1/gpu.pb.go @@ -25,12 +25,13 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GPUInfo reports GPU details type GPUInfo struct { - Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor" yaml:"vendor"` - VendorID string `protobuf:"bytes,2,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id" yaml:"vendor_id"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name" yaml:"name"` - ModelID string `protobuf:"bytes,4,opt,name=modelid,proto3" json:"model_id" yaml:"model_id"` - Interface string `protobuf:"bytes,5,opt,name=interface,proto3" json:"interface" yaml:"interface"` - MemorySize string `protobuf:"bytes,6,opt,name=memory_size,json=memorySize,proto3" json:"memory_size" yaml:"memory_size"` + Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor" yaml:"vendor"` + VendorID string `protobuf:"bytes,2,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id" yaml:"vendor_id"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name" yaml:"name"` + ModelID string `protobuf:"bytes,4,opt,name=modelid,proto3" json:"model_id" yaml:"model_id"` + Interface string `protobuf:"bytes,5,opt,name=interface,proto3" json:"interface" yaml:"interface"` + MemorySize string `protobuf:"bytes,6,opt,name=memory_size,json=memorySize,proto3" json:"memory_size" yaml:"memory_size"` + VRAMAvailablePercentage string `protobuf:"bytes,7,opt,name=vram_available_percentage,json=vramAvailablePercentage,proto3" json:"vram_available_percentage" yaml:"vram_available_percentage"` } func (m *GPUInfo) Reset() { *m = GPUInfo{} } @@ -108,6 +109,13 @@ func (m *GPUInfo) GetMemorySize() string { return "" } +func (m *GPUInfo) GetVRAMAvailablePercentage() string { + if m != nil { + return m.VRAMAvailablePercentage + } + return "" +} + // GPUInfo reports GPU inventory details type GPU struct { Quantity ResourcePair `protobuf:"bytes,1,opt,name=quantity,proto3" json:"quantity" yaml:"quantity"` @@ -169,39 +177,43 @@ func init() { func init() { proto.RegisterFile("akash/inventory/v1/gpu.proto", fileDescriptor_2cc01b12bd00ffcc) } var fileDescriptor_2cc01b12bd00ffcc = []byte{ - // 511 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xcf, 0x6e, 0xd3, 0x30, - 0x18, 0x6f, 0xd6, 0xd2, 0xb5, 0xae, 0x10, 0xc8, 0xe2, 0x10, 0x0d, 0x14, 0x57, 0x96, 0x26, 0x4d, - 0x48, 0x4d, 0xb4, 0x95, 0x13, 0x12, 0x97, 0x6a, 0x62, 0x2a, 0x62, 0x53, 0xc9, 0x18, 0x07, 0x2e, - 0xc5, 0x6b, 0xdc, 0xd4, 0xda, 0x62, 0x07, 0x37, 0xad, 0xd4, 0x3d, 0x05, 0xcf, 0xc1, 0x95, 0x97, - 0xd8, 0x71, 0x27, 0xc4, 0xc9, 0xa0, 0xf4, 0xd6, 0x63, 0x9f, 0x00, 0xd9, 0xf9, 0x37, 0xc4, 0x6e, - 0xfe, 0x7e, 0xff, 0x3e, 0xdb, 0xdf, 0x07, 0x5e, 0x90, 0x2b, 0x32, 0x9f, 0x79, 0x8c, 0x2f, 0x29, - 0x4f, 0x84, 0x5c, 0x79, 0xcb, 0x43, 0x2f, 0x8c, 0x17, 0x6e, 0x2c, 0x45, 0x22, 0x20, 0x34, 0xac, - 0x5b, 0xb2, 0xee, 0xf2, 0x70, 0xef, 0x59, 0x28, 0x42, 0x61, 0x68, 0x4f, 0x9f, 0x32, 0xe5, 0xde, - 0xfe, 0x03, 0x39, 0x92, 0xce, 0xc5, 0x42, 0x4e, 0x68, 0x4c, 0x98, 0xcc, 0x64, 0xf8, 0x47, 0x1d, - 0xec, 0x9e, 0x8c, 0x2e, 0x86, 0x7c, 0x2a, 0xe0, 0x1b, 0xd0, 0x5c, 0x52, 0x1e, 0x08, 0x69, 0x5b, - 0x5d, 0xeb, 0xa0, 0x3d, 0xd8, 0x4f, 0x15, 0x6a, 0x7e, 0x32, 0xc8, 0x46, 0xa1, 0x9c, 0xdb, 0x2a, - 0xf4, 0x78, 0x45, 0xa2, 0xeb, 0xd7, 0x38, 0xab, 0xb1, 0x9f, 0x13, 0xf0, 0x1d, 0x68, 0x67, 0xa7, - 0x31, 0x0b, 0xec, 0x1d, 0x93, 0xd0, 0x4b, 0x15, 0x6a, 0x65, 0x09, 0xc3, 0xe3, 0x8d, 0x42, 0x95, - 0x60, 0xab, 0xd0, 0xd3, 0xfb, 0x31, 0x63, 0x16, 0x60, 0xbf, 0x95, 0x9d, 0x87, 0x01, 0xec, 0x83, - 0x06, 0x27, 0x11, 0xb5, 0xeb, 0x26, 0x06, 0xa5, 0x0a, 0x35, 0xce, 0x48, 0x44, 0x37, 0x0a, 0x19, - 0x7c, 0xab, 0x50, 0x27, 0x73, 0xeb, 0x0a, 0xfb, 0x06, 0x84, 0xc7, 0x60, 0x37, 0x12, 0x01, 0xbd, - 0x66, 0x81, 0xdd, 0x30, 0xbe, 0x97, 0xa9, 0x42, 0xbb, 0xa7, 0x1a, 0x32, 0xdd, 0x5b, 0x86, 0xc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da, 0xa9, 0xfd, 0x5a, 0x3b, 0xb5, 0xcf, 0xaf, 0x42, 0x96, 0xcc, - 0x16, 0x97, 0xee, 0x44, 0x44, 0xde, 0x3c, 0x9e, 0x51, 0x29, 0xf8, 0xdb, 0x80, 0x7b, 0xe6, 0x0a, - 0x3d, 0x12, 0xb3, 0xde, 0x54, 0xc8, 0x2b, 0x2f, 0x14, 0xff, 0x6c, 0xfc, 0x65, 0xd3, 0x6c, 0x79, - 0xff, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb0, 0x51, 0x58, 0xf7, 0x56, 0x03, 0x00, 0x00, + // 571 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcd, 0x6a, 0x13, 0x41, + 0x1c, 0xcf, 0xb6, 0x31, 0x1f, 0x13, 0x44, 0x19, 0x84, 0xae, 0x55, 0x76, 0xc2, 0x40, 0xa1, 0x08, + 0xdd, 0xa5, 0xad, 0x27, 0xc1, 0x43, 0x4b, 0xb1, 0x44, 0x6c, 0x89, 0x5b, 0xdb, 0x83, 0x08, 0x71, + 0x9a, 0x9d, 0x6c, 0x87, 0x66, 0x77, 0xd6, 0xc9, 0x66, 0x21, 0x7d, 0x0a, 0x8f, 0x3e, 0x83, 0x4f, + 0xd2, 0x93, 0xf4, 0x24, 0x9e, 0x46, 0xd9, 0xde, 0x72, 0xcc, 0x13, 0xc8, 0xcc, 0x7e, 0x55, 0x4c, + 0x6f, 0xf3, 0xff, 0x7d, 0xfd, 0x77, 0x99, 0xdf, 0x80, 0xe7, 0xe4, 0x92, 0x4c, 0x2e, 0x1c, 0x16, + 0x26, 0x34, 0x8c, 0xb9, 0x98, 0x39, 0xc9, 0xb6, 0xe3, 0x47, 0x53, 0x3b, 0x12, 0x3c, 0xe6, 0x10, + 0x6a, 0xd6, 0x2e, 0x59, 0x3b, 0xd9, 0x5e, 0x7f, 0xe2, 0x73, 0x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, 0xe5, 0xfa, 0x13, 0x57, 0x0b, 0xf6, + 0x8f, 0xaf, 0x53, 0xcb, 0xb8, 0x49, 0x2d, 0xe3, 0x4f, 0x6a, 0x19, 0x5f, 0x6f, 0xad, 0xda, 0xcd, + 0xad, 0x55, 0xfb, 0x75, 0x6b, 0xd5, 0x3e, 0xbe, 0xf4, 0x59, 0x7c, 0x31, 0x3d, 0xb7, 0x87, 0x3c, + 0x70, 0x26, 0xd1, 0x05, 0x15, 0x3c, 0x7c, 0xe3, 0x85, 0x8e, 0xfe, 0x84, 0x2d, 0x12, 0xb1, 0xad, + 0x11, 0x17, 0x97, 0x8e, 0xcf, 0xff, 0x79, 0x8c, 0xe7, 0x0d, 0xfd, 0x00, 0x77, 0xff, 0x06, 0x00, + 0x00, 0xff, 0xff, 0xa3, 0x0b, 0xa6, 0x90, 0xf1, 0x03, 0x00, 0x00, } func (m *GPUInfo) Marshal() (dAtA []byte, err error) { @@ -224,6 +236,13 @@ func (m *GPUInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.VRAMAvailablePercentage) > 0 { + i -= len(m.VRAMAvailablePercentage) + copy(dAtA[i:], m.VRAMAvailablePercentage) + i = encodeVarintGpu(dAtA, i, uint64(len(m.VRAMAvailablePercentage))) + i-- + dAtA[i] = 0x3a + } if len(m.MemorySize) > 0 { i -= len(m.MemorySize) copy(dAtA[i:], m.MemorySize) @@ -357,6 +376,10 @@ func (m *GPUInfo) Size() (n int) { if l > 0 { n += 1 + l + sovGpu(uint64(l)) } + l = len(m.VRAMAvailablePercentage) + if l > 0 { + n += 1 + l + sovGpu(uint64(l)) + } return n } @@ -604,6 +627,38 @@ func (m *GPUInfo) Unmarshal(dAtA []byte) error { } m.MemorySize = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VRAMAvailablePercentage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGpu + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGpu + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VRAMAvailablePercentage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGpu(dAtA[iNdEx:]) diff --git a/proto/provider/akash/inventory/v1/gpu.proto b/proto/provider/akash/inventory/v1/gpu.proto index cf6f1b1f..d32e3007 100644 --- a/proto/provider/akash/inventory/v1/gpu.proto +++ b/proto/provider/akash/inventory/v1/gpu.proto @@ -41,6 +41,11 @@ message GPUInfo { (gogoproto.jsontag) = "memory_size", (gogoproto.moretags) = "yaml:\"memory_size\"" ]; + string vram_available_percentage = 7 [ + (gogoproto.customname) = "VRAMAvailablePercentage", + (gogoproto.jsontag) = "vram_available_percentage", + (gogoproto.moretags) = "yaml:\"vram_available_percentage\"" + ]; } // GPUInfo reports GPU inventory details From 5a03e73e6878db467bc835225aedd929299065c7 Mon Sep 17 00:00:00 2001 From: chetan-spheron Date: Fri, 8 Nov 2024 17:34:37 +0530 Subject: [PATCH 2/3] type cange to int64 --- docs/proto/provider.md | 2 +- go/inventory/v1/gpu.pb.go | 110 +++++++++----------- proto/provider/akash/inventory/v1/gpu.proto | 2 +- 3 files changed, 49 insertions(+), 65 deletions(-) diff --git a/docs/proto/provider.md b/docs/proto/provider.md index ca542c10..a09694e7 100644 --- a/docs/proto/provider.md +++ b/docs/proto/provider.md @@ -965,7 +965,7 @@ | `modelid` | [string](#string) | | | | `interface` | [string](#string) | | | | `memory_size` | [string](#string) | | | - | `vram_available_percentage` | [string](#string) | | | + | `vram_available_percentage` | [int64](#int64) | | | diff --git a/go/inventory/v1/gpu.pb.go b/go/inventory/v1/gpu.pb.go index 0980d970..3031b2c0 100644 --- a/go/inventory/v1/gpu.pb.go +++ b/go/inventory/v1/gpu.pb.go @@ -31,7 +31,7 @@ type GPUInfo struct { ModelID string `protobuf:"bytes,4,opt,name=modelid,proto3" json:"model_id" yaml:"model_id"` Interface string `protobuf:"bytes,5,opt,name=interface,proto3" json:"interface" yaml:"interface"` MemorySize string `protobuf:"bytes,6,opt,name=memory_size,json=memorySize,proto3" json:"memory_size" yaml:"memory_size"` - VRAMAvailablePercentage string `protobuf:"bytes,7,opt,name=vram_available_percentage,json=vramAvailablePercentage,proto3" json:"vram_available_percentage" yaml:"vram_available_percentage"` + VRAMAvailablePercentage int64 `protobuf:"varint,7,opt,name=vram_available_percentage,json=vramAvailablePercentage,proto3" json:"vram_available_percentage" yaml:"vram_available_percentage"` } func (m *GPUInfo) Reset() { *m = GPUInfo{} } @@ -109,11 +109,11 @@ func (m *GPUInfo) GetMemorySize() string { return "" } -func (m *GPUInfo) GetVRAMAvailablePercentage() string { +func (m *GPUInfo) GetVRAMAvailablePercentage() int64 { if m != nil { return m.VRAMAvailablePercentage } - return "" + return 0 } // GPUInfo reports GPU inventory details @@ -177,43 +177,43 @@ func init() { func init() { proto.RegisterFile("akash/inventory/v1/gpu.proto", fileDescriptor_2cc01b12bd00ffcc) } var fileDescriptor_2cc01b12bd00ffcc = []byte{ - // 571 bytes of a gzipped FileDescriptorProto + // 574 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcd, 0x6a, 0x13, 0x41, - 0x1c, 0xcf, 0xb6, 0x31, 0x1f, 0x13, 0x44, 0x19, 0x84, 0xae, 0x55, 0x76, 0xc2, 0x40, 0xa1, 0x08, - 0xdd, 0xa5, 0xad, 0x27, 0xc1, 0x43, 0x4b, 0xb1, 0x44, 0x6c, 0x89, 0x5b, 0xdb, 0x83, 0x08, 0x71, - 0x9a,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0x3a, 0x06, 0xa5, 0x12, 0xd5, 0x8f, 0x49, 0x40, 0xe7, - 0x12, 0x69, 0x7c, 0x21, 0x51, 0x27, 0x73, 0xab, 0x09, 0xbb, 0x1a, 0x84, 0x07, 0xa0, 0x19, 0x70, - 0x8f, 0x8e, 0x99, 0x67, 0xd6, 0xb5, 0xef, 0x45, 0x2a, 0x51, 0xf3, 0x48, 0x41, 0x7a, 0x7b, 0x4b, - 0xb3, 0xd9, 0xf2, 0x47, 0x99, 0xbd, 0x40, 0xb0, 0x5b, 0x58, 0xe1, 0x3b, 0xd0, 0x66, 0x61, 0x4c, - 0xc5, 0x88, 0x0c, 0xa9, 0xf9, 0x40, 0xe7, 0xd8, 0xa9, 0x44, 0xed, 0x5e, 0x01, 0xaa, 0xff, 0x28, - 0x15, 0xd5, 0x7f, 0x94, 0x10, 0x76, 0x2b, 0x1a, 0x7e, 0x00, 0x9d, 0x80, 0x06, 0x5c, 0xcc, 0x06, - 0x13, 0x76, 0x45, 0xcd, 0x86, 0xce, 0xdb, 0x4d, 0x25, 0x02, 0x47, 0x1a, 0x3e, 0x61, 0x57, 0x2a, - 0xf0, 0xae, 0x68, 0x21, 0x11, 0xcc, 0xbf, 0xae, 0x02, 0xb1, 0x0b, 0x82, 0xd2, 0x00, 0xbf, 0x19, - 0xe0, 0x69, 0x22, 0x48, 0x30, 0x20, 0x09, 0x61, 0x63, 0x72, 0x3e, 0xa6, 0x83, 0x88, 0x8a, 0x21, - 0x0d, 0x63, 0xe2, 0x53, 0xb3, 0xa9, 0x97, 0x7c, 0x4a, 0x25, 0x5a, 0x3b, 0x73, 0xf7, 0x8e, 0xf6, - 0x0a, 0x4d, 0xbf, 0x94, 0xcc, 0x25, 0xba, 0xdf, 0xbf, 0x90, 0xa8, 0x9b, 0x5f, 0xcd, 0x7d, 0x12, - 0xec, 0xae, 0x29, 0x6e, 0x49, 0x32, 0xfe, 0x69, 0x80, 0xd5, 0xc3, 0xfe, 0x29, 0x0c, 0x40, 0xe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05, 0xc4, 0xa7, 0x66, 0x55, 0xc7, 0xa0, 0x44, 0xa2, 0xda, 0x31, 0xf1, 0xe9, 0x42, + 0x22, 0x8d, 0x2f, 0x25, 0x6a, 0xa7, 0x6e, 0x35, 0x61, 0x47, 0x83, 0xf0, 0x00, 0x34, 0x7c, 0xee, + 0xd2, 0x09, 0x73, 0xcd, 0x9a, 0xf6, 0xbd, 0x48, 0x24, 0x6a, 0x1c, 0x29, 0x48, 0x6f, 0x6f, 0x6a, + 0x36, 0x5d, 0xfe, 0x28, 0xb5, 0xe7, 0x08, 0x76, 0x72, 0x2b, 0x7c, 0x07, 0x5a, 0x2c, 0x88, 0xa8, + 0x18, 0x93, 0x11, 0x35, 0x1f, 0xe8, 0x1c, 0x2b, 0x91, 0xa8, 0xd5, 0xcf, 0x41, 0xf5, 0x1f, 0x85, + 0xa2, 0xfc, 0x8f, 0x02, 0xc2, 0x4e, 0x49, 0xc3, 0x0f, 0xa0, 0xed, 0x53, 0x9f, 0x8b, 0xf9, 0x70, + 0xca, 0xae, 0xa8, 0x59, 0xd7, 0x79, 0x7b, 0x89, 0x44, 0xe0, 0x48, 0xc3, 0x27, 0xec, 0x4a, 0x05, + 0xde, 0x15, 0x2d, 0x25, 0x82, 0xd9, 0xd7, 0x95, 0x20, 0x76, 0x80, 0x5f, 0x18, 0xe0, 0x37, 0x03, + 0x3c, 0x8d, 0x05, 0xf1, 0x87, 0x24, 0x26, 0x6c, 0x42, 0xce, 0x27, 0x74, 0x18, 0x52, 0x31, 0xa2, + 0x41, 0x44, 0x3c, 0x6a, 0x36, 0xba, 0xc6, 0x56, 0xb5, 0xf7, 0x29, 0x91, 0x68, 0xfd, 0xcc, 0xd9, + 0x3f, 0xda, 0xcf, 0x35, 0x83, 0x42, 0xb2, 0x90, 0xe8, 0x7e, 0xff, 0x52, 0xa2, 0x6e, 0x76, 0x35, + 0xf7, 0x49, 0xb0, 0xb3, 0xae, 0xb8, 0x15, 0xc9, 0xf8, 0xa7, 0x01, 0xaa, 0x87, 0x83, 0x53, 0xe8, + 0x83, 0xe6, 0x97, 0x19, 0x09, 0x22, 0x16, 0xcd, 0x75, 0x9d, 0xda, 0xbb, 0x5d, 0xeb, 0xff, 0xf2, + 0x5a, 0x4e, 0x56, 0xc9, 0x01, 0x61, 0xa2, 0x67, 0x5f, 0x4b, 0x54, 0x51, 0x95, 0x79, 0x9f, 0x39, + 0xd5, 0xa5, 0xe5, 0x29, 0xe5, 0xa5, 0xe5, 0x08, 0x76, 0x0a, 0x12, 0x7e, 0x06, 0x35, 0x16, 0x8c, + 0xb9, 0xb9, 0xd6, 0xad, 0x6e, 0xb5, 0x77, 0x9f, 0xad, 0x5a, 0x95, 0xd5, 0xbc, 0xd8, 0x52, 0x53, + 0x93, 0x6a, 0x94, 0x32, 0x96, 0x8d, 0x52, 0x13, 0xfe, 0xfe, 0x1b, 0x35, 0x33, 0xfd, 0x89, 0xa3, + 0x05, 0xbd, 0xe3, 0xeb, 0xa4, 0x63, 0xdc, 0x24, 0x1d, 0xe3, 0x4f, 0xd2, 0x31, 0xbe, 0xde, 0x76, + 0x2a, 0x37, 0xb7, 0x9d, 0xca, 0xaf, 0xdb, 0x4e, 0xe5, 0xe3, 0x4b, 0x8f, 0x45, 0x17, 0xb3, 0x73, + 0x6b, 0xc4, 0x7d, 0x7b, 0x1a, 0x5e, 0x50, 0xc1, 0x83, 0x37, 0x6e, 0x60, 0xeb, 0x4f, 0xd8, 0x26, + 0x21, 0xdb, 0x1e, 0x73, 0x71, 0x69, 0x7b, 0xfc, 0x9f, 0xc7, 0x78, 0x5e, 0xd7, 0x0f, 0x70, 0xef, + 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x99, 0xfb, 0x49, 0xf1, 0x03, 0x00, 0x00, } func (m *GPUInfo) Marshal() (dAtA []byte, err error) { @@ -236,12 +236,10 @@ func (m *GPUInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.VRAMAvailablePercentage) > 0 { - i -= len(m.VRAMAvailablePercentage) - copy(dAtA[i:], m.VRAMAvailablePercentage) - i = encodeVarintGpu(dAtA, i, uint64(len(m.VRAMAvailablePercentage))) + if m.VRAMAvailablePercentage != 0 { + i = encodeVarintGpu(dAtA, i, uint64(m.VRAMAvailablePercentage)) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x38 } if len(m.MemorySize) > 0 { i -= len(m.MemorySize) @@ -376,9 +374,8 @@ func (m *GPUInfo) Size() (n int) { if l > 0 { n += 1 + l + sovGpu(uint64(l)) } - l = len(m.VRAMAvailablePercentage) - if l > 0 { - n += 1 + l + sovGpu(uint64(l)) + if m.VRAMAvailablePercentage != 0 { + n += 1 + sovGpu(uint64(m.VRAMAvailablePercentage)) } return n } @@ -628,10 +625,10 @@ func (m *GPUInfo) Unmarshal(dAtA []byte) error { m.MemorySize = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field VRAMAvailablePercentage", wireType) } - var stringLen uint64 + m.VRAMAvailablePercentage = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGpu @@ -641,24 +638,11 @@ func (m *GPUInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.VRAMAvailablePercentage |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGpu - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGpu - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VRAMAvailablePercentage = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGpu(dAtA[iNdEx:]) diff --git a/proto/provider/akash/inventory/v1/gpu.proto b/proto/provider/akash/inventory/v1/gpu.proto index d32e3007..68ae9bf9 100644 --- a/proto/provider/akash/inventory/v1/gpu.proto +++ b/proto/provider/akash/inventory/v1/gpu.proto @@ -41,7 +41,7 @@ message GPUInfo { (gogoproto.jsontag) = "memory_size", (gogoproto.moretags) = "yaml:\"memory_size\"" ]; - string vram_available_percentage = 7 [ + int64 vram_available_percentage = 7 [ (gogoproto.customname) = "VRAMAvailablePercentage", (gogoproto.jsontag) = "vram_available_percentage", (gogoproto.moretags) = "yaml:\"vram_available_percentage\"" From d5078b48f6635d8fd04fb13dc5430a8398a177c5 Mon Sep 17 00:00:00 2001 From: chetan-spheron Date: Mon, 11 Nov 2024 13:08:23 +0530 Subject: [PATCH 3/3] Dup fix --- go/inventory/v1/gpu.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/go/inventory/v1/gpu.go b/go/inventory/v1/gpu.go index 01038c24..213ae3f3 100644 --- a/go/inventory/v1/gpu.go +++ b/go/inventory/v1/gpu.go @@ -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 @@ -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, }) }