Skip to content

Commit f499697

Browse files
committed
Added missing check if LD_LIBRARY_PATH exists. #588
1 parent 6ec4f0c commit f499697

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

bitsandbytes/__main__.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,16 @@ def generate_bug_report_information():
6363
print('')
6464

6565
print_header("LD_LIBRARY CUDA PATHS")
66-
lib_path = os.environ['LD_LIBRARY_PATH'].strip()
67-
for path in set(lib_path.split(':')):
68-
try:
69-
if isdir(path):
70-
print_header(f"{path} CUDA PATHS")
71-
paths = find_file_recursive(path, '*cuda*so')
72-
print(paths)
73-
except:
74-
print(f'Could not read LD_LIBRARY_PATH: {path}')
66+
if 'LD_LIBRARY_PATH' in os.environ:
67+
lib_path = os.environ['LD_LIBRARY_PATH'].strip()
68+
for path in set(lib_path.split(':')):
69+
try:
70+
if isdir(path):
71+
print_header(f"{path} CUDA PATHS")
72+
paths = find_file_recursive(path, '*cuda*so')
73+
print(paths)
74+
except:
75+
print(f'Could not read LD_LIBRARY_PATH: {path}')
7576
print('')
7677

7778

0 commit comments

Comments
 (0)