SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

How to fix bitsandbytes to CUDA12.8 on Forge

On June 18, 2025, the latest version of bitsandbytes was updated to 0.46.0, and since triton-windows now supports the latest bitsandbytes, I have updated the description.

I launched Forge for the first time in a while while conducting speed verification tests related to xformers for the article below,

and as is often the case, an unfamiliar warning had appeared out of nowhere... bitsandbytes again... give me a break.

WARNING:bitsandbytes.cextension:Could not find the bitsandbytes CUDA binary at WindowsPath('D:/USERFILES/forge/venv/Lib/site-packages/bitsandbytes/libbitsandbytes_cuda126.dll')
WARNING:bitsandbytes.cextension:The installed version of bitsandbytes was compiled without GPU support. 8-bit optimizers, 8-bit multiplication, and GPU quantization are unavailable.

The response from Cursor-sensei is as follows.

These warnings mean the following:

  1. bitsandbytes (a machine learning optimization library) cannot find the CUDA binary files.

  1. Because the installed version of bitsandbytes was compiled without GPU support, the following features cannot be used:

  • 8-bit optimization

  • 8-bit multiplication

  • GPU quantization

To resolve this issue:

  1. Verify that the CUDA Toolkit is correctly installed

  1. Reinstall bitsandbytes:

  1. If you do not specifically need to use the GPU, it is fine to ignore these warnings. It will run in CPU mode.

...

No, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, wait a minute, that is a huge problem.

In a CUDA-based environment,running in CPU mode is synonymous with being extremely slowafter all.

I am aware of this myself without needing to check via command, but I have the latest CUDA 12.8 installed.(I have also manually updated the CUDA built into PyTorch to 12.8)

The required version of bitsandbytes is >0.45.3 as follows.

However, a problem occurred here.

I was able to update it normally using pip install, but when I launch Forge, it automatically reverts to 0.43.3.

At first, I thought it was "that thing" again, but there is no definition for bitsandbytes there.

I had Cursor re-investigate, and it turns out the definition is in /forge/modules_forge/bnb_installer.py.

Sure enough, it was hardcoded to 0.43.3, so I changed it to force the application of 0.46.0.

With this, as shown in the image below, 0.46.0, which supports CUDA 12.8,(The image below shows 0.45.3, but the current latest is 0.46.0) is applied, and the warning has disappeared.

I've been exclusively using ComfyUI lately and haven't touched Forge in a while, but since I constantly update CUDA and CuDNN, these kinds of things are common.

Furthermore, this update to bitsandbytes causes another issue.

In this state,to use xformers in Forge, unlike A1111, triton-windows is naturally required, and that triton-windows needs to be the latest version, 3.3.1.post19.

However, as I mentioned at the end of the article below, for Forge-based systems, I conducted a speed comparison test between xformers and Cross-Attention and found almost no difference, so I think it's fine to stick with Cross-Attention for Forge-based systems, just as I have explained in my previous installation methods.


いいなと思ったら応援しよう!