- Build yourself a chatbot. Don't become part of a botnet. 🤗
- In the very least, you should upload any wheels or dll files to online malware scanners, such as www.virustotal.com/gui/home/upload.
- Now you trust me? Because I pointed you towards malware scanners? I could have engineered my malware just to avoid detection on what I advertised above. Don't trust me! 🤥
- Or you may just have a different Python or CUDA version, and the files here are not compatible anyway. Good, let's continue:
Download and install:
- Microsoft Visual Studio visualstudio.microsoft.com/downloads/
- In MS Visual Studio installer, select "Desktop development with C++"
- CMake: cmake.org/download/
- CUDA Toolkit: developer.nvidia.com/cuda-downloads
- In CUDA Toolkit installer, select 'with Visual Studio integration'.
Then, very important Windows absurdity (else compiling will fail!):
- Go to
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\extras\visual_studio_integration\MSBuildExtensions
- Copy what you find there (~4 files including a
Nvda.Build.CudaTasks.v12.6.dll
) to: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v170\BuildCustomizations
- Replace
v12.6
orv170
with whatever version you have, the above are just example default paths.
Finally:
- bitsandbytes:
git clone https://github.com/bitsandbytes-foundation/bitsandbytes.git
- cd bitsandbytes
Then:
pip install -r requirements-dev.txt
cmake -DCOMPUTE_BACKEND=cuda -S .
cmake --build . --config Release
pip install .
If something fails, perhaps entering this will fix it (make sure the path is correct):
set DCMAKE_GENERATOR_TOOLSET="cuda=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6"
[Enter], then retry the above.
After waiting around a bit, you should now find there's a compiled bitsandbytes/libbitsandbytes_cuda126.dll
! Yay! Now you can make a neat tidy wheel you can keep safe, together with the .dll, to install without compiling everything again:
python setup.py bdist_wheel
Now there should be a `dist/bitsandbytes-0.45.1.dev0-cp310-cp310-win_amd64.whl' file.
- cd dist
- pip install bitsandbytes-0.45.1.dev0-cp310-cp310-win_amd64.whl
- Should result in:
Successfully installed bitsandbytes-0.45.1.dev0
- Check
<your-python-install>/site-packages/bitsandbytes
and copy the.dll
there, if needed.
Final note: Fortunately, bitsandbytes README.MD says: Windows support is quite far along and is on its way as well
. So here's to hoping this repo will soon be obsolete. 🤗