-
Notifications
You must be signed in to change notification settings - Fork 216
Description
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this request and that I agree to the Code of Conduct
Area
cuda.core
Is your feature request related to a problem? Please describe.
When using IPC capabilities in cuda.core
, it is easy to make the mistake of starting new processes by the "fork" method, especially since that is the default for the multiprocessing
module. When this occurs, child processes fail to construct Device
objects, generating a CUDA_ERROR_NOT_INITIALIZED error. The solution is to use the "spawn" start method. Users may not be aware of this and the error message does not clearly indicate the problem.
Describe the solution you'd like
There are key points in cuda.core
where it is clear that multiprocessing
is being used. For instance, when calling a reduction (i.e., pickling) method that was registered with multiprocessing
. In those cases, the library should perform a one-time check of the start method and warn if it is set incorrectly. Note that the start method can only be set once, so a one-time check while serializing is sufficient.
Describe alternatives you've considered
No response
Additional context
No response