Skip to content

Conversation

@szaman19
Copy link
Contributor

os.environ.get("WITH_CUDA", "0") == "0" return True even if the environment variable is not set. Thus currently, the default behavior is to automatically fall back to CPU-only build if WITH_CUDA is not set.

This introduces a small change to the first check if the WITH_CUDA is set. If not set, it falls back to the build defined by torch.cuda._is_compiled().

Check if environment variable is set before retrieving variable at setup time.
@stefdoerr
Copy link
Collaborator

stefdoerr commented Feb 14, 2025

Ah right, of course. I was so focused on making conda-forge work correctly. Thanks for the contribution!

@stefdoerr stefdoerr merged commit 718e401 into torchmd:main Feb 14, 2025
@stefdoerr
Copy link
Collaborator

stefdoerr commented Feb 14, 2025

I should really not review code before my first morning coffee. There were two logic errors in this PR (the first if was supposed to be not None) and there should not be defaults in the nested getenvs. Fixed here:
a302aab

@szaman19
Copy link
Contributor Author

Haha looks like I shouldn't submit a PR before I've had my first coffee either! Thanks for the fix and quick turn around. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants