2
0

Implement CPU discovery support (#77)

* Implement CPU discovery support

SWDEV-482949:

enable the CPU model name info support to the RDC, rdci command
can detect GPU and CPU modules at the same time.
It will query the CPU info through the amdsmi interface like below:

1 GPUs found.
-----------------------------------------------------------------
GPU Index        Device Information
0               AMD Radeon PRO W7800
=================================================================
1 CPUs found.
-----------------------------------------------------------------
CPU Index        Device Information
0               AMD Ryzen Threadripper PRO 7995WX 96-Cores
-----------------------------------------------------------------

Change-Id: Ibc6533c9a61000cd86c45b1bae14c3eb6788c119
Signed-off-by: Perry Yuan <perry.yuan@amd.com>

* CMAKE - Add required version for amdsmi

Change-Id: I341a89351d196ec66cce215a5d1d3953302fcc66
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>

---------

Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
Co-authored-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
Este cometimento está contido em:
Yuan, Perry
2025-03-31 10:58:36 +08:00
cometido por GitHub
ascendente 80ee980cdb
cometimento 3bdca8b8b6
16 ficheiros modificados com 365 adições e 5 eliminações
+21 -2
Ver ficheiro
@@ -174,6 +174,16 @@ rdc_status_t rdc_device_get_all(rdc_handle_t p_rdc_handle,
->rdc_device_get_all(gpu_index_list, count);
}
rdc_status_t rdc_device_get_all_cpu(rdc_handle_t p_rdc_handle,
uint32_t cpu_index_list[RDC_MAX_NUM_DEVICES], uint32_t* count) {
if (!p_rdc_handle || !count) {
std::cout << "p_rdc_handle or count is NULL\n";
return RDC_ST_INVALID_HANDLER;
}
return static_cast<amd::rdc::RdcHandler*>(p_rdc_handle)
->rdc_device_get_all_cpu(cpu_index_list, count);
}
rdc_status_t rdc_device_get_attributes(rdc_handle_t p_rdc_handle, uint32_t gpu_index,
rdc_device_attributes_t* p_rdc_attr) {
if (!p_rdc_handle || !p_rdc_attr) {
@@ -184,8 +194,17 @@ rdc_status_t rdc_device_get_attributes(rdc_handle_t p_rdc_handle, uint32_t gpu_i
->rdc_device_get_attributes(gpu_index, p_rdc_attr);
}
rdc_status_t rdc_device_get_component_version(rdc_handle_t p_rdc_handle, rdc_component_t component,
rdc_component_version_t* p_rdc_compv) {
rdc_status_t rdc_device_get_cpu_attributes(rdc_handle_t p_rdc_handle, uint32_t cpu_index,
rdc_device_attributes_t* p_rdc_attr) {
if (!p_rdc_handle || !p_rdc_attr) {
return RDC_ST_INVALID_HANDLER;
}
return static_cast<amd::rdc::RdcHandler*>(p_rdc_handle)
->rdc_device_get_cpu_attributes(cpu_index, p_rdc_attr);
}
rdc_status_t rdc_device_get_component_version(rdc_handle_t p_rdc_handle, rdc_component_t component, rdc_component_version_t* p_rdc_compv) {
if (!p_rdc_handle || !p_rdc_compv) {
return RDC_ST_INVALID_HANDLER;
}