Skip to content

Change to Default CUDA GPU #4

@liordvir

Description

@liordvir

In prox_diffpir_poisson.py, line 115:

device = torch.device('cuda:2' if torch.cuda.is_available() else 'cpu')

the default CUDA GPU the script searches for is the 3rd available one, else it uses CPU.
This line will cause an error if user has 1 or 2 GPUs available, because torch.cuda.is_available() is True, but cuda:2 does not exist and the script tries to access it anyway.
I believe this should be changed to just 'cuda', so it defaults to user's first available GPU. (As many users probably only have at most one):

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions