okio-ai / nendo

The Nendo AI Audio Tool Suite
MIT License
210 stars 12 forks source link

AssertionError: Torch not compiled with CUDA enabled #1

Closed stylessh closed 11 months ago

stylessh commented 11 months ago

Im trying to follow the musicgen example with nendo.

# main.py
from nendo import Nendo

nd = Nendo(plugins=["nendo_plugin_musicgen"])
song = nd.plugins.musicgen(prompt="funky 70s disco", bpm=120)
song.export("funky_disco.mp3")

And I followed all the instructions and building steps for nendo.

# requirements.txt
aiofiles==23.2.1
altair==5.1.2
annotated-types==0.6.0
antlr4-python3-runtime==4.9.3
anyio==3.7.1
attrs==23.1.0
audiocraft==1.2.0a1
audioread==3.0.1
av==11.0.0
blis==0.7.11
catalogue==2.0.10
certifi==2023.11.17
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
cloudpathlib==0.16.0
cloudpickle==3.0.0
colorama==0.4.6
colorlog==6.7.0
commonmark==0.9.1
confection==0.1.4
contourpy==1.2.0
cycler==0.12.1
cymem==2.0.8
decorator==5.1.1
demucs==4.0.1
docopt==0.6.2
dora-search==0.1.12
duckdb==0.9.2
duckdb-engine==0.9.2
einops==0.7.0
encodec==0.1.1
exceptiongroup==1.2.0
fastapi==0.104.1
ffmpy==0.3.1
filelock==3.13.1
flashy==0.0.2
fonttools==4.45.1
fsspec==2023.10.0
gradio==4.7.1
gradio-client==0.7.0
h11==0.14.0
httpcore==1.0.2
httpx==0.25.1
huggingface-hub==0.19.4
hydra-colorlog==1.2.0
hydra-core==1.3.2
idna==3.4
importlib-resources==6.1.1
Jinja2==3.1.2
joblib==1.3.2
jsonschema==4.20.0
jsonschema-specifications==2023.11.1
julius==0.2.7
kiwisolver==1.4.5
lameenc==1.6.3
langcodes==3.3.0
lazy-loader==0.3
librosa==0.10.1
lightning-utilities==0.10.0
llvmlite==0.41.1
MarkupSafe==2.1.3
matplotlib==3.8.2
mpmath==1.3.0
msgpack==1.0.7
murmurhash==1.0.10
nendo==0.1.0
nendo-plugin-musicgen==0.1.1
networkx==3.2.1
num2words==0.5.13
numba==0.58.1
numpy==1.26.2
omegaconf==2.3.0
openunmix==1.2.1
orjson==3.9.10
packaging==23.2
pandas==2.1.3
Pillow==10.1.0
platformdirs==4.0.0
pooch==1.8.0
preshed==3.0.9
protobuf==4.25.1
psycopg2==2.9.9
pycparser==2.21
pydantic==2.4.2
pydantic-core==2.10.1
pydantic-settings==2.1.0
pydub==0.25.1
pygments==2.17.2
pyparsing==3.1.1
python-dateutil==2.8.2
python-dotenv==1.0.0
python-multipart==0.0.6
pytz==2023.3.post1
PyYAML==6.0.1
referencing==0.31.0
regex==2023.10.3
requests==2.31.0
retrying==1.3.4
rich==12.6.0
rpds-py==0.13.1
safetensors==0.4.0
scikit-learn==1.3.2
scipy==1.11.4
semantic-version==2.10.0
sentencepiece==0.1.99
shellingham==1.5.4
six==1.16.0
smart-open==6.4.0
sniffio==1.3.0
sounddevice==0.4.6
soundfile==0.12.1
soxr==0.3.7
spacy==3.7.2
spacy-legacy==3.0.12
spacy-loggers==1.0.5
SQLAlchemy==2.0.23
sqlalchemy-json==0.5.0
srsly==2.4.8
starlette==0.27.0
submitit==1.5.1
sympy==1.12
thinc==8.2.1
threadpoolctl==3.2.0
tinytag==1.10.1
tokenizers==0.15.0
tomlkit==0.12.0
toolz==0.12.0
torch==2.2.0.dev20231123
torchaudio==2.2.0.dev20231123
torchmetrics==1.2.0
torchvision==0.17.0.dev20231123
tqdm==4.66.1
transformers==4.35.2
treetable==0.2.5
typer==0.9.0
typing-extensions==4.8.0
tzdata==2023.3
urllib3==2.1.0
uvicorn==0.24.0.post1
wasabi==1.1.2
weasel==0.3.4
websockets==11.0.3
xformers==0.0.22.post7
zipp==3.17.0

When I run the main.py, I receive the following error:

File "/Users/alandaniel/.pyenv/versions/3.9.6/lib/python3.9/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

I'm aware this is a Silicon chip issue, and i followed some possible fixes but none of them seem to work.

Especifications:

stylessh commented 11 months ago

I know this issue might not be directly related with the library, but I wanted to know if you faced the same issue and possible solutions :)

aaronabebe commented 11 months ago

Thanks for testing it out!

It looks like a bug in nendo_plugin_musicgen and a fix will be released in the next hotfix release - until then you can try everything out in a colab.

Be aware though that currently Musicgen might not be very fast on ARM Macs and in general using a GPU is recommended (see also this issue).