Skip to content

[QMCPack] Use QMC_GPU instead of removed ENABLE_CUDA/QMC_CUDA2HIP - #2539

Merged
jplehr merged 1 commit into
ROCm:aomp-devfrom
ro-i:qmcpack-qmc-gpu
Sep 15, 2026
Merged

jplehr merged 1 commit into
ROCm:aomp-devfrom
ro-i:qmcpack-qmc-gpu

Conversation

@ro-i

@ro-i ro-i commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

QMCPack removed ENABLE_CUDA, ENABLE_ROCM, QMC_CUDA2HIP, ENABLE_SYCL and ENABLE_OFFLOAD in b84e4563 (Jan 2025) and now hard-errors at CMakeLists.txt:71 if any of them is defined. Use QMC_GPU, the replacement documented in docs/installation.rst.

QMCPack removed ENABLE_CUDA, ENABLE_ROCM, QMC_CUDA2HIP, ENABLE_SYCL and
ENABLE_OFFLOAD in b84e4563 (Jan 2025) and now hard-errors at
CMakeLists.txt:71 if any of them is defined. Use QMC_GPU, the replacement
documented in docs/installation.rst.
Comment thread bin/build_qmcpack.sh
-DQMC_GPU=openmp \
-DOFFLOAD_TARGET="amdgcn-amd-amdhsa" \
"${custom_opts[@]}" \
$AOMP_CMAKE "${custom_opts[@]}" \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is offload-arch detected automatically?
If so: How does it handle multi-GPU systems?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only now with QMC_GPU_ARCHS are we actually getting offload-arch:

    if(OFFLOAD_TARGET)
      set(OPENMP_OFFLOAD_COMPILE_OPTIONS "-fopenmp-targets=${OFFLOAD_TARGET}")
      if(OFFLOAD_ARCH)
        set(OPENMP_OFFLOAD_COMPILE_OPTIONS
            "${OPENMP_OFFLOAD_COMPILE_OPTIONS} -Xopenmp-target=${OFFLOAD_TARGET} -march=${OFFLOAD_ARCH}")
      endif()
    elseif(QMC_GPU_ARCHS)
      string(REGEX REPLACE ";" "," QMC_GPU_ARCHS_COMMA_SEPARATED "${QMC_GPU_ARCHS}")
      set(OPENMP_OFFLOAD_COMPILE_OPTIONS "--offload-arch=${QMC_GPU_ARCHS_COMMA_SEPARATED}")
    else()
      message(FATAL_ERROR "Require QMC_GPU_ARCHS or OFFLOAD_TARGET set for OpenMP offload using Clang.")
    endif()

https://github.com/QMCPACK/qmcpack/blob/61175a9ebaa4a4829061c03b398cd6baff9d95f8/CMake/ClangCompilers.cmake#L23-L34

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that any of this affects multi-GPU support (neither positive, nor negative)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so we will simply build for all the archs found on a system?
I'm just asking because the auto-detection of the arch(s) has bitten us in the past. ;)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, so previously, OpenMP got its arch via -DOFFLOAD_ARCH=$AOMP_GPU and HIP got its arches by qmcpack-side autodetection (which led to all arches on a given system).

Now, both OpenMP and HIP get their arch from $AOMP_GPU. And this is set in the aomp-side autodetection (which is limited to one arch at the moment - independent of this PR).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, I did not see line 123 change / addition.

@ro-i

ro-i commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

@jplehr can you merge it, please? aomp repository permissions seem to have moved as well ._.

@jplehr
jplehr merged commit 61abf04 into ROCm:aomp-dev Sep 15, 2026
1 check passed
@ro-i
ro-i deleted the qmcpack-qmc-gpu branch September 15, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants