Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check LD_LIBRARY_PATH on setup #580

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion bitsandbytes/cuda_setup/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,19 @@ def run_cuda_setup(self):
package_dir = Path(__file__).parent.parent
binary_path = package_dir / binary_name

print('bin', binary_path)
if not binary_path.exists():
# If binary file does not exist, check LD_LIBRARY_PATH
library_paths = os.getenv("LD_LIBRARY_PATH", "").split(":")
print("library_paths ", library_paths)
for path in library_paths:
potential_binary_path = Path(path) / binary_name
print("potential_binary_path", potential_binary_path)
if potential_binary_path.exists():
binary_path = potential_binary_path
print("binary_path", binary_path)
break

print("bin", binary_path)

try:
if not binary_path.exists():
Expand Down