Skip to content

CUDA_VISIBLE_DEVICES setting ignored after import monai #7407

Closed

Description

@KumoLiu

Describe the bug
CUDA_VISIBLE_DEVICES setting ignored after import monai

To Reproduce

import os
import torch
print('before import monai:', torch.cuda.device_count())
import monai

os.environ["CUDA_VISIBLE_DEVICES"] = "0"
print('after import monai:')
torch.cuda.set_device(1) # should failed

Expected behavior
CUDA_VISIBLE_DEVICES setting should not ignored after import monai

Activity

  1. added a commit that references this issue on Jan 22, 2024
    f18096d
  2. added a commit that references this issue on Jan 22, 2024
    abe2e31
  3. added a commit that references this issue on Jan 30, 2024
    21f9ae1
  4. added a commit that references this issue on Mar 25, 2024
    d8236ea
  5. added a commit that references this issue on Apr 11, 2024
    c0a752d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions