rocm_smi_lib
rocm_smi_lib copied to clipboard
Improve handling of ContructBDFID errors
Building on this package on Fedora reports this warning In file included from rpmbuild/BUILD/rocm_smi_lib-rocm-5.5.1/src/rocm_smi_main.cc:62: In member function 'amd::smi::Device::set_bdfid(unsigned long)', inlined from 'amd::smi::RocmSMI::Initialize(unsigned long)' at rpmbuild/BUILD/rocm_smi_lib-rocm-5.5.1/src/rocm_smi_main.cc:330:27: rpmbuild/BUILD/rocm_smi_lib-rocm-5.5.1/include/rocm_smi/rocm_smi_device.h:199:42: warning: 'bdfid' may be used uninitialized [-Wmaybe-uninitialized] 199 | void set_bdfid(uint64_t val) {bdfid_ = val;} | ~~~~~~~^~~~~ rpmbuild/BUILD/rocm_smi_lib-rocm-5.5.1/src/rocm_smi_main.cc: In member function 'amd::smi::RocmSMI::Initialize(unsigned long)': rpmbuild/BUILD/rocm_smi_lib-rocm-5.5.1/src/rocm_smi_main.cc:324:12: note: 'bdfid' was declared here 324 | uint64_t bdfid; | ^~~~~
Only set the bdfid when it is know to be valid.
This was merged internally, it should be mirrored here by rocm 5.7.
I'll try to get the internal master branch synced with the public master branch next week