Skip to content

[FEA]: Warn when the multiprocessing start method is "fork" #1136

@Andy-Jost

Description

@Andy-Jost

Is this a duplicate?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    cuda.coreEverything related to the cuda.core moduleenhancementAny code-related improvementstriageNeeds the team's attention

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions