Skip to content

set different environment variables per worker with loky backend #1064

@btel

Description

@btel

I would like to pass different environment variables to each worker, so they can be initialized on different resources.

For a bit of context, I would like to parallelize some code on mutiple GPUs (on a single machine) by setting CUDA_VISIBLE_DEVICES for each worker. From what I understand, at the moment the environment that I set in the main process will be shared by all workers. Note that the variable has to be set before any GPU-based libraries are imported and ressources are allocated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions