Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Prebuilt XPU wheel links libsycl.so.8; fails to load on oneAPI 2026 (libsycl.so.9) #1991

Description

@jiqing-feng

Summary

The prebuilt libbitsandbytes_xpu.so shipped in the wheel is linked against
libsycl.so.8 (oneAPI 2025.x). On oneAPI 2026 — which ships only
libsycl.so.9, and which the current XPU PyTorch nightlies are built against —
the native library fails to dlopen. bitsandbytes then silently falls back to
the mock library, so any native-only call (e.g. lib.cget_managed_ptr, used by
paged optimizers) raises RuntimeError.

Environment

  • bitsandbytes: 0.50.0.dev0 (prebuilt XPU wheel)
  • PyTorch: 2.13.0.dev20260526+xpu
  • oneAPI: 2026.0 (provides libsycl.so.9 only)
  • GPU: Intel Data Center GPU Max 1550 (PVC)
  • OS: Ubuntu 24.04, Python 3.12

Root cause

The wheel's XPU binary has a hard NEEDED libsycl.so.8:

$ ldd /opt/venv/lib/python3.12/site-packages/bitsandbytes/libbitsandbytes_xpu.so | grep sycl
        libsycl.so.8 => not found

But the environment (oneAPI 2026 + torch 2.13+xpu) only provides libsycl.so.9:

$ find /opt/intel /opt/venv -name 'libsycl.so*'
/opt/intel/oneapi/2026.0/lib/libsycl.so.9
/opt/venv/lib/libsycl.so.9
...

$ ldd .../torch/lib/libtorch_xpu.so | grep sycl
        libsycl.so.9 => .../libsycl.so.9

Reproduction

repro_bnb_xpu_sycl.py:

import bitsandbytes as bnb
import bitsandbytes.cextension as ce

print(f"bitsandbytes : {bnb.__version__} ({bnb.__file__})")
print(f"backend      : {ce.BNB_BACKEND}")
print(f"loaded lib   : {type(ce.lib).__name__}")

# bitsandbytes catches the real load error for XPU/CPU and replaces `lib`
# with a mock (ErrorHandlerMockBNBNativeLibrary). Re-run its own loader to
# surface the actual reason the native library could not be loaded.
print("\n--- bitsandbytes.cextension.get_native_library() ---")
try:
    ce.get_native_library()
    print("native library loaded OK")
except Exception as e:
    print(f"{type(e).__name__}: {e}")

Output:

$ python repro_bnb_xpu_sycl.py
bitsandbytes : 0.50.0.dev0 (/opt/venv/lib/python3.12/site-packages/bitsandbytes/__init__.py)
backend      : XPU
loaded lib   : ErrorHandlerMockBNBNativeLibrary

--- bitsandbytes.cextension.get_native_library() ---
OSError: libsycl.so.8: cannot open shared object file: No such file or directory

Impact

Because the native library never loads, lib is the mock, and native-only
functionality fails. For example, running a paged optimizer test:

RuntimeError: Attempted to use bitsandbytes native library functionality but it's not available.
...
Native code method attempted to call: lib.cget_managed_ptr()

Request

Please rebuild/ship the XPU wheel against SYCL 9 / oneAPI 2026, so
libbitsandbytes_xpu.so loads with current XPU PyTorch builds. Building from
source with the 2026 toolchain produces a .so linked to libsycl.so.9 and
resolves the issue locally, but the published wheel is still SYCL 8.

Metadata

Metadata

Type

Fields

No fields configured for Task.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions