You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/errors.mdx
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,3 +20,36 @@ Make sure this path is appended to the `LD_LIBRARY_PATH` so bnb can find the CUD
20
20
If this does not fix the issue, please try compilation from source next.
21
21
22
22
If this does not work, please open an issue and paste the printed environment if you call `make` and the associated error when running bnb.
23
+
24
+
## Library not found: version mismatch
25
+
26
+
If you see an error like `Library not found: libbitsandbytes_cuda128.dll` or `libbitsandbytes_rocm72.so`, it means the pre-compiled library version doesn't match the CUDA/ROCm version reported by your PyTorch installation.
27
+
28
+
The library filename encodes the version: `libbitsandbytes_cuda{major}{minor}` for CUDA, `libbitsandbytes_rocm{major}{minor}` for ROCm. bitsandbytes picks which one to load based on what PyTorch reports:
29
+
30
+
```python
31
+
import torch
32
+
print(torch.version.cuda) # e.g. "12.8" -> looks for libbitsandbytes_cuda128
33
+
print(torch.version.hip) # e.g. "7.2" -> looks for libbitsandbytes_rocm72
34
+
```
35
+
36
+
This commonly happens when your PyTorch was compiled against a different CUDA/ROCm version than what you have installed on your system. For example, PyTorch built with ROCm 7.2 reports `torch.version.hip = "7.2"` and bitsandbytes looks for `libbitsandbytes_rocm72`, even if your system has a different ROCm version installed.
37
+
38
+
To resolve this:
39
+
40
+
1.**Install a matching PyTorch version** that aligns with the pre-compiled libraries shipped in the bitsandbytes wheel.
41
+
2.**Override the version at runtime** with an environment variable so bitsandbytes loads a different library:
42
+
```bash
43
+
# Linux / macOS
44
+
export BNB_CUDA_VERSION=128 # or BNB_ROCM_VERSION=72
45
+
46
+
# Windows (cmd)
47
+
set BNB_CUDA_VERSION=128
48
+
```
49
+
3.**Compile from source** to produce a library matching your exact toolkit version. For ROCm, you can override the library name with `-DROCM_VERSION`:
For CUDA, the version is detected automatically from the CUDA compiler on your PATH and cannot be overridden -- make sure the correct CUDA Toolkit is first on your PATH.
54
+
55
+
See the [installation guide](installation) for full compile-from-source instructions.
Copy file name to clipboardExpand all lines: docs/source/installation.mdx
+43-5Lines changed: 43 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,7 +187,10 @@ pip install -e .
187
187
188
188
* Support for AMD GPUs is currently in a preview state.
189
189
* All features are supported for both consumer RDNA devices and Data Center CDNA products.
190
-
* A compatible PyTorch version with AMD ROCm support is required. It is recommended to use the latest stable release. See [PyTorch on ROCm](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/3rd-party/pytorch-install.html) for guidance.
190
+
* A compatible PyTorch version with AMD ROCm support is required. It is recommended to use the latest stable release. On Linux, see [PyTorch on ROCm](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/3rd-party/pytorch-install.html) for guidance. On Windows, ROCm-enabled PyTorch wheels are available from:
191
+
-[repo.radeon.com/rocm/windows/](https://repo.radeon.com/rocm/windows/) — official AMD releases
bitsandbytes can be compiled from ROCm 6.2 - ROCm 7.2.1.
219
+
bitsandbytes can be compiled from ROCm 6.2 - ROCm 7.2.1. See the `CMakeLists.txt` for additional options.
220
+
221
+
<hfoptionsid="rocm-source">
222
+
<hfoptionid="Linux">
218
223
219
-
To compile from source, you need CMake >= **3.31.6**.
224
+
To compile from source, you need CMake >= **3.31.6** and Python >= **3.10** installed. Make sure you have a compiler installed to compile C++ (`gcc`, `make`, headers, etc.).
225
+
226
+
You should also have a ROCm installation (system-wide or via Docker). The current minimum supported version is **6.2**.
pip install -e .# `-e` for "editable" install, when developing BNB (otherwise leave that out)
231
239
```
232
240
241
+
</hfoption>
242
+
<hfoptionid="Windows">
243
+
244
+
Compilation on Windows requires Visual Studio with C++ support, CMake, Ninja, and Python >= **3.10**.
245
+
246
+
Instead of a system-wide ROCm installation, you can use the pip-installable ROCm SDK wheels from [repo.radeon.com](https://repo.radeon.com/rocm/windows/):
247
+
248
+
```bash
249
+
# Install ROCm SDK wheels (adjust version as needed)
If you would like to use new features even before they are officially released and help us test them, feel free to install the wheel directly from our CI (*the wheel links will remain stable!*):
0 commit comments