bitsandbytes-foundation / bitsandbytes

Accessible large language models via k-bit quantization for PyTorch.
https://huggingface.co/docs/bitsandbytes/main/en/index
MIT License
6.19k stars 621 forks source link

unable to use kohya_ss main errors are ( libcudart.so not found , 'WindowsPath' is not) iterable #145

Closed TaimaniNTR closed 1 year ago

TaimaniNTR commented 1 year ago

hi, this is my 3rd clean install to kohya_ss with all the requirements but still having the same problem... i have automatic 1111 stable diffusion with dreambooth and using it to train a LORA without any problems because i have everything installed on my pc but i want to use kohya_ss because its simpler and faster but im getting this error

CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64... D:\Kohya\kohya_ss\venv\lib\site-packages\bitsandbytes\cuda_setup\paths.py:27: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {WindowsPath('/usr/local/cuda/lib64')} warn( WARNING: No libcudart.so found! Install CUDA or the cudatoolkit package (anaconda)! CUDA SETUP: Loading binary D:\Kohya\kohya_ss\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cpu.so... Traceback (most recent call last): File "D:\Kohya\kohya_ss\train_db.py", line 346, in train(args) File "D:\Kohya\kohya_ss\train_db.py", line 122, in train import bitsandbytes as bnb File "D:\Kohya\kohya_ss\venv\lib\site-packages\bitsandbytes__init.py", line 6, in from .autograd._functions import ( File "D:\Kohya\kohya_ss\venv\lib\site-packages\bitsandbytes\autograd_functions.py", line 5, in import bitsandbytes.functional as F File "D:\Kohya\kohya_ss\venv\lib\site-packages\bitsandbytes\functional.py", line 13, in from .cextension import COMPILED_WITH_CUDA, lib File "D:\Kohya\kohya_ss\venv\lib\site-packages\bitsandbytes\cextension.py", line 41, in lib = CUDALibrary_Singleton.get_instance().lib File "D:\Kohya\kohya_ss\venv\lib\site-packages\bitsandbytes\cextension.py", line 37, in get_instance cls._instance.initialize() File "D:\Kohya\kohya_ss\venv\lib\site-packages\bitsandbytes\cextension.py", line 31, in initialize self.lib = ct.cdll.LoadLibrary(binary_path) File "C:\Users\Lord\AppData\Local\Programs\Python\Python310\lib\ctypes__init__.py", line 452, in LoadLibrary return self._dlltype(name) File "C:\Users\Lord\AppData\Local\Programs\Python\Python310\lib\ctypes\init.py", line 364, in init__ if '/' in name or '\' in name:

TypeError: argument of type 'WindowsPath' is not iterable Traceback (most recent call last): File "C:\Users\Lord\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Lord\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "D:\Kohya\kohya_ss\venv\Scripts\accelerate.exe__main__.py", line 7, in File "D:\Kohya\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main args.func(args) File "D:\Kohya\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 1104, in launch_command simple_launcher(args) File "D:\Kohya\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 567, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)

was hoping if someone can help me with this.

ZK11dev commented 1 year ago

Hey, I'm also experiencing this issue, though I have not found a solution. If you do please let me know, I'll likely explain a solution if I figure one out myself.

TaimaniNTR commented 1 year ago

this guy fixed it for me. https://github.com/kohya-ss/sd-scripts/issues/195#issuecomment-1433613066 for whatever reason, i couldn't copy anything from bitsandbytes_windows with cmd or PowerShell so i had to do it manually to fix cuda path problem

filipaura commented 1 year ago

I had a similar problem and this worked for me. "Make sure to tick the box to add Python to the 'PATH' environment variable" How to do it: https://www.youtube.com/watch?v=ow2jROvxyH4&t=6s

swumagic commented 11 months ago

Bitsandbytes was not supported windows before, but my method can support windows.(yuhuang) 1 open folder J:\StableDiffusion\sdwebui,Click the address bar of the folder and enter CMD or WIN+R, CMD 。enter,cd /d J:\StableDiffusion\sdwebui 2 J:\StableDiffusion\sdwebui\py310\python.exe -m pip uninstall bitsandbytes

3 J:\StableDiffusion\sdwebui\py310\python.exe -m pip uninstall bitsandbytes-windows

4 J:\StableDiffusion\sdwebui\py310\python.exe -m pip install https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.1-py3-none-win_amd64.whl

Replace your SD venv directory file(python.exe Folder) here(J:\StableDiffusion\sdwebui\py310)