ROCm / rocm_smi_lib

ROCm SMI LIB
https://rocm.docs.amd.com/projects/rocm_smi_lib/en/latest/
MIT License
111 stars 48 forks source link

Improve handling of ContructBDFID errors #123

Open trixirt opened 1 year ago

trixirt commented 1 year ago

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(uint64t 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.

Mystro256 commented 1 year ago

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

dmitrii-galantsev commented 1 year ago

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