Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
bitsandbytes
Commits
79d1cccc
Commit
79d1cccc
authored
Mar 13, 2024
by
Aarni Koskela
Browse files
Improve filtering for values that are surely not paths
parent
6a5a18a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
bitsandbytes/diagnostics/cuda.py
bitsandbytes/diagnostics/cuda.py
+11
-4
No files found.
bitsandbytes/diagnostics/cuda.py
View file @
79d1cccc
...
@@ -45,11 +45,16 @@ def find_cuda_libraries_in_path_list(paths_list_candidate: str) -> Iterable[Path
...
@@ -45,11 +45,16 @@ def find_cuda_libraries_in_path_list(paths_list_candidate: str) -> Iterable[Path
for
dir_string
in
paths_list_candidate
.
split
(
os
.
pathsep
):
for
dir_string
in
paths_list_candidate
.
split
(
os
.
pathsep
):
if
not
dir_string
:
if
not
dir_string
:
continue
continue
if
os
.
sep
not
in
dir_string
:
continue
try
:
try
:
dir
=
Path
(
dir_string
)
dir
=
Path
(
dir_string
)
if
not
dir
.
exists
():
try
:
logger
.
warning
(
f
"The directory listed in your path is found to be non-existent:
{
dir
}
"
)
if
not
dir
.
exists
():
continue
logger
.
warning
(
f
"The directory listed in your path is found to be non-existent:
{
dir
}
"
)
continue
except
OSError
:
# Assume an esoteric error trying to poke at the directory
pass
for
lib_pattern
in
CUDA_RUNTIME_LIB_PATTERNS
:
for
lib_pattern
in
CUDA_RUNTIME_LIB_PATTERNS
:
for
pth
in
dir
.
glob
(
lib_pattern
):
for
pth
in
dir
.
glob
(
lib_pattern
):
if
pth
.
is_file
():
if
pth
.
is_file
():
...
@@ -63,8 +68,10 @@ def is_relevant_candidate_env_var(env_var: str, value: str) -> bool:
...
@@ -63,8 +68,10 @@ def is_relevant_candidate_env_var(env_var: str, value: str) -> bool:
env_var
in
CUDART_PATH_PREFERRED_ENVVARS
# is a preferred location
env_var
in
CUDART_PATH_PREFERRED_ENVVARS
# is a preferred location
or
(
or
(
os
.
sep
in
value
# might contain a path
os
.
sep
in
value
# might contain a path
and
"CONDA"
not
in
env_var
# not another conda envvar
and
env_var
not
in
CUDART_PATH_IGNORED_ENVVARS
# not ignored
and
env_var
not
in
CUDART_PATH_IGNORED_ENVVARS
# not ignored
and
"CONDA"
not
in
env_var
# not another conda envvar
and
"BASH_FUNC"
not
in
env_var
# not a bash function defined via envvar
and
"
\n
"
not
in
value
# likely e.g. a script or something?
)
)
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment