rocm_smi_lib icon indicating copy to clipboard operation
rocm_smi_lib copied to clipboard

Improve handling of ContructBDFID errors

Open trixirt opened this issue 2 years ago • 2 comments

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.

trixirt avatar Jun 24 '23 13:06 trixirt

This was merged internally, it should be mirrored here by rocm 5.7.

Mystro256 avatar Jun 30 '23 14:06 Mystro256

I'll try to get the internal master branch synced with the public master branch next week

dmitrii-galantsev avatar Jun 30 '23 22:06 dmitrii-galantsev