Skip to content
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

pykeops.config.gpu_available is broken if PyTorch is available with GPU support, but without nvcc #336

Open
jeanfeydy opened this issue Sep 26, 2023 · 1 comment
Assignees
Labels
c++ related to compilation and c++xx

Comments

@jeanfeydy
Copy link
Contributor

Hi @joanglaunes,

I hope that you are doing well!
With @Louis-Pujol, we just realized that KeOps is currently broken on configurations where:

  • The CUDA toolkit is not fully installed, i.e. nvrtc.h is missing.
  • PyTorch is installed, and a GPU is available, i.e. torch.cuda.is_available() == True.

This is due to this line in pykeops.torch.__init__.py, that overrides pykeops.config.gpu_available (that is False) with torch.cuda.is_available() (that is True). KeOps then tries to compile formulas using the GPU, which doesn't work since nvrtc.h is not available.

As far as I can tell, a simple fix would just be to remove this line...
But since you wrote it back in 2022, I assume that it is there for a reason.
What do you think?

Best regards,
Jean

@jeanfeydy jeanfeydy added the c++ related to compilation and c++xx label Sep 26, 2023
joanglaunes added a commit that referenced this issue Sep 26, 2023
@joanglaunes
Copy link
Contributor

Hi @jeanfeydy ,
I think you are right ; this torch.cuda.is_available() command probably comes from before we implemented keopscore.
Maybe I left it because I was thinking that we need torch.cuda.is_available() to be True in any case, but I don't think it is the case : we may be able to use the Gpu in the "from host" mode when cuda is detected as available by keops, but not by PyTorch for some extra reason.
So I am just testing your fix now ; we will see if it runs ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ related to compilation and c++xx
Projects
None yet
Development

No branches or pull requests

2 participants