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:
Chris Freehill
2021-01-28 18:25:53 -06:00
parent 20e2d260fb
commit ff9546aa62
7 changed files with 111 additions and 143 deletions
+2 -2
View File
@@ -183,10 +183,10 @@ rsmi_status_t handleException() {
pthread_mutex_t *GetMutex(uint32_t dv_ind) {
amd::smi::RocmSMI& smi = amd::smi::RocmSMI::getInstance();
if (dv_ind >= smi.monitor_devices().size()) {
if (dv_ind >= smi.devices().size()) {
return nullptr;
}
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);
return dev->mutex();