Skip to content

Commit c45a61f

Browse files
committed
Fix choice of conda package for includes (on Windows)
The path to CUDA includes may exist in a conda environment even if they are not present, particularly on Windows where the include path is just `$CONDA_PREFIX\Library\include`. Therefore, the presence of the include dir alone doesn't signify that the CUDA includes are actually present in that location - we also need to check whether a relevant header file exists.
1 parent 7626716 commit c45a61f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

numba_cuda/numba/cuda/cuda_paths.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ def get_conda_include_dir():
310310
# though usually it shouldn't.
311311
include_dir = os.path.join(sys.prefix, 'include')
312312

313-
if os.path.exists(include_dir):
313+
if (os.path.exists(include_dir) and os.path.isdir(include_dir)
314+
and os.path.exists(os.path.join(include_dir,
315+
'cuda_device_runtime_api.h'))):
314316
return include_dir
315317
return
316318

0 commit comments

Comments
 (0)