AssertionError: Torch not compiled with CUDA enabled

#42
by Aholicknight - opened

I am getting this error when running the provided python code:

    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "E:\video-generation\.venv\Lib\site-packages\diffusers\pipelines\text_to_video_synthesis\pipeline_text_to_video_synth.py", line 644, in __call__
    prompt_embeds, negative_prompt_embeds = self.encode_prompt(
                                            ^^^^^^^^^^^^^^^^^^^
  File "E:\video-generation\.venv\Lib\site-packages\diffusers\pipelines\text_to_video_synthesis\pipeline_text_to_video_synth.py", line 290, in encode_prompt
    prompt_embeds = self.text_encoder(text_input_ids.to(device), attention_mask=attention_mask)
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\video-generation\.venv\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

I also used pip install diffusers transformers accelerate torch to install. I also have a NVIDIA GeForce RTX 3060 Ti. Thank you!

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

Change cu124 to cu121 if nvidia-smi reports you have a lower cuda version.

Sign up or log in to comment