Skip to content

Commit

Permalink
Fix choice of conda package for includes (on Windows)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gmarkall committed Dec 4, 2024
1 parent 3873f15 commit addaeb6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion numba_cuda/numba/cuda/cuda_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ def get_conda_include_dir():
# though usually it shouldn't.
include_dir = os.path.join(sys.prefix, 'include')

if os.path.exists(include_dir):
if (os.path.exists(include_dir) and os.path.isdir(include_dir)
and os.path.exists(os.path.join(include_dir,
'cuda_device_runtime_api.h'))):
return include_dir
return

Expand Down

0 comments on commit addaeb6

Please sign in to comment.