@@ -56,10 +56,27 @@ def _import_get_cuda_path_or_home():
5656 ) from None
5757 import cuda
5858
59- site_cuda = str (dist .locate_file (Path ("cuda" )))
59+ locate_result = str (dist .locate_file (Path ("cuda" )))
60+ print (f"[diag] dist._path: { dist ._path } " , flush = True )
61+ print (f"[diag] dist._path.parent: { dist ._path .parent } " , flush = True )
62+ print (f"[diag] locate_file('cuda'): { locate_result } " , flush = True )
63+ print (f"[diag] locate_file exists: { os .path .isdir (locate_result )} " , flush = True )
64+ print (
65+ f"[diag] locate_file/pathfinder exists: { os .path .isdir (os .path .join (locate_result , 'pathfinder' ))} " ,
66+ flush = True ,
67+ )
68+ print (f"[diag] cuda.__path__ (before): { cuda .__path__ } " , flush = True )
69+ print ("[diag] sys.path:" , flush = True )
70+ for p in sys .path :
71+ sp_cuda = os .path .join (p , "cuda" )
72+ has_pf = os .path .isdir (os .path .join (sp_cuda , "pathfinder" ))
73+ print (f"[diag] { p } -> cuda/pathfinder exists: { has_pf } " , flush = True )
74+
75+ site_cuda = locate_result
6076 cuda_paths = list (cuda .__path__ )
6177 if site_cuda not in cuda_paths :
6278 cuda .__path__ = cuda_paths + [site_cuda ]
79+ print (f"[diag] cuda.__path__ (after): { cuda .__path__ } " , flush = True )
6380 import cuda .pathfinder
6481
6582 return cuda .pathfinder .get_cuda_path_or_home
0 commit comments