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
{{ message }}
Repository navigation
get_gaudi_sw_version() hangs indefinitely on Windows — module-level subprocess.run with shell pipe to grep #2041
grep does not exist. cmd.exe still spawns pip list, whose output is piped nowhere.
No timeout= argument, so the call can block forever.
It runs at import time, freezing the entire host process with no traceback.
faulthandler dump of the hung thread:
File "threading.py", line 1169 in _wait_for_tstate_lock
File "threading.py", line 1149 in join
File "subprocess.py", line 1628 in _communicate
File "subprocess.py", line 1209 in communicate
File "subprocess.py", line 550 in run
File "bitsandbytes/backends/utils.py", line 71 in get_gaudi_sw_version
File "bitsandbytes/backends/utils.py", line 84 in <module>
File "bitsandbytes/backends/default/ops.py", line 9 in <module>
File "bitsandbytes/__init__.py", line 19 in <module>
Impact: silent, intermittent startup freeze of ComfyUI. No exception, no log
output, no traceback. Isolating this took several hours.
Expected behavior
Importing bitsandbytes should never block. Detecting optional Habana/Gaudi
software should not shell out at import time, and should fail fast when the
hardware is absent.
Suggested fix — query package metadata instead of spawning a shell. Same
result, no subprocess, cross-platform:
def get_gaudi_sw_version():
from importlib.metadata import PackageNotFoundError, version as _pkg_version
try:
return version.parse(_pkg_version("habana-torch-plugin"))
except PackageNotFoundError:
return None
I have this patch running locally and it resolves the hang (5/5 clean starts,
previously ~50% failure rate). Happy to open a PR.
Activity
matthewdouglas commentedon Aug 17, 2026
Hi,
This should have been resolved with #1910 and is included in bitsandbytes>=0.50.0. Please try with the latest release.