-
Notifications
You must be signed in to change notification settings - Fork 242
[FEA] Centralize CUDA environment variable handling and prioritize CUDA_PATH over CUDA_HOME #1519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8ce5d3a
44b6050
f222d8a
0e35362
5406b6d
41ed40a
195a472
6525f6c
a93b851
3ca4b59
2921b31
b127a47
741f6c6
2ce673e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,9 +26,16 @@ | |
| # ---------------------------------------------------------------------- | ||
| # Fetch configuration options | ||
|
|
||
| CUDA_HOME = os.environ.get("CUDA_HOME", os.environ.get("CUDA_PATH", None)) | ||
| try: | ||
| from cuda.pathfinder._utils.env_vars import get_cuda_home_or_path | ||
|
|
||
| CUDA_HOME = get_cuda_home_or_path() | ||
| except ImportError: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this fallback code is needed. cuda-bindings depends critically on cuda-pathfinder. |
||
| # Fallback for build environments where cuda-pathfinder may not be available | ||
| CUDA_HOME = os.environ.get("CUDA_HOME", os.environ.get("CUDA_PATH", None)) | ||
|
|
||
| if not CUDA_HOME: | ||
| raise RuntimeError("Environment variable CUDA_HOME or CUDA_PATH is not set") | ||
| raise RuntimeError("Environment variable CUDA_PATH or CUDA_HOME is not set") | ||
|
|
||
| CUDA_HOME = CUDA_HOME.split(os.pathsep) | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's already on line 34 below. Having it there seemed to work reliably in all situations?