openucx / ucc

Unified Collective Communication Library
https://openucx.github.io/ucc/
BSD 3-Clause "New" or "Revised" License
177 stars 85 forks source link

EC/CUDA: check ctx valid before resource cleanup #954

Closed Sergei-Lebedev closed 2 months ago

Sergei-Lebedev commented 2 months ago

What

During EC CUDA resource cleanup original CUDA context can be already destroyed. In such case calls to cudaStreamDestroy, cudaEventDestroy etc. might result in segfault. This PR adds check that CUDA context is valid before doing cleanup.