SWDEV-439576 - rocmsmi -> amdsmi
- Migrate to amdsmi library - NOTE: raslib still uses rocmsmi - Remove unused rocmsmi service - Remove unused RDC client code - Remove RSMI calls from protos/rdc.proto Change-Id: Ifc34a264c506b0ec5792307ee56b34526268762d Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
This commit is contained in:
@@ -29,9 +29,9 @@ THE SOFTWARE.
|
||||
#include <mutex> // NOLINT(build/c++11)
|
||||
#include <queue>
|
||||
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "rdc_lib/RdcMetricFetcher.h"
|
||||
#include "rdc_lib/rdc_common.h"
|
||||
#include "rocm_smi/rocm_smi.h"
|
||||
|
||||
namespace amd {
|
||||
namespace rdc {
|
||||
@@ -44,20 +44,20 @@ struct MetricValue {
|
||||
rdc_field_value value;
|
||||
};
|
||||
|
||||
// This union represents any RSMI handles require initialization and/or
|
||||
// This union represents any SMI handles require initialization and/or
|
||||
// shut down. There should only be one instance of this for each raw event
|
||||
// used. For example, if a field group includes a pseudo-event and the
|
||||
// underlying raw event, then only one FieldRSMIData should be created,
|
||||
// underlying raw event, then only one FieldSMIData should be created,
|
||||
// and it should be used by both events.
|
||||
struct FieldRSMIData {
|
||||
struct FieldSMIData {
|
||||
union {
|
||||
rsmi_event_handle_t evt_handle;
|
||||
amdsmi_event_handle_t evt_handle;
|
||||
};
|
||||
union {
|
||||
rsmi_counter_value_t counter_val;
|
||||
amdsmi_counter_value_t counter_val;
|
||||
};
|
||||
~FieldRSMIData() {}
|
||||
FieldRSMIData() : evt_handle(0), counter_val{0, 0, 0} {}
|
||||
~FieldSMIData() {}
|
||||
FieldSMIData() : evt_handle(0), counter_val{0, 0, 0} {}
|
||||
};
|
||||
|
||||
//!< The data structure to store the async fetch task
|
||||
@@ -77,11 +77,11 @@ class RdcMetricFetcherImpl : public RdcMetricFetcher {
|
||||
RdcMetricFetcherImpl();
|
||||
~RdcMetricFetcherImpl();
|
||||
|
||||
rdc_status_t acquire_rsmi_handle(RdcFieldKey fk) override;
|
||||
rdc_status_t delete_rsmi_handle(RdcFieldKey fk) override;
|
||||
rdc_status_t acquire_smi_handle(RdcFieldKey fk) override;
|
||||
rdc_status_t delete_smi_handle(RdcFieldKey fk) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<FieldRSMIData> get_rsmi_data(RdcFieldKey key);
|
||||
std::shared_ptr<FieldSMIData> get_smi_data(RdcFieldKey key);
|
||||
|
||||
uint64_t now();
|
||||
void get_ecc_error(uint32_t gpu_index, rdc_field_t field_id, rdc_field_value* value);
|
||||
@@ -92,7 +92,7 @@ class RdcMetricFetcherImpl : public RdcMetricFetcher {
|
||||
|
||||
//!< Async metric retreive
|
||||
std::map<RdcFieldKey, MetricValue> async_metrics_;
|
||||
std::map<RdcFieldKey, std::shared_ptr<FieldRSMIData>> rsmi_data_;
|
||||
std::map<RdcFieldKey, std::shared_ptr<FieldSMIData>> smi_data_;
|
||||
std::queue<MetricTask> updated_tasks_;
|
||||
std::mutex task_mutex_;
|
||||
std::future<void> updater_; // keep the future of updater
|
||||
@@ -100,8 +100,6 @@ class RdcMetricFetcherImpl : public RdcMetricFetcher {
|
||||
std::atomic<bool> task_started_;
|
||||
};
|
||||
|
||||
rdc_status_t Rsmi2RdcError(rsmi_status_t rsmi);
|
||||
|
||||
} // namespace rdc
|
||||
} // namespace amd
|
||||
|
||||
|
||||
@@ -24,9 +24,8 @@ THE SOFTWARE.
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "rdc/rdc.h"
|
||||
#include "rdc_lib/rdc_common.h"
|
||||
#include "rocm_smi/rocm_smi.h"
|
||||
|
||||
namespace amd {
|
||||
namespace rdc {
|
||||
@@ -35,23 +34,23 @@ class RdcSmiDiagnosticImpl {
|
||||
public:
|
||||
RdcSmiDiagnosticImpl();
|
||||
|
||||
rdc_status_t check_rsmi_process_info(uint32_t gpu_index[RDC_MAX_NUM_DEVICES], uint32_t gpu_count,
|
||||
rdc_diag_test_result_t* result);
|
||||
rdc_status_t check_rsmi_topo_info(uint32_t gpu_index[RDC_MAX_NUM_DEVICES], uint32_t gpu_count,
|
||||
rdc_status_t check_smi_process_info(uint32_t gpu_index[RDC_MAX_NUM_DEVICES], uint32_t gpu_count,
|
||||
rdc_diag_test_result_t* result);
|
||||
rdc_status_t check_smi_topo_info(uint32_t gpu_index[RDC_MAX_NUM_DEVICES], uint32_t gpu_count,
|
||||
rdc_diag_test_result_t* result);
|
||||
rdc_status_t check_smi_param_info(uint32_t gpu_index[RDC_MAX_NUM_DEVICES], uint32_t gpu_count,
|
||||
rdc_diag_test_result_t* result);
|
||||
rdc_status_t check_rsmi_param_info(uint32_t gpu_index[RDC_MAX_NUM_DEVICES], uint32_t gpu_count,
|
||||
rdc_diag_test_result_t* result);
|
||||
|
||||
private:
|
||||
rdc_diag_result_t check_temperature_level(uint32_t gpu_index, rsmi_temperature_type_t type,
|
||||
rdc_diag_result_t check_temperature_level(uint32_t gpu_index, amdsmi_temperature_type_t type,
|
||||
char msg[MAX_DIAG_MSG_LENGTH],
|
||||
char per_gpu_msg[MAX_DIAG_MSG_LENGTH]);
|
||||
std::string get_temperature_string(rsmi_temperature_type_t type) const;
|
||||
std::string get_temperature_string(amdsmi_temperature_type_t type) const;
|
||||
|
||||
rdc_diag_result_t check_voltage_level(uint32_t gpu_index, rsmi_voltage_type_t type,
|
||||
rdc_diag_result_t check_voltage_level(uint32_t gpu_index, amdsmi_voltage_type_t type,
|
||||
char msg[MAX_DIAG_MSG_LENGTH],
|
||||
char per_gpu_msg[MAX_DIAG_MSG_LENGTH]);
|
||||
std::string get_voltage_string(rsmi_voltage_type_t type) const;
|
||||
std::string get_voltage_string(amdsmi_voltage_type_t type) const;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<RdcSmiDiagnosticImpl> RdcSmiDiagnosticPtr;
|
||||
|
||||
@@ -30,13 +30,13 @@ THE SOFTWARE.
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "rdc_lib/RdcCacheManager.h"
|
||||
#include "rdc_lib/RdcGroupSettings.h"
|
||||
#include "rdc_lib/RdcMetricFetcher.h"
|
||||
#include "rdc_lib/RdcModuleMgr.h"
|
||||
#include "rdc_lib/RdcNotification.h"
|
||||
#include "rdc_lib/RdcWatchTable.h"
|
||||
#include "rocm_smi/rocm_smi.h"
|
||||
|
||||
namespace amd {
|
||||
namespace rdc {
|
||||
|
||||
@@ -23,12 +23,16 @@ THE SOFTWARE.
|
||||
#ifndef INCLUDE_RDC_LIB_IMPL_RSMIUTILS_H_
|
||||
#define INCLUDE_RDC_LIB_IMPL_RSMIUTILS_H_
|
||||
|
||||
#include "rocm_smi/rocm_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "rdc/rdc.h"
|
||||
|
||||
namespace amd {
|
||||
namespace rdc {
|
||||
|
||||
rdc_status_t Rsmi2RdcError(rsmi_status_t rsmi);
|
||||
rdc_status_t Smi2RdcError(amdsmi_status_t rsmi);
|
||||
amdsmi_status_t get_processor_handle_from_id(uint32_t gpu_id,
|
||||
amdsmi_processor_handle* processor_handle);
|
||||
amdsmi_status_t get_processor_count(uint32_t& all_processor_count);
|
||||
|
||||
} // namespace rdc
|
||||
} // namespace amd
|
||||
Reference in New Issue
Block a user