Skip to content

Commit 3d422de

Browse files
committed
build: raise actionable error when cuda-pathfinder not found on sys.path
Made-with: Cursor
1 parent 0fc4597 commit 3d422de

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

cuda_bindings/build_hooks.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ def _import_get_cuda_path_or_home():
5353
if os.path.isdir(os.path.join(sp_cuda, "pathfinder")):
5454
cuda.__path__ = list(cuda.__path__) + [sp_cuda]
5555
break
56+
else:
57+
raise ModuleNotFoundError(
58+
"cuda-pathfinder is not installed in the build environment. "
59+
"Ensure 'cuda-pathfinder>=1.5' is in build-system.requires."
60+
)
5661
import cuda.pathfinder
5762

5863
return cuda.pathfinder.get_cuda_path_or_home

cuda_core/build_hooks.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ def _import_get_cuda_path_or_home():
4848
if os.path.isdir(os.path.join(sp_cuda, "pathfinder")):
4949
cuda.__path__ = list(cuda.__path__) + [sp_cuda]
5050
break
51+
else:
52+
raise ModuleNotFoundError(
53+
"cuda-pathfinder is not installed in the build environment. "
54+
"Ensure 'cuda-pathfinder>=1.5' is in build-system.requires."
55+
)
5156
import cuda.pathfinder
5257

5358
return cuda.pathfinder.get_cuda_path_or_home

0 commit comments

Comments
 (0)