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

AssertionError: Torch not compiled with CUDA enabled #34

Open
danyuexiao opened this issue Jan 21, 2025 · 5 comments
Open

AssertionError: Torch not compiled with CUDA enabled #34

danyuexiao opened this issue Jan 21, 2025 · 5 comments

Comments

@danyuexiao
Copy link

Traceback (most recent call last):
File "D:\ai\sonic\Sonic\demo.py", line 4, in
pipe = Sonic(0)
File "D:\ai\sonic\Sonic\sonic.py", line 160, in init
audio2token = AudioProjModel(seq_len=10, blocks=5, channels=384, intermediate_dim=1024, output_dim=1024, context_tokens=32).to(device)
File "C:\Users\bunny\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1152, in to
return self._apply(convert)
File "C:\Users\bunny\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 802, in _apply
module._apply(fn)
File "C:\Users\bunny\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 825, in apply
param_applied = fn(param)
File "C:\Users\bunny\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1150, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
File "C:\Users\bunny\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\cuda_init
.py", line 293, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

how can i solve this issue?
i already have the pytorch installed.

@jonnyjohnson1
Copy link

Are you running on MacOS?

@danyuexiao
Copy link
Author

danyuexiao commented Jan 23, 2025 via email

@jinwyp
Copy link
Contributor

jinwyp commented Jan 23, 2025

1 Try to install on windows
See #17

Better to install torch using cu124

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124

2 keeps the original size and layout
#27

@danyuexiao
Copy link
Author

danyuexiao commented Jan 23, 2025 via email

@jinwyp
Copy link
Contributor

jinwyp commented Jan 24, 2025

thanks very much.
i have it installed correctly on my linux system.
i am wondering for the windows system, do you have a preferred python
version?

I test on windows with python 3.10 or 3.11,
and torch version is cu124 or cu118 on RTX 30 or 40 graphic card

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

3 participants