Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sw/nic/gpuagent/api/include/aga_gpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ typedef struct aga_gpu_vram_status_s {
char vendor[AGA_MAX_STR_LEN + 1];
/// VRAM size (in MB)
uint64_t size;
/// VRAM max bandwidth at max memory clock (GB/s)
uint64_t max_bandwidth;
} aga_gpu_vram_status_t;

/// \brief GPU page status
Expand Down
1 change: 1 addition & 0 deletions sw/nic/gpuagent/api/smi/amdsmi/smi_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ smi_gpu_fill_status (aga_gpu_handle_t gpu_handle, uint32_t gpu_id,
}
status->xgmi_status.width = metrics_info.xgmi_link_width;
status->xgmi_status.speed = metrics_info.xgmi_link_speed;
status->vram_status.max_bandwidth = metrics_info.vram_max_bandwidth;
} else {
AGA_TRACE_ERR("Failed to get GPU metrics info for GPU {}, err {}",
gpu_handle, amdsmi_ret);
Expand Down
2 changes: 2 additions & 0 deletions sw/nic/gpuagent/api/smi/smi_api_mock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ smi_gpu_fill_status (aga_gpu_handle_t gpu_handle, uint32_t gpu_id,
status->vram_status.type = AGA_VRAM_TYPE_HBM;
strcpy(status->vram_status.vendor, "hynix");
status->vram_status.size = 196592;
// fill VRAM max bandwidth mock value
status->vram_status.max_bandwidth = 3276800;
// fill the xgmi error count
status->xgmi_status.error_status = AGA_GPU_XGMI_STATUS_NO_ERROR;
// fill total memory
Expand Down
5 changes: 5 additions & 0 deletions sw/nic/gpuagent/cli/cmd/gpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,11 @@ func printGPUStatus(gpu *aga.GPU, statusOnly bool) {
fmt.Printf(indent+" %-36s : %v\n", "VRAM size (in MB)",
vram.GetSize_())
}
if vram.GetMaxBandwidth() != 0 {
printVRAMStatusHdr(indent)
fmt.Printf(indent+" %-36s : %d\n", "VRAM max bandwidth (in GB/s)",
vram.GetMaxBandwidth())
}
}
if statusOnly {
fmt.Printf("\n%s\n", strings.Repeat("-", 90))
Expand Down
8 changes: 5 additions & 3 deletions sw/nic/gpuagent/protos/gpu.proto
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,13 @@ enum GPUThrottlingStatus {

message GPUVRAMStatus {
// VRAM memory type
VRAMType Type = 1;
VRAMType Type = 1;
// VRAM vendor
string Vendor = 2;
string Vendor = 2;
// VRAM size (in MB)
uint64 Size = 3;
uint64 Size = 3;
// VRAM max bandwidth at max memory clock (GB/s)
uint64 MaxBandwidth = 4;
}

// GPU page status
Expand Down
1 change: 1 addition & 0 deletions sw/nic/gpuagent/svc/gpu_to_proto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ aga_gpu_vram_status_to_proto (GPUVRAMStatus *proto_status,
proto_status->set_type(aga_gpu_vram_type_to_proto(status->type));
proto_status->set_vendor(status->vendor);
proto_status->set_size(status->size);
proto_status->set_maxbandwidth(status->max_bandwidth);
}

static inline amdgpu::GPUPageStatus
Expand Down