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

Fix CMake CUDA support for pylibraft when raft is found. #1659

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

bdice
Copy link
Contributor

@bdice bdice commented Jul 20, 2023

This PR always enables CUDA language support in pylibraft's CMakeLists.txt, to work around an issue I encountered while building.

I am trying to build pylibraft in rapids-compose and saw an error in the CMake support for enabling CUDA.

CMake Error at ~/rapids1/compose/etc/conda/cuda_12.0/envs/rapids/share/cmake-3.26/Modules/CMakeDetermineCUDACompiler.cmake:279 (message):
  CMAKE_CUDA_ARCHITECTURES:

    NATIVE

  is not one of the following:

    * a semicolon-separated list of integers, each optionally
      followed by '-real' or '-virtual'
    * a special value: all, all-major, native

Call Stack (most recent call first):
  ~/rapids1/raft/cpp/build/release/raft-config.cmake:171 (enable_language)
  CMakeLists.txt:39 (find_package)

This error indicates that rapids_cuda_init_architectures(pylibraft) isn't being called, which handles some preprocessing for this architectures variable so that CMake recognizes the results.

It seems like the error shown below comes from this part of libraft's CMakeLists.txt where the CUDA language is being enabled without having first called rapids_cuda_init_architectures.

Currently, rapids_cuda_init_architectures is called and the CUDA language is only enabled in pylibraft when raft_FOUND is false. However, I'm building in an environment where raft can be found. It seems like we always need to enable CUDA support due to a requirement in libraft itself, based on the code I see in cuML and cuGraph. Therefore, I copied a similar change into pylibraft in this PR, and it appears to work.

@bdice bdice requested a review from a team as a code owner July 20, 2023 21:07
@bdice bdice self-assigned this Jul 20, 2023
@bdice bdice added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change and removed CMake python labels Jul 20, 2023
@bdice
Copy link
Contributor Author

bdice commented Jul 20, 2023

/merge

@rapids-bot rapids-bot bot merged commit dad78de into rapidsai:branch-23.08 Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
Development

Successfully merging this pull request may close these issues.

2 participants