comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
51.91k stars 5.45k forks source link

Looking for NVIDIA drivers on an AMD GPU #2058

Open 1stbuildglow opened 10 months ago

1stbuildglow commented 10 months ago

Hello

I'm on Ubuntu 22.04 and using an AMD Radeon GTX 6750 GPU. Initially got ComfyUI up and running following the steps. However, I downloaded a custom node for Stable Diffusion Video for ComfyUI and now I get this error:

RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx I'm guessing the custom node only looks for Nvidia (didn't realize) and is looking for that? I tried deleting all the custom nodes but that didn't work. I tried deleting and reinstalling the repo to no avail. I'm not sure what else to do.

Thanks!

jn-jairo commented 10 months ago

Have you tried this https://github.com/comfyanonymous/ComfyUI#amd-gpus-linux-only

1stbuildglow commented 10 months ago

Have you tried this https://github.com/comfyanonymous/ComfyUI#amd-gpus-linux-only

Yep, that is how I installed and attempted reinstallation

rdvo commented 10 months ago

any updates? Does comfyUI work on ubuntu?

Th3Rom3 commented 10 months ago

Did you try uninstalling the currently present Python modules torch torchvision torchaudio and reinstall them from the ROCm nightly as in the installation guide?

mesa-git commented 10 months ago

I have the same setup, 6750 XT on Ubuntu... works nice.

Wrote a short-guide here: https://github.com/mesa-git/ComfyUI-AMD-6750-XT-Ubuntu

Joly0 commented 7 months ago

Btw, i am also getting this error

Traceback (most recent call last):
  File "/config/05-comfy-ui/ComfyUI/main.py", line 76, in <module>
    import execution
  File "/config/05-comfy-ui/ComfyUI/execution.py", line 11, in <module>
    import nodes
  File "/config/05-comfy-ui/ComfyUI/nodes.py", line 20, in <module>
    import comfy.diffusers_load
  File "/config/05-comfy-ui/ComfyUI/comfy/diffusers_load.py", line 3, in <module>
    import comfy.sd
  File "/config/05-comfy-ui/ComfyUI/comfy/sd.py", line 3, in <module>
    from comfy import model_management
  File "/config/05-comfy-ui/ComfyUI/comfy/model_management.py", line 118, in <module>
    total_vram = get_total_memory(get_torch_device()) / (1024 * 1024)
                                  ^^^^^^^^^^^^^^^^^^
  File "/config/05-comfy-ui/ComfyUI/comfy/model_management.py", line 87, in get_torch_device
    return torch.device(torch.cuda.current_device())
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/05-comfy-ui/env/lib/python3.11/site-packages/torch/cuda/__init__.py", line 787, in current_device
    _lazy_init()
  File "/config/05-comfy-ui/env/lib/python3.11/site-packages/torch/cuda/__init__.py", line 302, in _lazy_init
    torch._C._cuda_init()
RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx

even after following your guide @mesa-git

Th3Rom3 commented 7 months ago

@Joly0 you can query pip which version of torch is installed in the python environment.

pip show torch

e.g. for me it shows as

Name: torch Version: 2.2.0+rocm5.7 Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration Home-page: https://pytorch.org/ Author: PyTorch Team Author-email: packages@pytorch.org

Make sure you run that pip command within the same python system that is used to run ComfyUI.

As always you can use the command which to see which python binaries are used when using any given command i.e.

which python which pip

You can specifically target python to use a certain pip by not using pip but python -m pip instead.

To expand on this:

/usr/bin/python -m pip show torch which queries pip within my system python returns a package not found since I have not installed torch in my system python environment. Wheras if I use /media/scratch/Python-envs/ComfyUI/bin/python -m pip show torch which uses the pip installed in my environment for ComfyUI it shows the aforementioned ROCm torch package.

pouya-abbassi commented 7 months ago

Have the exact same problem. pip show torch returns nvidia result.

╰─$ /home/pouya/src/comfy-ui/venv/bin/python -m pip show torch                                                                                                                  130 ↵
Name: torch
Version: 2.3.0.dev20240216+cu121
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3
Location: /home/pouya/src/comfy-ui/venv/lib/python3.11/site-packages
Requires: filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-curand-cu12, nvidia-cusolver-cu12, nvidia-cusparse-cu12, nvidia-nccl-cu12, nvidia-nvtx-cu12, pytorch-triton, sympy, typing-extensions
Required-by: torchaudio, torchsde, torchvision
Th3Rom3 commented 7 months ago

@pouya-abbassi

/home/pouya/src/comfy-ui/venv/bin/python -m pip uninstall torch torchaudio torchvision
/home/pouya/src/comfy-ui/venv/bin/python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.7

Try manually uninstalling the cuda and reinstalling the rocm packages. This can happen if you install the requirements.txt before the rocm torch libraries.