fix(nccl): cudart as build dependency - #261
Open
dssgabriel wants to merge 4 commits into
Open
Conversation
Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
Kokkos Comm only depends on the CUDA runtime API, not the driver API (even in tests). Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
The MPI CUDA smoke test contains CUDA device kernels and uses CUDA runtime APIs directly, but it was checked in as a .cpp file and added to an MPI-only test target. That only worked in environments where the C++ compiler happened to be a CUDA-aware wrapper such as `nvcc_wrapper`. In a normal CMake configuration, the test is compiled as plain C++. The host compiler does not understand CUDA kernel launch syntax or CUDA compiler flags such as `--cudart`, so the target cannot be built correctly. - Renamed the source to `.cu` and enable the CUDA language only for this test when `Kokkos_ENABLE_CUDA` is set. - Link the target against `CUDA::cudart` explicitly - Use CMake's `CUDA_RUNTIME_LIBRARY` target property to request shared cudart for the MPICH workaround. Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR makes the CUDA runtime an explicit dependency when building Kokkos Comm with the NCCL backend enabled. The NCCL backend includes CUDA runtime headers and uses CUDA runtime types/functions directly, so the build and installed CMake package needs to expose that dependency instead of relying on it indirectly through Kokkos or NCCL.
Changes
List:
CUDAToolkitwhenKokkosComm_ENABLE_NCCL=ON.CUDA::cudart.KokkosCommConfig.cmake.CUDA::cudart.cuda.hinclusion withcuda_runtime.h..cusource with CUDA language support.CUDA_RUNTIME_LIBRARY Sharedfor the MPICH CUDA smoke-test workaround.Checklist