d8ahazard / sd_dreambooth_extension

Other
1.87k stars 283 forks source link

bitsandbytes with wsl (linux in general?) #1187

Closed stdkoehler closed 1 year ago

stdkoehler commented 1 year ago

I'm using Auto1111 with dreambooth extension on a WSL system with CUDA

On training I always received "NameError: name 'str2optimizer8bit_blockwise' is not defined" from the bitsandbytes package For some reason with WSL (or linux in general?) it seems to require pip install bitsandbytes-cuda117 after uninstalling regular bitsandbytes (https://www.reddit.com/r/StableDiffusion/comments/118e8gi/nameerror_name_str2optimizer8bit_blockwise_is_not/)

To avoid reinstalling bitsandbytes automatically I needed to remove it from dreambooth_extension's requirements.txt Now training works again for me, but upon starting the following error pops up

stderr: Traceback (most recent call last):
  File "/home/skoehler/workspace/python/ai_art/stable-diffusion/stable-diffusion-webui-310/extensions/sd_dreambooth_extension/install.py", line 35, in <module>
    actual_install()
  File "/home/skoehler/workspace/python/ai_art/stable-diffusion/stable-diffusion-webui-310/extensions/sd_dreambooth_extension/postinstall.py", line 47, in actual_install
    check_versions()
  File "/home/skoehler/workspace/python/ai_art/stable-diffusion/stable-diffusion-webui-310/extensions/sd_dreambooth_extension/postinstall.py", line 161, in check_versions
    installed_ver = importlib_metadata.version(module) if has_module else None
  File "/home/skoehler/anaconda3/envs/py10/lib/python3.10/importlib/metadata/__init__.py", line 996, in version
    return distribution(distribution_name).version
  File "/home/skoehler/anaconda3/envs/py10/lib/python3.10/importlib/metadata/__init__.py", line 969, in distribution
    return Distribution.from_name(distribution_name)
  File "/home/skoehler/anaconda3/envs/py10/lib/python3.10/importlib/metadata/__init__.py", line 548, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for bitsandbytes

The error doesn't hurt though. Everything seems to work now with the hack and pip install bitsandbytes-cuda117

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days

stdkoehler commented 1 year ago

farmer bobby from the discord told me, that he overcame the issue by compiling bitsandbytes from source as described in https://github.com/TimDettmers/bitsandbytes

I post this here for later reference. I will try that out as soon as I got some time and give an update here.