Don't use hwmon# as indicator of gpu
Previously, during the rsmi_init discovery process, the existence of an hwmon# directory was used to distinguish between gpus nodes and non-gpu nodes. This isn't reliable in some scenarios. Instead, the existence of the vbios_version file is used as an indicator that the node is indeed a gpu. Change-Id: Icfbe5c42ed0970077b05f25c3d209308a31bec85
This commit is contained in:
@@ -52,13 +52,13 @@
|
||||
|
||||
#define CHECK_DV_IND_RANGE \
|
||||
amd::smi::RocmSMI& smi = amd::smi::RocmSMI::getInstance(); \
|
||||
if (dv_ind >= smi.monitor_devices().size()) { \
|
||||
if (dv_ind >= smi.devices().size()) { \
|
||||
return RSMI_STATUS_INVALID_ARGS; \
|
||||
} \
|
||||
|
||||
#define GET_DEV_FROM_INDX \
|
||||
CHECK_DV_IND_RANGE \
|
||||
std::shared_ptr<amd::smi::Device> dev = smi.monitor_devices()[dv_ind]; \
|
||||
std::shared_ptr<amd::smi::Device> dev = smi.devices()[dv_ind]; \
|
||||
assert(dev != nullptr);
|
||||
|
||||
|
||||
|
||||
@@ -76,7 +76,8 @@ class RocmSMI {
|
||||
void Cleanup(void);
|
||||
|
||||
std::vector<std::shared_ptr<amd::smi::Device>>&
|
||||
monitor_devices() {return monitor_devices_;}
|
||||
devices() {return devices_;}
|
||||
|
||||
uint32_t DiscoverAmdgpuDevices(void);
|
||||
int DiscoverAMDPowerMonitors(bool force_update = false);
|
||||
|
||||
@@ -123,9 +124,7 @@ class RocmSMI {
|
||||
std::map<uint32_t, uint32_t> dev_ind_to_node_ind_map_;
|
||||
void AddToDeviceList(std::string dev_name);
|
||||
void GetEnvVariables(void);
|
||||
uint32_t DiscoverAMDMonitors(void);
|
||||
|
||||
std::vector<std::shared_ptr<amd::smi::Device>> monitor_devices_;
|
||||
std::shared_ptr<Monitor> FindMonitor(std::string monitor_path);
|
||||
|
||||
RocmSMI_env_vars env_vars_;
|
||||
uint64_t init_options_;
|
||||
|
||||
Reference in New Issue
Block a user