LarryJane491 / Lora-Training-in-Comfy

This custom node lets you train LoRA directly in ComfyUI!
277 stars 38 forks source link

CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. #9

Open Snobbias opened 5 months ago

Snobbias commented 5 months ago

After 8 hours of trying to get this to work, I've managed to get pretty far, but now I seem to have some problems with the bitsandbytes dependancy. There is a guide for how to fix this on Linux in the error message, but that won't help me as I'm on windows. The error:

CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching in backup paths... The following directories listed in your path were found to be non-existent: {WindowsPath('/usr/local/cuda/lib64')} DEBUG: Possible options found for libcudart.so: set() CUDA SETUP: PyTorch settings found: CUDA_VERSION=121, Highest Compute Capability: 8.9. CUDA SETUP: To manually override the PyTorch CUDA version please see:https://github.com/TimDettmers/bitsandbytes/blob/main/how_to_use_nonpytorch_cuda.md CUDA SETUP: Loading binary F:\ComfyUI\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda121.so... argument of type 'WindowsPath' is not iterable CUDA SETUP: Problem: The main issue seems to be that the main CUDA runtime library was not detected. CUDA SETUP: Solution 1: To solve the issue the libcudart.so location needs to be added to the LD_LIBRARY_PATH variable CUDA SETUP: Solution 1a): Find the cuda runtime library via: find / -name libcudart.so 2>/dev/null CUDA SETUP: Solution 1b): Once the library is found add it to the LD_LIBRARY_PATH: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:FOUND_PATH_FROM_1a CUDA SETUP: Solution 1c): For a permanent solution add the export from 1b into your .bashrc file, located at ~/.bashrc CUDA SETUP: Solution 2: If no library was found in step 1a) you need to install CUDA. CUDA SETUP: Solution 2a): Download CUDA install script: wget https://raw.githubusercontent.com/TimDettmers/bitsandbytes/main/cuda_install.sh CUDA SETUP: Solution 2b): Install desired CUDA version to desired location. The syntax is bash cuda_install.sh CUDA_VERSION PATH_TO_INSTALL_INTO. CUDA SETUP: Solution 2b): For example, "bash cuda_install.sh 113 ~/local/" will download CUDA 11.3 and install into the folder ~/local

I've tried the following: First I reinstalled ComfyUI properly with git clone (I had the one click installer first) So now I install all dependencies into the virtual environment. I'm using pytorch with cuda version 12.1 since I use an RTX 4070 (I tried with 11.8 as well for good measure) I manually installed Cuda Toolkit version 12.1 (shouldn't be needed?) I also have Visual Studio. I'm using correct path to my images, in a folder named 5_images (with a total of 95 images), prepared with the description files. I can confirm that all other nodes I use work fine in ComfyUI with the new install. I've tried with many different 1.5 models.

After some searching, I think the problem is with bitsandbytes. I tried reinstalling it as well. The devs claim it doesn't even work with windows. It seems I need to find a file called "libcudart.so" and add it to LD_LIBRARY_PATH, but all the guides on how to do that is for Linux. Besides, I don't even have that file on my drives.

There seems to be some solution on how to get it to work at least with Automatic 1111: https://github.com/TimDettmers/bitsandbytes/issues/684.

Kudos to anyone who managed to get this node to work in Windows, because it's beyond my comprehension.

Snobbias commented 5 months ago

There was another advice that helped some windows user: https://github.com/TimDettmers/bitsandbytes/issues/976 But since this should work with the latest bitsandbytes, I suppose I shouldn't need that?