File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ def to_be_ignored(env_var: str, value: str) -> bool:
25
25
26
26
27
27
def might_contain_a_path (candidate : str ) -> bool :
28
- return "/" in candidate
28
+ return os . sep in candidate
29
29
30
30
31
31
def is_active_conda_env (env_var : str ) -> bool :
Original file line number Diff line number Diff line change 19
19
import ctypes as ct
20
20
import os
21
21
import errno
22
+ import platform
22
23
import torch
23
24
from warnings import warn
24
25
from itertools import product
31
32
# libcudart.so is missing by default for a conda install with PyTorch 2.0 and instead
32
33
# we have libcudart.so.11.0 which causes a lot of errors before
33
34
# not sure if libcudart.so.12.0 exists in pytorch installs, but it does not hurt
34
- CUDA_RUNTIME_LIBS : list = ["libcudart.so" , 'libcudart.so.11.0' , 'libcudart.so.12.0' ]
35
+ system = platform .system ()
36
+ if system == 'Darwin' :
37
+ CUDA_RUNTIME_LIBS : list = ["libcuda.dylib" , '/usr/local/cuda/lib/libcuda.dylib' ]
38
+ elif system == 'Windows' :
39
+ CUDA_RUNTIME_LIBS : list = ["nvcuda.dll" ]
40
+ else : # Linux or other
41
+ CUDA_RUNTIME_LIBS : list = ["libcudart.so" , 'libcudart.so.11.0' , 'libcudart.so.12.0' ]
35
42
36
43
# this is a order list of backup paths to search CUDA in, if it cannot be found in the main environmental paths
37
44
backup_paths = []
@@ -194,7 +201,7 @@ def is_cublasLt_compatible(cc):
194
201
return has_cublaslt
195
202
196
203
def extract_candidate_paths (paths_list_candidate : str ) -> Set [Path ]:
197
- return {Path (ld_path ) for ld_path in paths_list_candidate .split (":" ) if ld_path }
204
+ return {Path (ld_path ) for ld_path in paths_list_candidate .split (";" if os . sep == " \\ " else " :" ) if ld_path }
198
205
199
206
200
207
def remove_non_existent_dirs (candidate_paths : Set [Path ]) -> Set [Path ]:
You can’t perform that action at this time.
0 commit comments