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

CUDA error with M1 chip #237

Open
ravenep opened this issue May 2, 2023 · 2 comments
Open

CUDA error with M1 chip #237

ravenep opened this issue May 2, 2023 · 2 comments

Comments

@ravenep
Copy link

ravenep commented May 2, 2023

Hi Jakob, Ihave been working through your example to train my own model. The directories and data seem to be sourced correctly using the config files, but I have a new error that I was hoping you might be able to understand.

AssertionError("Torch not compiled with CUDA enabled")

I am using a MacBook Pro w/ Apple M1 Pro chip, OS 13.3.1, python 3.11, torch 2.0.0

I ran this test you suggested to another user:

import torch
torch.device("cuda" if torch.cuda.is_available() else "cpu")

And indeed, my machine only is finding the CPU, even though it has a GPU

from digging around, I found that the Apple M1 chip uses the 'mps' device option versus CUDA to access the GPU.
https://towardsdatascience.com/installing-pytorch-on-apple-m1-chip-with-gpu-acceleration-3351dc44d67c

I have confirmed my environment does have access to the GPU using this device option.

Do you know if it is possible to use this instead of the CUDA with your code? If yes, could you please refer where I might make the switch? Thank you!!

@wasserth
Copy link
Collaborator

wasserth commented May 2, 2023

Unfortunately changing this might involve a few places in the code. You can try to search the entire codebase for "cuda" and replace it accordingly.

@ravenep
Copy link
Author

ravenep commented May 3, 2023

Thanks for the suggestion! I found "cuda" in base_model.py and tried to modify the device to mps. It did not work for me, but do have a plan b in mind and will try this on a linux system moving forward.

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

2 participants