Skip to content

(feat): Improve CMake build configuration for consistent cross-platform GPU support #110

@Montana

Description

@Montana

Hey team,

The current CMake configuration in vpic-kokkos does not consistently detect or configure GPU backends (CUDA, HIP, SYCL) across platforms. In some environments this leads to:

  • GPU support being silently disabled
  • confusing or opaque build failures
  • inconsistent configurations depending on compiler and Kokkos backend selection

More robust GPU backend detection and reporting would improve portability on HPC systems and reduce onboarding friction for new users.


Behavior

Running a standard configure step:

cmake -B build -S .

may result in one or more of the following depending on the host environment:

  • available GPU platforms are not detected
  • the build falls back to CPU-only mode without a warning
  • target GPU architectures are misconfigured (e.g., sm_70 vs sm_80 on NVIDIA)

In these cases it is not always obvious to the user whether GPU acceleration is actually enabled.


Suggested Improvements

A more explicit CMake configuration flow could:

  • clearly report which Kokkos backend(s) were detected and selected
  • fail early if a requested backend is unavailable or improperly configured
  • document or print any expected environment variables / toolchain requirements

For example, improvements might include:

  • summary messages during configuration indicating backend status
  • explicit options such as
    -DKokkos_ENABLE_CUDA=ON, -DKokkos_ENABLE_HIP=ON, -DKokkos_ENABLE_SYCL=ON
  • sanity checks when a backend is requested but not supported on the system

Michael.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions