gpu.proto 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. syntax = "proto3";
  2. import "kubemodel/diagnostic.proto";
  3. package kubemodel;
  4. option go_package = "github.com/opencost/opencost/core/pkg/model/pb/kubemodel";
  5. // GPUDevice represents a GPU device with DCGM integration (provisioned resource)
  6. // This tracks available GPU capacity on a node
  7. message GPUDevice {
  8. // Identification
  9. string ID = 1; // GPU UUID (hardware identifier)
  10. string nodeID = 2; // Node hosting this GPU device
  11. // Properties
  12. int32 deviceNumber = 3;
  13. string modelName = 4;
  14. // GPU sharing information
  15. bool isShared = 6;
  16. float sharePercentage = 9;
  17. // Capacity metrics
  18. // GPU hours available
  19. float gpuHours = 10;
  20. // GPU request average percentage (0-100)
  21. float gpuRequestAverage = 11;
  22. // GPU usage average percentage (0-100)
  23. float gpuUsageAverage = 12;
  24. // GPU usage max percentage (0-100)
  25. float gpuUsageMax = 13;
  26. // GPU memory capacity in bytes
  27. int64 memoryBytes = 14;
  28. // Diagnostic information about this resource
  29. optional DiagnosticResult diagnostic = 99;
  30. }
  31. // GPUUsage represents GPU resources consumed by a container (allocated resource)
  32. // This tracks actual GPU usage by containers for cost analysis
  33. message GPUUsage {
  34. // Identification
  35. string containerID = 1; // Container consuming GPU resources
  36. string gpuDeviceID = 2; // Reference to the GPU device being used
  37. // Usage metrics
  38. // GPU usage in device-hours consumed
  39. float gpuHours = 3;
  40. // GPU request in percentage (0-100)
  41. float gpuRequestPercentage = 4;
  42. // GPU usage average percentage (0-100)
  43. float gpuUsageAverage = 5;
  44. // GPU usage max percentage (0-100)
  45. float gpuUsageMax = 6;
  46. // GPU memory usage in bytes
  47. int64 memoryBytesUsed = 7;
  48. // Diagnostic information about this resource
  49. optional DiagnosticResult diagnostic = 99;
  50. }