Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUDA Setup failed despite GPU being available #858

Closed
allyyc opened this issue Nov 8, 2023 · 19 comments
Closed

CUDA Setup failed despite GPU being available #858

allyyc opened this issue Nov 8, 2023 · 19 comments

Comments

@allyyc
Copy link

allyyc commented Nov 8, 2023

===================================BUG REPORT===================================
Welcome to bitsandbytes. For bug reports, please run

python -m bitsandbytes

and submit this information together with your error trace to: https:/TimDettmers/bitsandbytes/issues

bin /lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cuda113.so
False
/lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/python3.10/site-packages/bitsandbytes/cuda_setup/main.py:149: UserWarning: Found duplicate ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] files: {PosixPath('/lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/libcudart.so.11.0'), PosixPath('/lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/libcudart.so')}.. We'll flip a coin and try one of these, in order to fail forward.
Either way, this might cause trouble in the future:
If you get CUDA error: invalid device function errors, the above might be the cause and the solution is to make sure only one ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] in the paths that we search based on your env.
warn(msg)
CUDA SETUP: CUDA runtime path found: /lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/libcudart.so.11.0
CUDA SETUP: Highest compute capability among GPUs detected: 7.5
CUDA SETUP: Detected CUDA version 113
CUDA SETUP: Required library version not found: libbitsandbytes_cuda113.so. Maybe you need to compile it from source?
CUDA SETUP: Defaulting to libbitsandbytes_cpu.so...

================================================ERROR=====================================
CUDA SETUP: CUDA detection failed! Possible reasons:

  1. CUDA driver not installed
  2. CUDA not installed
  3. You have multiple conflicting CUDA libraries
  4. Required library not pre-compiled for this bitsandbytes release!
    CUDA SETUP: If you compiled from source, try again with make CUDA_VERSION=DETECTED_CUDA_VERSION for example, make CUDA_VERSION=113.
    CUDA SETUP: The CUDA version for the compile might depend on your conda install. Inspect CUDA version via conda list | grep cuda.
    ================================================================================

CUDA SETUP: Something unexpected happened. Please compile from source:
git clone [email protected]:TimDettmers/bitsandbytes.git
cd bitsandbytes
CUDA_VERSION=113 make cuda11x
python setup.py install
CUDA SETUP: Setup Failed!
Traceback (most recent call last):
File "/lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/python3.10/runpy.py", line 187, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/python3.10/runpy.py", line 146, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/python3.10/runpy.py", line 110, in _get_module_details
import(pkg_name)
File "/lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/python3.10/site-packages/bitsandbytes/init.py", line 6, in
from . import cuda_setup, utils, research
File "/lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/python3.10/site-packages/bitsandbytes/research/init.py", line 1, in
from . import nn
File "/lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/python3.10/site-packages/bitsandbytes/research/nn/init.py", line 1, in
from .modules import LinearFP8Mixed, LinearFP8Global
File "/lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/python3.10/site-packages/bitsandbytes/research/nn/modules.py", line 8, in
from bitsandbytes.optim import GlobalOptimManager
File "/lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/python3.10/site-packages/bitsandbytes/optim/init.py", line 6, in
from bitsandbytes.cextension import COMPILED_WITH_CUDA
File "/lfs/hyperturing1/0/allyc/miniconda/envs/cs197/lib/python3.10/site-packages/bitsandbytes/cextension.py", line 20, in
raise RuntimeError('''
RuntimeError:
CUDA Setup failed despite GPU being available. Please run the following command to get more information:

    python -m bitsandbytes

    Inspect the output of the command and see if you can locate CUDA libraries. You might need to add them
    to your LD_LIBRARY_PATH. If you suspect a bug, please take the information from python -m bitsandbytes
    and open an issue at: https:/TimDettmers/bitsandbytes/issues
@swumagic
Copy link

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:/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)

@swumagic
Copy link

OR you are Linux distribution (Ubuntu, MacOS, etc.)system ,AND CUDA Version: 11.X.

Bitsandbytes can support ubuntu.(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:/TimDettmers/bitsandbytes/releases/download/0.41.0/bitsandbytes-0.41.0-py3-none-any.whl

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

@Delios11
Copy link

After a windows update this error appears when launching SD automatic 1111.
I am not a programmer and I don't know how to fix it. Please help me. How to fix this error?
Error Launch

@Battlebands
Copy link

Same problem from the coment above

@IIIWHKIII
Copy link

  1. Open cmd, run this: python.exe -m pip install bitsandbytes-windows

  2. go to C:\Users\Me\AppData\Local\Programs\Python\Python310\Lib\site-packages

or wherever you have installed Python 3.10 idk.

copy bitsandbytes folder.

  1. paste and replace in your "\venv\Lib\site-packages"

for me is C:\stable-diffusion-webui\venv\Lib\site-packages.

now it works.

@Delios11
Copy link

Hi, @IIIWHKIII , I have done what you said, and it still gives error, I am not a programmer, and this problem is driving me crazy. Before an automatic update of windows it worked perfectly. windows 10 OS Help please!!!
Error Launch2 SD

@Delios11
Copy link

Delios11 commented Nov 18, 2023

@swumagic

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:/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)

Please, I don't understand the instructions, the path where I have SD installed is C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui, but there is no py310 nor python.exe, these appear in another location C:\Usersuario\AppData\Local\Programs\Python\Python310
When I try from the CMD to follow the steps you show it does not find the specified path.
I downloaded the bitsandbytes-041.1-py3-none-win_amd64.whl file but have no idea where to put it or how to run it. Please could you explain me how to fix it. Many thanks for your help.

My SD is a version with launcher

@IIIWHKIII
Copy link

IIIWHKIII commented Nov 18, 2023

@Delios11 try this.

  1. Delete venv folder in your stable-diffusion-webui folder.

  2. Launch Stable diffusion.

  3. Wait till it re-download all venv folder again.

  4. it will give you the same error message.

  5. Open CMD. type and run: python.exe -m pip install bitsandbytes

  6. In your case it will be something like this: "C:\Users\Usersuario>python.exe -m pip install bitsandbytes"

  7. Now, type and run: python.exe -m pip install bitsandbytes-windows

  8. go to C:\Usersuario\AppData\Local\Programs\Python\Python310\Lib\site-packages

  9. copy these folders: bitsandbytes, bitsandbytes_windows-0.37.5.dist-info, bitsandbytes-0.41.2.post2.dist-info.

  10. Paste and replace in: stable-diffusion-webui\venv\Lib\site-packages

  11. in your case it will be: C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Lib\site-packages.

@swumagic
Copy link

@swumagic

Bitsandbytes之前不支持windows,但是我的方法可以支持windows。(yu Huang) 1 打开文件夹 J:\StableDiffusion\sdwebui,点击该文件夹地址栏输入 CMD 或 WIN+R, CMD 。回车,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:/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.1-py3-none-win_amd64 .whl
将你的SD venv目录文件(python.exe文件夹)替换在这里(J:\StableDiffusion\sdwebui\py310)

请,我不明白说明,我安装 SD 的路径是 C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui,但是没有 py310 也没有 python.exe,这些出现在另一个位置 C: \Usersuario\AppData\Local\Programs\Python\Python310 当我尝试从 CMD 执行您显示的步骤时,它找不到指定的路径。 我下载了 bitsandbytes-041.1-py3-none-win_amd64.whl 文件,但不知道将其放在哪里或如何运行它。请您解释一下如何解决它。非常感谢您的帮助。

我的SD是带启动器的版本

Bitsandbytes supported windows (yuhuang)
Replace your SD venv directory file C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts(python.exe Folder) here(J:\StableDiffusion\sdwebui\py310)

1 open folder C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui,Click the address bar of the folder and enter CMD

or WIN+R,enter, CMD , enter,cd /d C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui

2 enter,C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip uninstall bitsandbytes

3 enter, C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip uninstall bitsandbytes-windows

4 enter,C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip install https:/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.1-py3-none-win_amd64.whl

is ok?

@swumagic
Copy link

Bitsandbytes 支持的 windows (yu Huang) 将你的 SD venv 目录文件替换为 C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts(python.exe 文件夹)这里(J:\StableDiffusion\sdwebui\py310)

1 打开文件夹C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui,点击文件夹地址栏输入CMD

或 WIN+R,输入, CMD ,输入,cd /d C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui

2 输入,C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip uninstall bitsandbytes

3 输入, C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip uninstall bitsandbytes-windows

4 输入,C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip install https:/jllllll/bitsandbytes-windows-webui/releases/download/wheels /bitsandbytes-0.41.1-py3-none-win_amd64.whl

可以吗
Bitsandbytes 支持的 windows (yu Huang)
将你的 SD venv 目录文件替换为 C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts(python.exe 文件夹)这里(J:\StableDiffusion\sdwebui\py310)

1 打开文件夹C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui,点击文件夹地址栏输入CMD

或 WIN+R,输入, CMD ,输入,cd /d C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui

2 输入,C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip uninstall bitsandbytes

3 输入, C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip uninstall bitsandbytes-windows

4 输入,C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip install https:/jllllll/bitsandbytes-windows-webui/releases/download/wheels /bitsandbytes-0.41.1-py3-none-win_amd64.whl

可以吗

@Battlebands
Copy link

what i have to do was drastically, i erease all my SD and reinstalled everything, python, SD and when i mean i erease everything its everything not the image though, i did find a solution after 4 days of looking.

@Delios11
Copy link

@Delios11 try this.

  1. Delete venv folder in your stable-diffusion-webui folder.
  2. Launch Stable diffusion.
  3. Wait till it re-download all venv folder again.
  4. it will give you the same error message.
  5. Open CMD. type and run: python.exe -m pip install bitsandbytes
  6. In your case it will be something like this: "C:\Users\Usersuario>python.exe -m pip install bitsandbytes"
  7. Now, type and run: python.exe -m pip install bitsandbytes-windows
  8. go to C:\Usersuario\AppData\Local\Programs\Python\Python310\Lib\site-packages
  9. copy these folders: bitsandbytes, bitsandbytes_windows-0.37.5.dist-info, bitsandbytes-0.41.2.post2.dist-info.
  10. Paste and replace in: stable-diffusion-webui\venv\Lib\site-packages
  11. in your case it will be: C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Lib\site-packages.

Hi @IIIWHKIII I have followed all the steps that you mark but it keeps giving the same error. What despair! Thank you very much for your answer, I don't know what's wrong, I loaded the venv folder and the bitsandbytes again, but after replacing them I still got the error.

@Delios11
Copy link

Bitsandbytes 支持的 windows (yu Huang) 将你的 SD venv 目录文件替换为 C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts(python.exe 文件夹)这里(J:\StableDiffusion\sdwebui\py310)
1 打开文件夹C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui,点击文件夹地址栏输入CMD
或 WIN+R,输入, CMD ,输入,cd /d C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui
2 输入,C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip uninstall bitsandbytes
3 输入, C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip uninstall bitsandbytes-windows
4 输入,C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip install https:/jllllll/bitsandbytes-windows-webui/releases/download/wheels /bitsandbytes-0.41.1-py3-none-win_amd64.whl
可以吗
Bitsandbytes 支持的 windows (yu Huang)
将你的 SD venv 目录文件替换为 C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts(python.exe 文件夹)这里(J:\StableDiffusion\sdwebui\py310)

1 打开文件夹C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui,点击文件夹地址栏输入CMD

或 WIN+R,输入, CMD ,输入,cd /d C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui

2 输入,C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip uninstall bitsandbytes

3 输入, C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip uninstall bitsandbytes-windows

4 输入,C:\Usersuario\Documents\SD_Auto1111\stable-diffusion-webui\venv\Scripts\python.exe -m pip install https:/jllllll/bitsandbytes-windows-webui/releases/download/wheels /bitsandbytes-0.41.1-py3-none-win_amd64.whl

可以吗

Hi @swumagic , I did what you describe, but it gave me this 404 link error in the console, however when I run the link from this git Hub page it does lead to the file download.
I noticed that in the link, after .../wheels / there is this space up to the /. I put the link back removing that space and executed but it gave me the error you can see in the image. How crazy!!!
Error 404_link

@swumagic
Copy link

你安装了VS 2022没?安装这个就可以编译

@Delios11
Copy link

Delios11 commented Nov 19, 2023

你安装了VS 2022没?安装这个就可以编译

Thanks so much, I have been able to start it, after uninstalling everything and reinstalling, but with some error at the beginning. Can the lora cause this error?

@nate235
Copy link

nate235 commented Nov 20, 2023

Still getting this error after trying the above steps and copy the files into stabdiff venv folder. Is there a fix coming for this? In so far as can I give up trying these work around and wait for the next release?

@carodin
Copy link

carodin commented Nov 20, 2023

  1. Open cmd, run this: python.exe -m pip install bitsandbytes-windows
  2. go to C:\Users\Me\AppData\Local\Programs\Python\Python310\Lib\site-packages

or wherever you have installed Python 3.10 idk.

copy bitsandbytes folder.

  1. paste and replace in your "\venv\Lib\site-packages"

for me is C:\stable-diffusion-webui\venv\Lib\site-packages.

now it works.

Thx this works for me :)

@wkpark
Copy link
Contributor

wkpark commented Dec 10, 2023

see also #876

Copy link

github-actions bot commented Jan 3, 2024

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants