guan404ming opened a new pull request, #18624:
URL: https://github.com/apache/tvm/pull/18624

   ## Why
   
   The CUDAModuleNode destructor was using CUDA_DRIVER_CALL and CUDA_CALL 
macros that call LOG(FATAL) (throw an exception) when CUDA operations fail.
   
   During interpreter shutdown, the CUDA context can become invalid, causing 
CUDA_ERROR_ILLEGAL_ADDRESS when cuModuleUnload is called. Throwing exceptions 
in destructors is undefined behavior and causes crashes.
   
   ## How
   1. Removed the throwing macros from the destructor
   2. Check cudaSetDevice return value and skip cleanup if it fails
   3. Ignore errors from cuModuleUnload - during shutdown these are benign 
since the OS will reclaim resources anyway


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to