In multiple GPUs environment, too many warning messages generated,
and then need to be removed.
Change-Id: I275de2397eb0e6b189e2e17e94335cb1e8f97815
[ROCm/rocm_smi_lib commit: 3d82f1799d]
The environment variable RSMI_MUTEX_THREAD_ONLY=1 to enable thread only mutex.
The RSMI_INIT_FLAG_THRAD_ONLY_MUTEX can also be pass to rsmi_init()
to enable thread only mutex.
Change-Id: I2d9844039b774e386f03bb9bb130d8c342504ea6
[ROCm/rocm_smi_lib commit: 6ff95e55da]
After the dead process is detected, pthread_mutex_consistent() will
be called. After that, the pthread_mutex_unlock() should also be
called to unlock it: "It is the responsibility of the application to
recover the state so it can be reused."
Change-Id: I45d3e2e68c3b06779f3acb1e908dbec0c6a39297
[ROCm/rocm_smi_lib commit: 750704720b]
To prevent reset the mutex while using it, only reset the mutex
if it cannot acquire it.
Change-Id: I95e0ed1bf543f285ce81b4df9c51e16a88081d38
[ROCm/rocm_smi_lib commit: 160c99d12d]
If the code is crashed and the mutex may be in bad status. The user
has to mannually remove it. The fix will remove the shared mutex
if no process is using it.
Change-Id: I18bf562f2e0a7de8b3f0cccf72d60950b0d9bb2d
[ROCm/rocm_smi_lib commit: 76b5528feb]
Previously, when a process holding a shared mutex was killed,
the next time an RSMI application was started, it would not be
able to obtain the mutex--the application would have to exit.
This fix uses pthread_mutexattr_setrobust() to detect this
situation and act accordingingly.
Also, add some missing, needed mutexes and move mutexes
closer to where the protect resource is used.
Change-Id: Icfdc3a246f4cfa3fd008e3f13472199abd76fd35
[ROCm/rocm_smi_lib commit: f4938b0ac9]