Went through the install process now it says it installed Torch not compiled with Cuda enabled
f-rank opened this issue ยท 13 comments
Throws in console:
** ComfyUI start up time: 2023-11-23 19:35:05.661688
Prestartup times for custom nodes:
0.0 seconds: D:\WORK\conda_envs\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy
0.0 seconds: D:\WORK\conda_envs\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager
Traceback (most recent call last):
File "D:\WORK\conda_envs\ComfyUI\ComfyUI_windows_portable\ComfyUI\main.py", line 72, in
import execution
File "D:\WORK\conda_envs\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 12, in
import nodes
File "D:\WORK\conda_envs\ComfyUI\ComfyUI_windows_portable\ComfyUI\nodes.py", line 20, in
import comfy.diffusers_load
File "D:\WORK\conda_envs\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\diffusers_load.py", line 4, in
import comfy.sd
File "D:\WORK\conda_envs\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\sd.py", line 5, in
from comfy import model_management
File "D:\WORK\conda_envs\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 114, in
total_vram = get_total_memory(get_torch_device()) / (1024 * 1024)
^^^^^^^^^^^^^^^^^^
File "D:\WORK\conda_envs\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 83, in get_torch_device
return torch.device(torch.cuda.current_device())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\WORK\conda_envs\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\cuda_init_.py", line 769, in current_device
lazy_init()
File "D:\WORK\conda_envs\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\cuda_init.py", line 289, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
D:\WORK\conda_envs\ComfyUI\ComfyUI_windows_portable>pause
Press any key to continue . . .
Any way to mitigate this without a full re-install of Comfy ?
I'd try to install torch+cu118 with --extra-index-url https://download.pytorch.org/whl/torch
Same issue occurred on an A1111 Python 3.10.6 ENV
Try This, Obviously change Paths/Torch ver
Command Prompt:
\stable-diffusion-webui\venv\Scripts\activate.bat
pip install https://download.pytorch.org/whl/cu118/torch-2.1.0%2Bcu118-cp310-cp310-win_amd64.whl
I went with :
python_embeded>python.exe -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu121
Requirement already satisfied: torch in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (2.1.0)
Requirement already satisfied: torchvision in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (0.16.0+cu121)
Requirement already satisfied: torchaudio in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (2.1.0+cu121)
Requirement already satisfied: filelock in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from torch) (3.13.1)
Requirement already satisfied: typing-extensions in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from torch) (4.8.0)
Requirement already satisfied: sympy in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from torch) (1.12)
Requirement already satisfied: networkx in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from torch) (3.2.1)
Requirement already satisfied: jinja2 in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from torch) (3.1.2)
Requirement already satisfied: fsspec in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from torch) (2023.10.0)
Requirement already satisfied: numpy in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from torchvision) (1.24.4)
Requirement already satisfied: requests in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from torchvision) (2.31.0)
Collecting torch
Downloading https://download.pytorch.org/whl/cu121/torch-2.1.0%2Bcu121-cp311-cp311-win_amd64.whl (2473.9 MB)
---------------------------------------- 2.5/2.5 GB 3.8 MB/s eta 0:00:00
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from torchvision) (9.5.0)
Requirement already satisfied: MarkupSafe>=2.0 in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from jinja2->torch) (2.1.3)
Requirement already satisfied: charset-normalizer<4,>=2 in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->torchvision) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->torchvision) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->torchvision) (1.26.18)
Requirement already satisfied: certifi>=2017.4.17 in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->torchvision) (2023.7.22)
Requirement already satisfied: mpmath>=0.19 in d:\work\conda_envs\comfyui\comfyui_windows_portable\python_embeded\lib\site-packages (from sympy->torch) (1.3.0)
Installing collected packages: torch
Attempting uninstall: torch
Found existing installation: torch 2.1.0
Uninstalling torch-2.1.0:
Successfully uninstalled torch-2.1.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
clip-interrogator 0.6.0 requires transformers>=4.27.1, but you have transformers 4.26.1 which is incompatible.
torchdata 0.6.1 requires torch==2.0.1, but you have torch 2.1.0+cu121 which is incompatible.
Successfully installed torch-2.1.0+cu121
It seems to be running again, for now.
For reference this is on 3.11.6, in the python_embeded directory in comfy.
Will try your solutions if run into something later on. Bit finicky with all this.
Hi @f-rank, can you try pulling the latest version of this module and re-installing from the new latest requirements.txt
file to see if it works?
I just made some changes to simplify installation & make it work in more environments. thanks!
So, I installed about an hour ago and ran into the OOM error. I found a really simple/great solution for those with 25gb (or close) VRam and lots of system RAM: Run it twice
But first off make sure you're on one of the latest NVidia drivers w/ their new VRam fallback option where CUDA will try to use RAM in the event VRam is used up rather than issuing an OOM error.
I toggled this option on globally and watched task manager as the workflow progressed. First time through it gave me the OOM and shared memory didn't rise about 0 until after the error. I just ran it again, and the second time it realized it could use RAM to avoid the error.
I got this idea from a random A1111 repo that was posted today here: https://github.com/klimaleksus/stable-diffusion-webui-giant-kitten
There are some drawbacks with speed, but it's working for me even w/ RIFE and VRam getting up to 50gb.
(BTW: Running a 4090 w/ 64gb RAM / 13900 intel)
Nvidia driver: 546.17
Hope this helps someone!
Console 1st = OOM error / Simple requeue and success!
File "D:\sdxl\comfyui\venv\Lib\site-packages\torch\nn\modules\conv.py", line 456, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
torch.cuda.OutOfMemoryError: Allocation on device 0 would exceed allowed memory. (out of memory)
Currently allocated : 13.86 GiB
Requested : 3.94 GiB
Device limit : 23.99 GiB
Free (according to CUDA): 0 bytes
PyTorch limit (set by user-supplied memory fraction)
: 17179869184.00 GiB
Prompt executed in 45.80 seconds
got prompt
INFO:comfyui-prompt-control:Resolving wildcards...
Prompt executed in 158.32 seconds
@pondloso can you actually try deleting the custom node locally & re-installing it via the ComfyUI Manager?
I just pushed a new update on Github that should make the installation process a lot easier (this time, it won't accidentally re-install any existing pytorch version and it will also auto-download any missing SVD checkpoints into the models folder on startup).
Thanks for sharing @CCpt5 !
Also, I think for low VRAM usage, it would help to reduce the decoding_t parameter in the SVD Decoder node. This controls how many frames are decoded at once.
Hi @f-rank, can you try pulling the latest version of this module and re-installing from the new latest
requirements.txt
file to see if it works?I just made some changes to simplify installation & make it work in more environments. thanks!
On a clean install now, it went through the process ok @thecooltechguy
Awesome, thanks!