Skip to content

Openmpi: Default to +cuda when using %nvhpc compiler #3307

@swanwu1996

Description

@swanwu1996

Summary

Description When building openmpi with the NVIDIA HPC SDK compiler (%nvhpc), the cuda variant currently defaults to False (disabled).

Users compiling with %nvhpc almost exclusively intend to use CUDA-aware MPI features (e.g., for GPU-Direct RDMA). If +cuda is not explicitly specified, downstream GPU-enabled applications (like VASP GPU version) will fail at runtime with errors like:

CHECK_MPI: your MPI is not CUDA-aware, STOPPING

It would improve the user experience significantly if the cuda variant could default to True when %nvhpc is detected.

Proposed Change Update the openmpi package recipe to enable +cuda by default when the compiler is %nvhpc.

Likely involves adding a conflict or a default logic in var/spack/repos/builtin/packages/openmpi/package.py, similar to:

Pseudo-code suggestion for package.py

variant("cuda", default=False, description="Enable CUDA support")

...

def configure_args(self):
# logic to handle cuda args
pass

Suggestion:

if self.spec.satisfies("%nvhpc"):

# Logic to make +cuda default or warn if ~cuda

Rationale

No response

Description

No response

Additional information

No response

General information

  • I have searched the issues of this repo and believe this is not a duplicate

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions