bmaltais / kohya_ss

Apache License 2.0
9.54k stars 1.23k forks source link

bitandbytes #1918

Closed dolitg closed 5 months ago

dolitg commented 8 months ago

Cannot run kohya_ss :(

The runtime error message suggests that there is an issue with the bitsandbytes library and its dependencies, particularly the bitsandbytes.cuda_setup.paths module, which cannot be found.

echo %CUDA_HOME% C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3

Any help will be greatly appreciated.

bmaltais commented 8 months ago

Try installing the bitsandbytes optional version:

image

dolitg commented 8 months ago

I chose option number 2 as package 0.41.1 was already installed , option 2 worked for my case. Thanks again !

On Thu, Feb 1, 2024 at 12:58 PM Dolit Gliksman @.***> wrote:

Thanks for your reply , I appreciate it !! The initial process is installing the bitandbytes you are suggesting to force installing by choosing option 3. I have been working on that for a few days now , with no luck :) I really hope I will be able to finally run it.

Enter your choice: 1

12:47:38-258511 INFO Version: v22.6.0

12:47:38-263500 INFO Python 3.10.9 on Windows 12:47:38-272476 INFO Installing modules from requirements_windows_torch2.txt... 12:47:38-278467 INFO Installing package: torch==2.1.2+cu118 torchvision==0.16.2+cu118 torchaudio==2.1.2+cu118 --index-url https://download.pytorch.org/whl/cu118 12:52:05-020755 INFO Installing package: xformers==0.0.23.post1+cu118 --index-url https://download.pytorch.org/whl/cu118 12:52:16-361425 INFO Installing package: bitsandbytes==0.41.1 12:52:19-462499 INFO Installing package: tensorboard==2.14.1 tensorflow==2.14.0 12:53:33-227279 INFO Installing modules from requirements.txt... 12:53:33-233262 INFO Installing package: accelerate==0.25.0 12:53:39-279346 INFO Installing package: aiofiles==23.2.1 12:53:40-773400 INFO Installing package: altair==4.2.2 12:54:04-328785 INFO Installing package: dadaptation==3.1 12:54:06-065077 INFO Installing package: diffusers[torch]==0.25.0 12:54:12-443210 INFO Installing package: easygui==0.98.3 12:54:14-269177 INFO Installing package: einops==0.6.1 12:54:15-841861 INFO Installing package: fairscale==0.4.13 12:54:18-427158 INFO Installing package: ftfy==6.1.1 12:54:20-171379 INFO Installing package: gradio==3.36.1

On Thu, Feb 1, 2024 at 11:12 AM bmaltais @.***> wrote:

Try installing the bitsandbytes optional version:

image.png (view on web) https://github.com/bmaltais/kohya_ss/assets/7474674/e47f0301-89bf-4d4f-88ed-bcfa675775f8

— Reply to this email directly, view it on GitHub https://github.com/bmaltais/kohya_ss/issues/1918#issuecomment-1920229582, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASWXYRGEL22SXSPYQNXP5KLYRLMXHAVCNFSM6AAAAABCSSBNQKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRQGIZDSNJYGI . You are receiving this because you authored the thread.Message ID: @.***>

MortalSage commented 8 months ago

I updated to the latest version today, the torch version change did not work to well tho. When launching kohya, it noticed the version was to old but failed updating. Nevermind, got it working by manually installing requirements using pip install. Afterwards bitsandbytes was the issue, it wanted to get cuda files, but couldn't find them in my cuda 12.1 toolkit. Found a fix in an older post, which was to download and install a pre-compiled bitsandbytes.

This one worked for me, it is the currently used version as wel:

https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.1-py3-none-win_amd64.whl

I called activate.bat in venv, used pip uninstall bitsandbytes and pip install this file instead, now works without issues.

bmaltais commented 8 months ago

Yeah… the current setup of the gui expect the 11.8 toolkit… there is no easy way of making this work for everyone I am afraid.

MrDaisyBates commented 7 months ago

Try installing the bitsandbytes optional version:

image

If I'm on Linux (manjaro), how would I go about running this optional set? I've never seen it in the setup.sh. I haven't tried this solution yet. I'm curious to try it because when I run "python -m bitsandbites" in a terminal inside my Kohya directory, it seems to not find my cuda stuff so it won't train, but when I run the same command in a normal terminal, lots of cudapaths show up. I'm also running 12.3 like the original poster. Is that an issue?

MortalSage commented 7 months ago

The main issue is, that bitsandbytes needs to compile a cuda wheel on the first run. The kohya code (maybe it's bitsandbytes code?) searches for a 11.8 cuda toolkit for that, and if that is not installed the compile will fail. You can either install the 11.8 toolkit or get a version that is already compiled.

I found one here, dunno about linux tho, sorry. https://github.com/jllllll/bitsandbytes-windows-webui/releases

MrDaisyBates commented 7 months ago

Thanks so much for the time to reply! I will look into this!

On Sat, 2024-03-09 at 11:46 -0800, MortalSage wrote:

The main issue is, that bitsandbytes needs to compile a cuda wheel on the first run. The kohya code (maybe it's bitsandbytes code?) searches for a 11.8 cuda toolkit for that, and if that is not installed the compile will fail. You can either install the 11.8 toolkit or get a version that is already compiled. I found one here, dunno about linux tho, sorry. https://github.com/jllllll/bitsandbytes-windows-webui/releases — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>