Show XCDs

This commit is contained in:
Dr-Noob
2025-10-26 10:27:51 +01:00
parent 94a9a440f0
commit 711936be81
2 changed files with 18 additions and 5 deletions

View File

@@ -48,6 +48,7 @@ enum {
ATTRIBUTE_FREQUENCY, // ALL ATTRIBUTE_FREQUENCY, // ALL
ATTRIBUTE_PEAK, // ALL ATTRIBUTE_PEAK, // ALL
ATTRIBUTE_COMPUTE_UNITS, // HSA ATTRIBUTE_COMPUTE_UNITS, // HSA
ATTRIBUTE_XCDS, // HSA
ATTRIBUTE_LDS_SIZE, // HSA ATTRIBUTE_LDS_SIZE, // HSA
ATTRIBUTE_STREAMINGMP, // CUDA ATTRIBUTE_STREAMINGMP, // CUDA
ATTRIBUTE_CORESPERMP, // CUDA ATTRIBUTE_CORESPERMP, // CUDA
@@ -70,6 +71,7 @@ static const AttributeField ATTRIBUTE_INFO[] = {
{ ATTRIBUTE_FREQUENCY, "Max Frequency:", "Max Freq.:" }, { ATTRIBUTE_FREQUENCY, "Max Frequency:", "Max Freq.:" },
{ ATTRIBUTE_PEAK, "Peak Performance:", "Peak Perf.:" }, { ATTRIBUTE_PEAK, "Peak Performance:", "Peak Perf.:" },
{ ATTRIBUTE_COMPUTE_UNITS, "Compute Units (CUs):", "CUs" }, { ATTRIBUTE_COMPUTE_UNITS, "Compute Units (CUs):", "CUs" },
{ ATTRIBUTE_XCDS, "XCDs:", "XCDs" }
{ ATTRIBUTE_LDS_SIZE, "LDS size:", "LDS:" }, { ATTRIBUTE_LDS_SIZE, "LDS size:", "LDS:" },
{ ATTRIBUTE_STREAMINGMP, "SMs:", "SMs:" }, { ATTRIBUTE_STREAMINGMP, "SMs:", "SMs:" },
{ ATTRIBUTE_CORESPERMP, "Cores/SM:", "Cores/SM:" }, { ATTRIBUTE_CORESPERMP, "Cores/SM:", "Cores/SM:" },
@@ -488,6 +490,7 @@ bool print_gpufetch_amd(struct gpu_info* gpu, STYLE s, struct color** cs, struct
char* uarch = get_str_uarch_hsa(gpu->arch); char* uarch = get_str_uarch_hsa(gpu->arch);
char* manufacturing_process = get_str_process(gpu->arch); char* manufacturing_process = get_str_process(gpu->arch);
char* cus = get_str_cu(gpu); char* cus = get_str_cu(gpu);
char* xcds = get_str_xcds(gpu);
char* max_frequency = get_str_freq(gpu); char* max_frequency = get_str_freq(gpu);
char* bus_width = get_str_bus_width(gpu); char* bus_width = get_str_bus_width(gpu);
char* mem_size = get_str_memory_size(gpu); char* mem_size = get_str_memory_size(gpu);
@@ -501,6 +504,9 @@ bool print_gpufetch_amd(struct gpu_info* gpu, STYLE s, struct color** cs, struct
setAttribute(art, ATTRIBUTE_TECHNOLOGY, manufacturing_process); setAttribute(art, ATTRIBUTE_TECHNOLOGY, manufacturing_process);
setAttribute(art, ATTRIBUTE_FREQUENCY, max_frequency); setAttribute(art, ATTRIBUTE_FREQUENCY, max_frequency);
setAttribute(art, ATTRIBUTE_COMPUTE_UNITS, cus); setAttribute(art, ATTRIBUTE_COMPUTE_UNITS, cus);
if (xcds != NULL) {
setAttribute(art, ATTRIBUTE_XCDS, xcds);
}
setAttribute(art, ATTRIBUTE_LDS_SIZE, lds_size); setAttribute(art, ATTRIBUTE_LDS_SIZE, lds_size);
setAttribute(art, ATTRIBUTE_MEMORY, mem_size); setAttribute(art, ATTRIBUTE_MEMORY, mem_size);
setAttribute(art, ATTRIBUTE_BUS_WIDTH, bus_width); setAttribute(art, ATTRIBUTE_BUS_WIDTH, bus_width);

View File

@@ -30,7 +30,7 @@ struct agent_info {
uint32_t compute_unit; uint32_t compute_unit;
uint32_t num_shader_engines; uint32_t num_shader_engines;
uint32_t simds_per_cu; uint32_t simds_per_cu;
uint32_t num_xcc; uint32_t num_xcc; // Acccelerator Complex Dies (XCDs)
}; };
#define RET_IF_HSA_ERR(err) { \ #define RET_IF_HSA_ERR(err) { \
@@ -146,12 +146,10 @@ struct topology_h* get_topology_info(struct agent_info info) {
struct topology_h* topo = (struct topology_h*) emalloc(sizeof(struct topology_h)); struct topology_h* topo = (struct topology_h*) emalloc(sizeof(struct topology_h));
topo->compute_units = info.compute_unit; topo->compute_units = info.compute_unit;
topo->num_shader_engines = info.num_shader_engines; topo->num_shader_engines = info.num_shader_engines; // not printed at the moment
topo->simds_per_cu = info.simds_per_cu; topo->simds_per_cu = info.simds_per_cu; // not printed at the moment
topo->num_xcc = info.num_xcc; topo->num_xcc = info.num_xcc;
printf("%d %d %d\n", topo->num_shader_engines, topo->simds_per_cu, topo->num_xcc);
return topo; return topo;
} }
@@ -226,3 +224,12 @@ struct gpu_info* get_gpu_info_hsa(int gpu_idx) {
char* get_str_cu(struct gpu_info* gpu) { char* get_str_cu(struct gpu_info* gpu) {
return get_str_generic(gpu->topo_h->compute_units); return get_str_generic(gpu->topo_h->compute_units);
} }
char* get_str_xcds(struct gpu_info* gpu) {
// If there is a single XCD, then we dont want to
// print it.
if (gpu->topo_h->num_xcc == 1) {
return NULL;
}
return get_str_generic(gpu->topo_h->num_xcc);
}