[SWDEV-534605] Increase max devices supported and drm test link type (#625)

Increased the AMDSMI_MAX_DEVICES to 64 to accomodate all
devices in CPX mode. The link type has been modified in
amd-smi to match with rocm-smi types, updated the same
for drm tests.

---------

Signed-off-by: Bindhiya Kanangot Balakrishnan <Bindhiya.KanangotBalakrishnan@amd.com>
Этот коммит содержится в:
Kanangot Balakrishnan, Bindhiya
2025-09-17 16:30:04 -05:00
коммит произвёл GitHub
родитель 902667db3c
Коммит 6715c5aa92
5 изменённых файлов: 10 добавлений и 10 удалений
+2 -2
Просмотреть файл
@@ -291,8 +291,8 @@ static const std::map<processor_type_t, std::string>
static const std::map<amdsmi_link_type_t, std::string>
link_type_map = {
{AMDSMI_LINK_TYPE_INTERNAL, "INTERNAL"},
{AMDSMI_LINK_TYPE_XGMI, "XGMI"},
{AMDSMI_LINK_TYPE_PCIE, "PCIE"},
{AMDSMI_LINK_TYPE_XGMI, "XGMI"},
{AMDSMI_LINK_TYPE_NOT_APPLICABLE, "NOT_APPLICABLE"},
{AMDSMI_LINK_TYPE_UNKNOWN, "UNKNOWN"}
};
@@ -1959,8 +1959,8 @@ int main() {
// Get nearest GPUs
const char *topology_link_type_str[] = {
"AMDSMI_LINK_TYPE_INTERNAL",
"AMDSMI_LINK_TYPE_XGMI",
"AMDSMI_LINK_TYPE_PCIE",
"AMDSMI_LINK_TYPE_XGMI",
"AMDSMI_LINK_TYPE_NOT_APPLICABLE",
"AMDSMI_LINK_TYPE_UNKNOWN",
};
+1 -1
Просмотреть файл
@@ -334,8 +334,8 @@ int main() {
// Get nearest GPUs
const char *topology_link_type_str[] = {
"AMDSMI_LINK_TYPE_INTERNAL",
"AMDSMI_LINK_TYPE_XGMI",
"AMDSMI_LINK_TYPE_PCIE",
"AMDSMI_LINK_TYPE_XGMI",
"AMDSMI_LINK_TYPE_NOT_APPLICABLE",
"AMDSMI_LINK_TYPE_UNKNOWN",
};
+1 -1
Просмотреть файл
@@ -2092,7 +2092,7 @@ typedef struct {
*/
typedef struct {
uint32_t count;
amdsmi_processor_handle processor_list[AMDSMI_MAX_DEVICES+1];
amdsmi_processor_handle processor_list[AMDSMI_MAX_DEVICES * AMDSMI_MAX_NUM_XCP];
uint64_t reserved[14];
} amdsmi_topology_nearest_t;
+2 -2
Просмотреть файл
@@ -2204,8 +2204,8 @@ struct_amdsmi_topology_nearest_t._pack_ = 1 # source:False
struct_amdsmi_topology_nearest_t._fields_ = [
('count', ctypes.c_uint32),
('PADDING_0', ctypes.c_ubyte * 4),
('processor_list', ctypes.POINTER(None) * 32),
('reserved', ctypes.c_uint64 * 15),
('processor_list', ctypes.POINTER(None) * 256),
('reserved', ctypes.c_uint64 * 14),
]
amdsmi_topology_nearest_t = struct_amdsmi_topology_nearest_t
+4 -4
Просмотреть файл
@@ -4807,8 +4807,8 @@ amdsmi_get_link_topology_nearest(amdsmi_processor_handle processor_handle,
}
uint32_t device_counter(AMDSMI_MAX_DEVICES);
amdsmi_processor_handle device_list[AMDSMI_MAX_DEVICES];
uint32_t device_counter(AMDSMI_MAX_DEVICES * AMDSMI_MAX_NUM_XCP);
amdsmi_processor_handle device_list[AMDSMI_MAX_DEVICES * AMDSMI_MAX_NUM_XCP];
for (auto socket_idx = uint32_t(0); socket_idx < socket_counter; ++socket_idx) {
if (auto api_status = amdsmi_get_processor_handles(socket_list[socket_idx], &device_counter, device_list);
(api_status != amdsmi_status_t::AMDSMI_STATUS_SUCCESS)) {
@@ -4856,14 +4856,14 @@ amdsmi_get_link_topology_nearest(amdsmi_processor_handle processor_handle,
/*
* Note: The link topology table is sorted by the number of hops and link weight.
*/
topology_nearest_info->processor_list[AMDSMI_MAX_DEVICES] = {nullptr};
topology_nearest_info->processor_list[AMDSMI_MAX_DEVICES * AMDSMI_MAX_NUM_XCP] = {nullptr};
topology_nearest_info->count = static_cast<uint32_t>(link_topology_order.size());
auto topology_nearest_counter = uint32_t(0);
while (!link_topology_order.empty()) {
auto link_info = link_topology_order.top();
link_topology_order.pop();
if (topology_nearest_counter < AMDSMI_MAX_DEVICES) {
if (topology_nearest_counter < (AMDSMI_MAX_DEVICES * AMDSMI_MAX_NUM_XCP)) {
topology_nearest_info->processor_list[topology_nearest_counter++] = link_info.target_processor_handle;
}
}