Skip to content

CUDA contexts across forks #187

@colesbury

Description

@colesbury

@ngimel, @thatguymike

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions