-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
Description
I'm trying to get CUDA to work with Python multiprocessing. One of the issues is that since Python calls fork() but not exec(), the CUDA context from the parent is inherited by the subprocess. I've added a call to cuInit(0) in the child (and discard the THCState*) which prevents the most obvious errors, but I'm still seeing some strange ordering issues.
What's the correct way to handle CUDA contexts across forks?