Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn user about PyTorch CPU version #3

Open
2 tasks
gtdang opened this issue May 18, 2023 · 0 comments
Open
2 tasks

Warn user about PyTorch CPU version #3

gtdang opened this issue May 18, 2023 · 0 comments

Comments

@gtdang
Copy link
Contributor

gtdang commented May 18, 2023

Have a check on import of the darts theorist. If the user is using the CPU version of torch (autora dependency), it will warn the user that in order to use GPU resources they should upgrade to the GPU version. I'm not sure if there is a way to detect GPU resource availability on the computer. Ideally it would only post the warning if they are using the cpu version of torch AND they have GPU resources.

We can use torch.cuda.is_available() to check if cuda is available. However, I'm not sure if this is a check on the computer or PyTorch. In other words is this a check on if the computer has GPU and the CUDA module? Or is this a check if PyTorch is configured and able to communicate with CUDA.

torch.cuda.device_count() returns the number of GPUs available. I assume CUDA has to be properly set up for torch to return this information though.

To test:

  • Build an environment with CPU version of torch on an Oscar instance with GPU. See how these commands function.
  • Do the same with the GPU version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant