Merge amd-staging into amd-master 20230629
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: Ia0ac7e6a6d0765af5bbce09c8c99f8d782a5e01a
[ROCm/rocm_smi_lib commit: 8e8293a025]
Этот коммит содержится в:
@@ -134,12 +134,10 @@ install(FILES ${COMMON_SRC_ROOT}/include/rocm_smi/${ROCM_SMI_TARGET}Config.h
|
||||
install(FILES ${COMMON_SRC_ROOT}/include/rocm_smi/kfd_ioctl.h
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocm_smi
|
||||
COMPONENT dev)
|
||||
install(FILES ${COMMON_SRC_ROOT}/python_smi_tools/rsmiBindings.py
|
||||
install(PROGRAMS ${COMMON_SRC_ROOT}/python_smi_tools/rsmiBindings.py
|
||||
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/${ROCM_SMI}
|
||||
COMPONENT dev)
|
||||
install(FILES ${COMMON_SRC_ROOT}/python_smi_tools/rocm_smi.py
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
|
||||
GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
install(PROGRAMS ${COMMON_SRC_ROOT}/python_smi_tools/rocm_smi.py
|
||||
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/${ROCM_SMI}
|
||||
COMPONENT dev)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bin/rocm-smi
|
||||
|
||||
@@ -341,7 +341,9 @@ static rsmi_status_t get_dev_mon_value(amd::smi::MonitorTypes type,
|
||||
}
|
||||
GET_DEV_FROM_INDX
|
||||
|
||||
assert(dev->monitor() != nullptr);
|
||||
if (dev->monitor() == nullptr) {
|
||||
return RSMI_STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
std::string val_str;
|
||||
|
||||
@@ -369,8 +371,9 @@ static rsmi_status_t get_dev_mon_value(amd::smi::MonitorTypes type,
|
||||
}
|
||||
|
||||
GET_DEV_FROM_INDX
|
||||
assert(dev->monitor() != nullptr);
|
||||
|
||||
if (dev->monitor() == nullptr) {
|
||||
return RSMI_STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
std::string val_str;
|
||||
|
||||
int ret = dev->monitor()->readMonitor(type, sensor_ind, &val_str);
|
||||
@@ -394,8 +397,9 @@ static rsmi_status_t set_dev_mon_value(amd::smi::MonitorTypes type,
|
||||
uint32_t dv_ind, uint32_t sensor_ind, T val) {
|
||||
GET_DEV_FROM_INDX
|
||||
|
||||
assert(dev->monitor() != nullptr);
|
||||
|
||||
if (dev->monitor() == nullptr) {
|
||||
return RSMI_STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
int ret = dev->monitor()->writeMonitor(type, sensor_ind,
|
||||
std::to_string(val));
|
||||
|
||||
@@ -416,9 +420,9 @@ static rsmi_status_t get_power_mon_value(amd::smi::PowerMonTypes type,
|
||||
}
|
||||
|
||||
std::shared_ptr<amd::smi::Device> dev = smi.devices()[dv_ind];
|
||||
assert(dev != nullptr);
|
||||
assert(dev->monitor() != nullptr);
|
||||
|
||||
if (dev == nullptr || dev->monitor() == nullptr) {
|
||||
return RSMI_STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
ret = dev->power_monitor()->readPowerValue(type, val);
|
||||
|
||||
return amd::smi::ErrnoToRsmiStatus(ret);
|
||||
@@ -2503,7 +2507,9 @@ rsmi_dev_temp_metric_get(uint32_t dv_ind, uint32_t sensor_type,
|
||||
|
||||
GET_DEV_FROM_INDX
|
||||
|
||||
assert(dev->monitor() != nullptr);
|
||||
if (dev->monitor() == nullptr) {
|
||||
return RSMI_STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
std::shared_ptr<amd::smi::Monitor> m = dev->monitor();
|
||||
|
||||
// getTempSensorIndex will throw an out of range exception if sensor_type is
|
||||
@@ -2564,7 +2570,9 @@ rsmi_dev_volt_metric_get(uint32_t dv_ind, rsmi_voltage_type_t sensor_type,
|
||||
|
||||
GET_DEV_FROM_INDX
|
||||
|
||||
assert(dev->monitor() != nullptr);
|
||||
if (dev->monitor() == nullptr) {
|
||||
return RSMI_STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
std::shared_ptr<amd::smi::Monitor> m = dev->monitor();
|
||||
|
||||
// getVoltSensorIndex will throw an out of range exception if sensor_type is
|
||||
|
||||
@@ -1092,6 +1092,9 @@ void Device::fillSupportedFuncs(void) {
|
||||
if (supported_funcs_.size() != 0) {
|
||||
return;
|
||||
}
|
||||
if (monitor() == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::map<const char *, dev_depends_t>::const_iterator it =
|
||||
kDevFuncDependsMap.begin();
|
||||
|
||||
Ссылка в новой задаче
Block a user