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

Compiling with Cuda 11.0 #36

Open
gaspardbb opened this issue May 31, 2021 · 1 comment
Open

Compiling with Cuda 11.0 #36

gaspardbb opened this issue May 31, 2021 · 1 comment

Comments

@gaspardbb
Copy link

gaspardbb commented May 31, 2021

Hi, [Sorry, just realized it might be more relevant in the PR section; can close this and edit this as a PR if you wish]
I had to use Falkon, and it worked great. Thanks for all the work you put in!
Still, I ran into a couple of errors before managing to run it on GPU. Here how I fixed them, if you find it useful:

Not compiling with Cuda

If Falkon is not compiled with Cuda (WITH_CUDA in your cmake file), the extensions are not built and running Falkon will fail with an ModuleNotFoundError at from falkon.ooc_ops.cuda import parallel_potrf in falkon/ooc_ops/ooc_potrf.py. It's a bit hard to track down that this is an issue coming from the first compilation. Maybe catching the exception and providing an error message would be useful, e.g:

try: 
    from falkon.ooc_ops.cuda import parallel_potrf
except ModuleNotFoundError as e:
    print(f"Got exception {e} when importing `cuda`. Did you compile with Cuda support?")

Patched version of PyKeops

I had trouble compiling you patched version of PyKeops. I had only two Cuda compilers available: versions 10.1 and 11.0.

  1. With Cuda 10.1, had the issue described here: https://forums.developer.nvidia.com/t/cuda-10-1-nvidia-youre-now-fixing-gcc-bugs-that-gcc-doesnt-even-have/71063. It is apparently a cuda specific issue, I did not try solving it.
  2. So I used Cuda 11.0. Except I fell in this problem: Update cmake minimum version to 3.18 getkeops/keops#122
    which is basically Cmake not forwarding c++ 17 flags to Cuda. Solution is to use:

Then things worked fine; all in all, I would suggest:

  • Providing information when compilation is done without Cuda (e.g. flags which makes the installation fails if WITH_CUDA is false in the setup.py.
  • Fixed the case with Cuda 11.0 by checking CMake version and applying the commit

Anyway, thanks for the package!

@Giodiro
Copy link
Contributor

Giodiro commented May 31, 2021

Hi Gaspar!

Thanks a lot for the detailed info, I will make sure to address these issues soon, especially the better error handling when compiled without CUDA would make the install experience a lot better!

As a general comment I've been slowly trying to setup a way to build wheels for the package so that the user doesn't have to spend a lot of time compiling to install.. It's not been particularly fun, but it kept a few fixes back in a dev branch (such as for example the keops issue you mentioned).

Hopefully I manage to merge it soon!

Thanks again for your input, glad you found the package useful!

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

No branches or pull requests

2 participants