Skip to content

Static destructor ordering in Gpu::Device for external_stream_stack #5386

Description

@ax3l

Isolated from BLAST-WarpX/warpx#6801

There seems to be a destructor ordering issue on GPU for external_stream_stack.

[...] finalization can crash in amrex::Gpu::Device::Finalize() when it synchronizes streams whose backing C++ static objects (external_stream_stack) have already been destroyed.

We did not get a user-reported reproducer yet, but my guess is that this appears when a users loads a

  • GPU-aware mpi4py that calls MPI_Init or
  • a GPU library like cupy/dpnp

before amrex::Initialize() (importing WarpX in our case).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions