AssertionError: Torch not compiled with CUDA enabled
StableInquest opened this issue · 16 comments
Generating Riffusion mp3
100%| 20/20 [00:14<00:00, 1.42it/s]
Error completing request:17, 1.34it/s]
Arguments: ('mozart', '', 'None', 'None', 20, 0, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 512, False, 0.7, 0, 0, 5, False, False, False, False, '', 1, '', 0, '', True, False, False, 'Not set', True, True, '', '', '', '', '', 1.3, 'Not set', 'Not set', 1.3, 'Not set', 1.3, 'Not set', 1.3, 1.3, 'Not set', 1.3, 'Not set', 1.3, 'Not set', 1.3, 'Not set', 1.3, 'Not set', 1.3, 'Not set', False, 'None', True, True, '//stable-diffusion-webui/outputs/sd-webui-riffusion/', 'Refresh Inline Audio (Last Batch)', None, None, None, None, None, None, None, None) {}
Traceback (most recent call last):
File "//stable-diffusion-webui/modules/call_queue.py", line 45, in f
res = list(func(*args, **kwargs))
File "//stable-diffusion-webui/modules/call_queue.py", line 28, in f
res = func(*args, **kwargs)
File "//stable-diffusion-webui/modules/txt2img.py", line 46, in txt2img
processed = modules.scripts.scripts_txt2img.run(p, *args)
File "//stable-diffusion-webui/modules/scripts.py", line 328, in run
processed = script.run(p, *script_args)
File "//stable-diffusion-webui/extensions/sd-webui-riffusion/scripts/riffusion.py", line 129, in run
wav_bytes, duration_s = self.wav_bytes_from_spectrogram_image(
File "//stable-diffusion-webui/extensions/sd-webui-riffusion/scripts/riffusion.py", line 180, in wav_bytes_from_spectrogram_image
samples = self.waveform_from_spectrogram(
File "//stable-diffusion-webui/extensions/sd-webui-riffusion/scripts/riffusion.py", line 285, in waveform_from_spectrogram
Sxx_torch = torch.from_numpy(Sxx).to(device)
File "//stable-diffusion-webui/modules/devices.py", line 116, in tensor_to_fix
return orig_tensor_to(self, *args, **kwargs)
File "//stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/cuda/__init__.py", line 211, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
latest issue
Which versions of torch, torchvision and torchaudio do you have installed if you run pip list
in the python virtual environment?
(To activate the virtual environment, run the \stable-diffusion-webui\venv\Scripts\activate.bat
in a command prompt, assuming Windows)
Actually on M1 Mac. torch==1.12.1 torchvision==0.13.1 torchaudio==0.13.1, Python 3.10.8 (main, Oct 13 2022, 09:48:40) [Clang 14.0.0 (clang-1400.0.29.102)]
Correction. torchaudio==0.12.1
uninstall torch libraries and install from with these instructions instead of using pip
No luck so far.
I think the problem is that my script tries to install the CUDA version (of torchaudio) automatically at each startup, since I forgot about MacOS. Then it complains that your main torch installation has not been compiled with CUDA, which is correct
Hopefully my latest commit should address this
Sorry to hear you're still having issues, unfortunately I don't have a personal M1 Mac so it's hard for me to diagnose this problem
No problem at all. If I can be of any assitance testing on Mac just let me know. Happy to help.
Ok if you change :
device: str = "cuda:0",
to
device: str = "cpu:0",
if Mac is detected in the riffusion.py file that fixes it.
Ok if you change :
device: str = "cuda:0",
todevice: str = "cpu:0",
if Mac is detected in the riffusion.py file that fixes it.
Nice catch! I didn't notice the function defaults to trying to use a cuda device. That's what I get for copying someone else's code without reading it.
I will issue a fix based on your observation later today, glad to see you've found the fix
:)
After the update on amd64 installing the module removes gpu use ability by installing a wrong version of cudnn for me. Complete reinstall without riffusion fixed the issue.
Same error. @aavetis fix seems to be for normal use for an NVIDIA gpu, I use an AMD with the directml version of SD. Please help
Windows 11, stable diffusion 1.8 или 1.5, nvideo 3070, получаю эту же ошибку