From 115df9f4307d3d9a2ec76acf7ce834917a1ad1f3 Mon Sep 17 00:00:00 2001 From: romerojosh Date: Tue, 6 Oct 2026 05:33:22 +0000 Subject: [PATCH 1/7] Decouple CMake dependency discovery from NVHPC Signed-off-by: romerojosh --- CMakeLists.txt | 262 +++++++++++++------ README.md | 19 +- benchmark/CMakeLists.txt | 4 +- cmake/FindCUTENSOR.cmake | 84 ++++++ cmake/FindNCCL.cmake | 64 +++++ cmake/FindNVSHMEM.cmake | 62 +++++ examples/cc/taylor_green/CMakeLists.txt | 4 +- examples/fortran/poisson/CMakeLists.txt | 4 +- examples/fortran/taylor_green/CMakeLists.txt | 4 +- tests/cc/CMakeLists.txt | 6 +- tests/ctest/CMakeLists.txt | 12 +- 11 files changed, 430 insertions(+), 95 deletions(-) create mode 100644 cmake/FindCUTENSOR.cmake create mode 100644 cmake/FindNCCL.cmake create mode 100644 cmake/FindNVSHMEM.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index e6bbf150..bec0ce05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.18) set(CMAKE_CXX_STANDARD 17) if (CMAKE_VERSION VERSION_LESS "3.18") @@ -24,26 +24,48 @@ option(CUDECOMP_ENABLE_NVSHMEM "Enable NVSHMEM" OFF) option(CUDECOMP_BUILD_TESTS "Build tests" OFF) option(CUDECOMP_TEST_FETCH_GTEST "Fetch GoogleTest if a system installation is unavailable" OFF) option(CUDECOMP_BUILD_EXTRAS "Build benchmark, examples, and tests" OFF) -set(CUDECOMP_NCCL_HOME CACHE STRING "Path to search for NCCL installation. Use to override NVHPC provided NCCL version.") -set(CUDECOMP_NVSHMEM_HOME CACHE STRING "Path to search for NVSHMEM installation. Use to override NVHPC provided NVSHMEM version.") +set(CUDECOMP_CUTENSOR_HOME CACHE PATH "CUTENSOR installation root. Overrides CUTENSOR_ROOT when set.") +set(CUDECOMP_NCCL_HOME CACHE PATH "NCCL installation root. Overrides NCCL_ROOT when set.") +set(CUDECOMP_NVSHMEM_HOME CACHE PATH "NVSHMEM installation root. Overrides NVSHMEM_ROOT when set.") + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + +if (CUDECOMP_CUTENSOR_HOME) + set(CUTENSOR_ROOT "${CUDECOMP_CUTENSOR_HOME}") +endif() + +if (CUDECOMP_NCCL_HOME) + set(NCCL_ROOT "${CUDECOMP_NCCL_HOME}") +endif() + +if (CUDECOMP_NVSHMEM_HOME) + set(NVSHMEM_ROOT "${CUDECOMP_NVSHMEM_HOME}") +endif() if (CUDECOMP_BUILD_CPU_ONLY AND (CUDECOMP_ENABLE_NVTX OR CUDECOMP_ENABLE_NVSHMEM)) message(FATAL_ERROR "CPU-only builds do not support NVTX or NVSHMEM") endif() if (NOT CUDECOMP_BUILD_CPU_ONLY) - # Use NVHPC compilers by default - find_program(NVHPC_CXX_BIN "nvc++" REQUIRED) - set(CMAKE_CXX_COMPILER ${NVHPC_CXX_BIN}) + # Prefer nvc++ when available unless the user has selected a C++ compiler + # through CMake, the environment, or a toolchain file. + if (NOT CMAKE_CXX_COMPILER AND NOT CMAKE_TOOLCHAIN_FILE AND "$ENV{CXX}" STREQUAL "") + find_program(NVHPC_CXX_BIN "nvc++") + if (NVHPC_CXX_BIN) + set(CMAKE_CXX_COMPILER "${NVHPC_CXX_BIN}") + endif() + endif() - if (CUDECOMP_BUILD_FORTRAN) - find_program(NVHPC_Fortran_BIN "nvfortran" REQUIRED) - set(CMAKE_Fortran_COMPILER ${NVHPC_Fortran_BIN}) + # GPU Fortran bindings require nvfortran. Select it when the user has not + # already chosen a Fortran compiler through CMake or the environment. + if (CUDECOMP_BUILD_FORTRAN AND NOT CMAKE_Fortran_COMPILER AND NOT CMAKE_TOOLCHAIN_FILE AND "$ENV{FC}" STREQUAL "") + find_program(NVHPC_Fortran_BIN "nvfortran") + if (NOT NVHPC_Fortran_BIN) + message(FATAL_ERROR "nvfortran was not found. Load an NVHPC environment or set CMAKE_Fortran_COMPILER.") + endif() + set(CMAKE_Fortran_COMPILER "${NVHPC_Fortran_BIN}") endif() - # Locate and use NVHPC CMake configuration - string(REPLACE "compilers/bin/nvc++" "cmake" NVHPC_CMAKE_DIR ${NVHPC_CXX_BIN}) - set(CMAKE_PREFIX_PATH ${NVHPC_CMAKE_DIR}) endif() set(LANGS CXX) @@ -71,6 +93,11 @@ set(CUDECOMP_SOVERSION 0) project(cudecomp VERSION ${CUDECOMP_VERSION} LANGUAGES ${LANGS}) +if (CUDECOMP_BUILD_FORTRAN AND NOT CUDECOMP_BUILD_CPU_ONLY AND + NOT CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") + message(FATAL_ERROR "The cuDecomp Fortran bindings require nvfortran.") +endif() + if (CUDECOMP_BUILD_FORTRAN AND NOT CUDECOMP_BUILD_CPU_ONLY) # Remove debug information to enable mixed Fortran compilation with cc100 and older compute capabilities. string(REGEX REPLACE "(^| )-g(opt)?($| )" "\\3" CMAKE_Fortran_FLAGS_RELWITHDEBINFO @@ -111,77 +138,156 @@ endif() find_package(MPI REQUIRED) if (NOT CUDECOMP_BUILD_CPU_ONLY) - if (CRAY_CC_BIN) - # FindMPI does not include Cray GTL (e.g. CUDA-aware) libs - # automatically in Cray environment. Locate it to include in linking. - string(REPLACE ":" ";" CRAY_LIB_PATHS $ENV{CRAY_LD_LIBRARY_PATH}) - find_library(CRAY_MPI_GTL_CUDA_LIBRARY REQUIRED - NAMES mpi_gtl_cuda - HINTS ${CRAY_LIB_PATHS} - ) +if (CRAY_CC_BIN) + # FindMPI does not include Cray GTL (e.g. CUDA-aware) libs + # automatically in Cray environment. Locate it to include in linking. + string(REPLACE ":" ";" CRAY_LIB_PATHS $ENV{CRAY_LD_LIBRARY_PATH}) + find_library(CRAY_MPI_GTL_CUDA_LIBRARY REQUIRED + NAMES mpi_gtl_cuda + HINTS ${CRAY_LIB_PATHS} + ) - # Cray GTL libs benefit from linking against gdrcopy, so also - # locating that library. - find_library(GDRCOPY_LIBRARY REQUIRED - NAMES gdrapi - ) + # Cray GTL libs benefit from linking against gdrcopy, so also + # locating that library. + find_library(GDRCOPY_LIBRARY REQUIRED + NAMES gdrapi + ) + + message(STATUS "Found Cray GTL library: " ${CRAY_MPI_GTL_CUDA_LIBRARY}) + message(STATUS "Found GDRCopy library: " ${GDRCOPY_LIBRARY}) +endif() - message(STATUS "Found Cray GTL library: " ${CRAY_MPI_GTL_CUDA_LIBRARY}) - message(STATUS "Found GDRCopy library: " ${GDRCOPY_LIBRARY}) +# Resolve every CUDA dependency independently of the compiler installation. +# This supports both an unmodified NVHPC SDK and installations assembled from +# components under separate prefixes. +find_package(CUDAToolkit REQUIRED) +find_package(CUTENSOR REQUIRED) + +set(CUDECOMP_CUDART_TARGET CUDA::cudart) +set(CUDECOMP_CUTENSOR_TARGET CUTENSOR::CUTENSOR) +set(CUDECOMP_CUFFT_TARGET CUDA::cufft) +set(CUDECOMP_CUDA_VERSION "${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}") +set(CUDECOMP_CUDA_INCLUDE_DIR "${CUDAToolkit_INCLUDE_DIRS}") +foreach(CUDECOMP_CUDA_INCLUDE_ROOT IN LISTS CUDAToolkit_INCLUDE_DIRS) + if (EXISTS "${CUDECOMP_CUDA_INCLUDE_ROOT}/cccl") + list(APPEND CUDECOMP_CUDA_INCLUDE_DIR "${CUDECOMP_CUDA_INCLUDE_ROOT}/cccl") endif() +endforeach() +set(CUDECOMP_CUTENSOR_INCLUDE_DIR "${CUTENSOR_INCLUDE_DIR}") +set(CUDECOMP_CUFFT_INCLUDE_DIR "${CUDAToolkit_INCLUDE_DIRS}") +set(CUDECOMP_CUDA_STUBS_DIR "${CUDAToolkit_LIBRARY_DIR}/stubs") - # HPC SDK - find_package(NVHPC REQUIRED COMPONENTS CUDA MATH) +if (CUDECOMP_BUILD_FORTRAN) + if (NOT "$ENV{NVHPC_CUDA_HOME}" STREQUAL "" AND + NOT "$ENV{NVCOMPILER_CUDA_HOME}" STREQUAL "") + get_filename_component(CUDECOMP_NVHPC_CUDA_HOME_REAL "$ENV{NVHPC_CUDA_HOME}" REALPATH) + get_filename_component(CUDECOMP_NVCOMPILER_CUDA_HOME_REAL "$ENV{NVCOMPILER_CUDA_HOME}" REALPATH) + if (NOT CUDECOMP_NVHPC_CUDA_HOME_REAL STREQUAL CUDECOMP_NVCOMPILER_CUDA_HOME_REAL) + message(FATAL_ERROR + "NVHPC_CUDA_HOME and NVCOMPILER_CUDA_HOME specify different CUDA Toolkit installations. " + "Set only one override, or set both to the same installation." + ) + endif() + set(CUDECOMP_NVFORTRAN_CUDA_HOME "${CUDECOMP_NVHPC_CUDA_HOME_REAL}") + elseif (NOT "$ENV{NVHPC_CUDA_HOME}" STREQUAL "") + set(CUDECOMP_NVFORTRAN_CUDA_HOME "$ENV{NVHPC_CUDA_HOME}") + elseif (NOT "$ENV{NVCOMPILER_CUDA_HOME}" STREQUAL "") + set(CUDECOMP_NVFORTRAN_CUDA_HOME "$ENV{NVCOMPILER_CUDA_HOME}") + endif() - # Set up required include directory flags, NVHPC CMake config only defined library directories - string(REGEX REPLACE "(.+)(\/lib64)$" "\\1/include" NVHPC_CUDA_INCLUDE_DIR ${NVHPC_CUDA_LIBRARY_DIR}) - string(REGEX REPLACE "(.+)(\/lib64)$" "\\1/include" NVHPC_CUFFT_INCLUDE_DIR ${NVHPC_MATH_LIBRARY_DIR}) - string(REGEX REPLACE "(.+)(\/lib64)$" "\\1/include" NVHPC_CUTENSOR_INCLUDE_DIR ${NVHPC_MATH_LIBRARY_DIR}) + if (CUDECOMP_NVFORTRAN_CUDA_HOME) + set(CUDECOMP_NVFORTRAN_EXTERNAL_CUDA_OVERRIDE ON) + set(CUDECOMP_NVFORTRAN_NVCC "${CUDECOMP_NVFORTRAN_CUDA_HOME}/bin/nvcc") + if (NOT EXISTS "${CUDECOMP_NVFORTRAN_NVCC}") + message(FATAL_ERROR + "The NVHPC CUDA Toolkit override does not contain bin/nvcc: " + "${CUDECOMP_NVFORTRAN_CUDA_HOME}" + ) + endif() - # Get NCCL library (with optional override) - if (CUDECOMP_NCCL_HOME) - find_path(NCCL_INCLUDE_DIR REQUIRED - NAMES nccl.h - HINTS ${CUDECOMP_NCCL_HOME}/include + execute_process( + COMMAND "${CUDECOMP_NVFORTRAN_NVCC}" --version + RESULT_VARIABLE CUDECOMP_NVFORTRAN_NVCC_RESULT + OUTPUT_VARIABLE CUDECOMP_NVFORTRAN_NVCC_OUTPUT + ERROR_VARIABLE CUDECOMP_NVFORTRAN_NVCC_ERROR ) + if (NOT CUDECOMP_NVFORTRAN_NVCC_RESULT STREQUAL "0") + message(FATAL_ERROR + "Could not determine the CUDA version from ${CUDECOMP_NVFORTRAN_NVCC}: " + "${CUDECOMP_NVFORTRAN_NVCC_ERROR}" + ) + endif() - find_library(NCCL_LIBRARY REQUIRED - NAMES nccl - HINTS ${CUDECOMP_NCCL_HOME}/lib - ) + string(REGEX MATCH "release[ \t]+([0-9]+)\\.([0-9]+)" + CUDECOMP_NVFORTRAN_NVCC_VERSION_MATCH + "${CUDECOMP_NVFORTRAN_NVCC_OUTPUT}") + if (NOT CUDECOMP_NVFORTRAN_NVCC_VERSION_MATCH) + message(FATAL_ERROR + "Could not determine the CUDA version from ${CUDECOMP_NVFORTRAN_NVCC}." + ) + endif() + set(CUDECOMP_NVFORTRAN_CUDA_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}") + + if (NOT CUDECOMP_NVFORTRAN_CUDA_VERSION STREQUAL CUDECOMP_CUDA_VERSION) + message(FATAL_ERROR + "The selected CUDA compiler uses CUDA ${CUDECOMP_CUDA_VERSION}, but the NVHPC CUDA " + "Toolkit override uses CUDA ${CUDECOMP_NVFORTRAN_CUDA_VERSION}. Set CUDACXX or " + "CMAKE_CUDA_COMPILER and the NVHPC CUDA override to equivalent Toolkit versions." + ) + endif() else() - find_package(NVHPC REQUIRED COMPONENTS NCCL) - find_library(NCCL_LIBRARY - NAMES nccl - HINTS ${NVHPC_NCCL_LIBRARY_DIR} + set(CUDECOMP_NVFORTRAN_CUDA_VERSION_ARG "cuda${CUDECOMP_CUDA_VERSION}") + + include(CheckFortranSourceCompiles) + include(CMakePushCheckState) + cmake_push_check_state(RESET) + set(CMAKE_REQUIRED_FLAGS "-cuda -gpu=${CUDECOMP_NVFORTRAN_CUDA_VERSION_ARG}") + check_fortran_source_compiles( + " program test_nvfortran_cuda + use cudafor + implicit none + end" + CUDECOMP_NVFORTRAN_CUDA_VERSION_SUPPORTED ) - string(REGEX REPLACE "(.+)(\/lib)$" "\\1/include" NCCL_INCLUDE_DIR ${NVHPC_NCCL_LIBRARY_DIR}) + cmake_pop_check_state() + + if (NOT CUDECOMP_NVFORTRAN_CUDA_VERSION_SUPPORTED) + message(FATAL_ERROR + "The selected CUDA compiler uses CUDA ${CUDECOMP_CUDA_VERSION}, but nvfortran " + "${CMAKE_Fortran_COMPILER_VERSION} cannot use that CUDA toolchain. Select a CUDA compiler " + "matching a CUDA version installed with NVHPC, or set NVHPC_CUDA_HOME or " + "NVCOMPILER_CUDA_HOME to the selected external CUDA Toolkit." + ) + endif() endif() +endif() - message(STATUS "Using NCCL library: ${NCCL_LIBRARY}") +find_package(NCCL MODULE REQUIRED) +set(CUDECOMP_NCCL_TARGET NCCL::NCCL) - if (CUDECOMP_ENABLE_NVSHMEM) - # Get NVSHMEM library (with optional override) - if (CUDECOMP_NVSHMEM_HOME) - find_path(NVSHMEM_INCLUDE_DIR REQUIRED - NAMES nvshmem.h - HINTS ${CUDECOMP_NVSHMEM_HOME}/include - ) +if (CUDECOMP_ENABLE_NVSHMEM) + find_package(NVSHMEM REQUIRED) + set(CUDECOMP_NVSHMEM_HOST_TARGET NVSHMEM::host) + set(CUDECOMP_NVSHMEM_DEVICE_TARGET NVSHMEM::device) + get_filename_component(NVSHMEM_LIBRARY_DIR "${NVSHMEM_HOST_LIBRARY}" DIRECTORY) +endif() - find_path(NVSHMEM_LIBRARY_DIR REQUIRED - NAMES libnvshmem.a - HINTS ${CUDECOMP_NVSHMEM_HOME}/lib - ) - else() - find_package(NVHPC REQUIRED COMPONENTS NVSHMEM) - set(NVSHMEM_LIBRARY_DIR ${NVHPC_NVSHMEM_LIBRARY_DIR}) - string(REGEX REPLACE "(.+)(\/lib)$" "\\1/include" NVSHMEM_INCLUDE_DIR ${NVHPC_NVSHMEM_LIBRARY_DIR}) + message(STATUS "cuDecomp dependency summary:") + message(STATUS " C++ compiler: ${CMAKE_CXX_COMPILER} (${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION})") + message(STATUS " CUDA compiler: ${CMAKE_CUDA_COMPILER} (${CMAKE_CUDA_COMPILER_VERSION})") + if (CUDECOMP_BUILD_FORTRAN) + message(STATUS " Fortran compiler: ${CMAKE_Fortran_COMPILER} (${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION})") + if (CUDECOMP_NVFORTRAN_EXTERNAL_CUDA_OVERRIDE) + message(STATUS " NVHPC CUDA Toolkit: ${CUDECOMP_NVFORTRAN_CUDA_HOME} (${CUDECOMP_NVFORTRAN_CUDA_VERSION})") endif() - - message(STATUS "Using NVSHMEM installation at: ${NVSHMEM_LIBRARY_DIR}") - endif() - + message(STATUS " CUDA Toolkit: ${CUDAToolkit_LIBRARY_ROOT} (${CUDAToolkit_VERSION})") + message(STATUS " CUTENSOR: ${CUTENSOR_LIBRARY} (${CUTENSOR_VERSION})") + message(STATUS " NCCL: ${NCCL_LIBRARY} (${NCCL_VERSION})") + if (CUDECOMP_ENABLE_NVSHMEM) + message(STATUS " NVSHMEM host library: ${NVSHMEM_HOST_LIBRARY}") + message(STATUS " NVSHMEM device library: ${NVSHMEM_DEVICE_LIBRARY}") + endif() endif() # Building cuDecomp shared lib @@ -233,14 +339,14 @@ else() PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${MPI_CXX_INCLUDE_DIRS} - ${NVHPC_CUDA_INCLUDE_DIR} - ${NVHPC_CUTENSOR_INCLUDE_DIR} + ${CUDECOMP_CUDA_INCLUDE_DIR} + ${CUDECOMP_CUTENSOR_INCLUDE_DIR} ${NCCL_INCLUDE_DIR} ) - target_link_libraries(cudecomp PUBLIC NVHPC::CUDART) - target_link_libraries(cudecomp PRIVATE NVHPC::CUTENSOR) - target_link_libraries(cudecomp PRIVATE ${NCCL_LIBRARY}) + target_link_libraries(cudecomp PUBLIC ${CUDECOMP_CUDART_TARGET}) + target_link_libraries(cudecomp PRIVATE ${CUDECOMP_CUTENSOR_TARGET}) + target_link_libraries(cudecomp PRIVATE ${CUDECOMP_NCCL_TARGET}) if (CRAY_CC_BIN) # In Cray environments, add links to GTL and GDRCopy libs for CUDA-aware support target_link_libraries(cudecomp PRIVATE ${CRAY_MPI_GTL_CUDA_LIBRARY}) @@ -286,18 +392,18 @@ else() if (NVSHMEM_VERSION VERSION_LESS "2.6") message(FATAL_ERROR "NVSHMEM versions earlier than 2.6.0 are not supported by cuDecomp.") else() - target_link_libraries(cudecomp PRIVATE ${NVSHMEM_LIBRARY_DIR}/libnvshmem_host.so) - target_link_libraries(cudecomp PRIVATE ${NVSHMEM_LIBRARY_DIR}/libnvshmem_device.a) + target_link_libraries(cudecomp PRIVATE ${CUDECOMP_NVSHMEM_HOST_TARGET}) + target_link_libraries(cudecomp PRIVATE ${CUDECOMP_NVSHMEM_DEVICE_TARGET}) endif() if (NVSHMEM_VERSION VERSION_LESS "2.7") # NVSHMEM versions before 2.7 will export NCCL symbols erroneously, need to define this flag target_compile_definitions(cudecomp PRIVATE NVSHMEM_USE_NCCL) - target_link_libraries(cudecomp PUBLIC -L${NVHPC_CUDA_LIBRARY_DIR}/stubs -lcuda) + target_link_libraries(cudecomp PUBLIC -L${CUDECOMP_CUDA_STUBS_DIR} -lcuda) endif() if (NVSHMEM_VERSION VERSION_LESS "2.11") - target_link_libraries(cudecomp PUBLIC -L${NVHPC_CUDA_LIBRARY_DIR}/stubs -lnvidia-ml) + target_link_libraries(cudecomp PUBLIC -L${CUDECOMP_CUDA_STUBS_DIR} -lnvidia-ml) endif() endif() @@ -325,7 +431,9 @@ if (CUDECOMP_BUILD_FORTRAN) foreach(CUDA_CC ${CUDECOMP_CUDA_CC_LIST}) list(APPEND CUF_GPU_ARG "cc${CUDA_CC}") endforeach() - list(APPEND CUF_GPU_ARG "cuda${NVHPC_CUDA_VERSION}") + if (CUDECOMP_NVFORTRAN_CUDA_VERSION_ARG) + list(APPEND CUF_GPU_ARG "${CUDECOMP_NVFORTRAN_CUDA_VERSION_ARG}") + endif() list(JOIN CUF_GPU_ARG "," CUF_GPU_ARG) endif() diff --git a/README.md b/README.md index f4dcc90e..04eae372 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,24 @@ $ cmake -DCUDECOMP_BUILD_EXTRAS=1 -DCUDECOMP_ENABLE_NVSHMEM=1 .. ### GPU dependencies -We strongly recommend building this library using NVHPC SDK compilers and libraries, as the SDK contains all required dependencies for this library and is the focus of our testing. GPU Fortran bindings require NVHPC SDK compilers. +The NVHPC SDK remains the primary tested environment and provides all required +GPU dependencies, but the C++ library does not require the NVHPC C++ compiler. +GPU Fortran bindings require `nvfortran`. CMake 3.18 or newer is required. +When no C++ compiler or toolchain is selected explicitly, CMake prefers +`nvc++` when it is available. + +The CUDA Toolkit location is inferred from the selected NVIDIA CUDA compiler. +To select a specific CUDA installation, set `CUDACXX` or +`CMAKE_CUDA_COMPILER` when configuring a fresh build directory. When building +the Fortran bindings against an external CUDA Toolkit, also set +`NVHPC_CUDA_HOME` or `NVCOMPILER_CUDA_HOME` to an installation with the same +CUDA major and minor version. + +CMake automatically searches system locations and paths exposed by the current +environment, including `CPATH`, `LIBRARY_PATH`, and `LD_LIBRARY_PATH`. If +dependencies cannot be found there, use `CUDECOMP_CUTENSOR_HOME`/`CUTENSOR_ROOT`, +`CUDECOMP_NCCL_HOME`/`NCCL_ROOT`, or `CUDECOMP_NVSHMEM_HOME`/`NVSHMEM_ROOT`. The +`CUDECOMP_*_HOME` setting takes precedence when both forms are provided. One exception is cuDecomp builds using NVSHMEM versions older than v3.0, which require the use of a bootstrapping layer that depends on your MPI distribution. The NVSHMEM library packaged within NVHPC SDK supports OpenMPI only. If you require usage of a different MPI implementation (e.g. Spectrum MPI or Cray MPICH), you need to either build diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index a239d8e3..f0693cd5 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -20,11 +20,11 @@ foreach(tgt ${benchmark_targets}) target_include_directories(${tgt} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../include - ${NVHPC_CUFFT_INCLUDE_DIR} + ${CUDECOMP_CUFFT_INCLUDE_DIR} ${NCCL_INCLUDE_DIR} ${MPI_CXX_INCLUDE_DIRS}) target_link_libraries(${tgt} PRIVATE cudecomp) - target_link_libraries(${tgt} PRIVATE NVHPC::CUFFT) + target_link_libraries(${tgt} PRIVATE ${CUDECOMP_CUFFT_TARGET}) set_target_properties(${tgt} PROPERTIES LINKER_LANGUAGE CXX) endforeach() diff --git a/cmake/FindCUTENSOR.cmake b/cmake/FindCUTENSOR.cmake new file mode 100644 index 00000000..16611ecb --- /dev/null +++ b/cmake/FindCUTENSOR.cmake @@ -0,0 +1,84 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +include(FindPackageHandleStandardArgs) + +set(_CUTENSOR_ROOT "${CUTENSOR_ROOT}") +if (NOT _CUTENSOR_ROOT AND NOT "$ENV{CUTENSOR_ROOT}" STREQUAL "") + set(_CUTENSOR_ROOT "$ENV{CUTENSOR_ROOT}") +elseif (NOT _CUTENSOR_ROOT AND NOT "$ENV{NVCOMPILER_MATH_LIBS_HOME}" STREQUAL "") + set(_CUTENSOR_ROOT "$ENV{NVCOMPILER_MATH_LIBS_HOME}") +endif() + +set(_CUTENSOR_TARGET_NAMES "${CMAKE_SYSTEM_PROCESSOR}-linux") +if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)$") + list(APPEND _CUTENSOR_TARGET_NAMES sbsa-linux) +elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(AMD64|x86_64)$") + list(APPEND _CUTENSOR_TARGET_NAMES x86_64-linux) +endif() + +set(_CUTENSOR_INCLUDE_SUFFIXES include) +set(_CUTENSOR_LIBRARY_SUFFIXES lib lib64) +foreach(_CUTENSOR_TARGET_NAME IN LISTS _CUTENSOR_TARGET_NAMES) + list(APPEND _CUTENSOR_INCLUDE_SUFFIXES "targets/${_CUTENSOR_TARGET_NAME}/include") + list(APPEND _CUTENSOR_LIBRARY_SUFFIXES "targets/${_CUTENSOR_TARGET_NAME}/lib") +endforeach() +list(APPEND _CUTENSOR_LIBRARY_SUFFIXES + "lib/${CUDAToolkit_VERSION_MAJOR}" + "lib/${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}" +) + +if (_CUTENSOR_ROOT) + find_path(CUTENSOR_INCLUDE_DIR + NAMES cutensor.h + HINTS "${_CUTENSOR_ROOT}" + PATH_SUFFIXES ${_CUTENSOR_INCLUDE_SUFFIXES} + NO_DEFAULT_PATH + ) + find_library(CUTENSOR_LIBRARY + NAMES cutensor + HINTS "${_CUTENSOR_ROOT}" + PATH_SUFFIXES ${_CUTENSOR_LIBRARY_SUFFIXES} + NO_DEFAULT_PATH + ) +else() + find_path(CUTENSOR_INCLUDE_DIR NAMES cutensor.h PATHS ENV CPATH) + find_library(CUTENSOR_LIBRARY NAMES cutensor PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) +endif() + +if (CUTENSOR_INCLUDE_DIR) + file(STRINGS "${CUTENSOR_INCLUDE_DIR}/cutensor.h" _CUTENSOR_VERSION_LINES + REGEX "^#define CUTENSOR_(MAJOR|MINOR|PATCH) +[0-9]+") + foreach(_CUTENSOR_COMPONENT MAJOR MINOR PATCH) + string(REGEX MATCH "#define CUTENSOR_${_CUTENSOR_COMPONENT} +([0-9]+)" _CUTENSOR_VERSION_LINE + "${_CUTENSOR_VERSION_LINES}") + set(CUTENSOR_VERSION_${_CUTENSOR_COMPONENT} "${CMAKE_MATCH_1}") + endforeach() + if (DEFINED CUTENSOR_VERSION_MAJOR AND DEFINED CUTENSOR_VERSION_MINOR AND DEFINED CUTENSOR_VERSION_PATCH) + set(CUTENSOR_VERSION "${CUTENSOR_VERSION_MAJOR}.${CUTENSOR_VERSION_MINOR}.${CUTENSOR_VERSION_PATCH}") + endif() +endif() + +find_package_handle_standard_args(CUTENSOR + REQUIRED_VARS CUTENSOR_LIBRARY CUTENSOR_INCLUDE_DIR + VERSION_VAR CUTENSOR_VERSION +) + +if (CUTENSOR_FOUND AND NOT TARGET CUTENSOR::CUTENSOR) + add_library(CUTENSOR::CUTENSOR UNKNOWN IMPORTED) + set_target_properties(CUTENSOR::CUTENSOR PROPERTIES + IMPORTED_LOCATION "${CUTENSOR_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${CUTENSOR_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced(CUTENSOR_INCLUDE_DIR CUTENSOR_LIBRARY) +unset(_CUTENSOR_ROOT) +unset(_CUTENSOR_TARGET_NAMES) +unset(_CUTENSOR_TARGET_NAME) +unset(_CUTENSOR_INCLUDE_SUFFIXES) +unset(_CUTENSOR_LIBRARY_SUFFIXES) +unset(_CUTENSOR_VERSION_LINES) +unset(_CUTENSOR_VERSION_LINE) +unset(_CUTENSOR_COMPONENT) diff --git a/cmake/FindNCCL.cmake b/cmake/FindNCCL.cmake new file mode 100644 index 00000000..bbac7783 --- /dev/null +++ b/cmake/FindNCCL.cmake @@ -0,0 +1,64 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +include(FindPackageHandleStandardArgs) + +set(_NCCL_ROOT "${NCCL_ROOT}") +if (NOT _NCCL_ROOT AND NOT "$ENV{NCCL_ROOT}" STREQUAL "") + set(_NCCL_ROOT "$ENV{NCCL_ROOT}") +elseif (NOT _NCCL_ROOT AND NOT "$ENV{NVCOMPILER_NCCL_HOME}" STREQUAL "") + set(_NCCL_ROOT "$ENV{NVCOMPILER_NCCL_HOME}") +elseif (NOT _NCCL_ROOT AND NOT "$ENV{NVCOMPILER_COMM_LIBS_HOME}" STREQUAL "") + set(_NCCL_ROOT "$ENV{NVCOMPILER_COMM_LIBS_HOME}") +endif() + +if (_NCCL_ROOT) + find_path(NCCL_INCLUDE_DIR + NAMES nccl.h + HINTS "${_NCCL_ROOT}" + PATH_SUFFIXES include nccl/include + NO_DEFAULT_PATH + ) + find_library(NCCL_LIBRARY + NAMES nccl + HINTS "${_NCCL_ROOT}" + PATH_SUFFIXES lib lib64 nccl/lib nccl/lib64 + NO_DEFAULT_PATH + ) +else() + find_path(NCCL_INCLUDE_DIR NAMES nccl.h PATHS ENV CPATH) + find_library(NCCL_LIBRARY NAMES nccl PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) +endif() + +if (NCCL_INCLUDE_DIR) + file(STRINGS "${NCCL_INCLUDE_DIR}/nccl.h" _NCCL_VERSION_LINES + REGEX "^#define NCCL_(MAJOR|MINOR|PATCH) +[0-9]+$") + foreach(_NCCL_COMPONENT MAJOR MINOR PATCH) + string(REGEX MATCH "#define NCCL_${_NCCL_COMPONENT} +([0-9]+)" _NCCL_VERSION_LINE + "${_NCCL_VERSION_LINES}") + set(NCCL_VERSION_${_NCCL_COMPONENT} "${CMAKE_MATCH_1}") + endforeach() + if (DEFINED NCCL_VERSION_MAJOR AND DEFINED NCCL_VERSION_MINOR AND DEFINED NCCL_VERSION_PATCH) + set(NCCL_VERSION "${NCCL_VERSION_MAJOR}.${NCCL_VERSION_MINOR}.${NCCL_VERSION_PATCH}") + endif() +endif() + +find_package_handle_standard_args(NCCL + REQUIRED_VARS NCCL_LIBRARY NCCL_INCLUDE_DIR + VERSION_VAR NCCL_VERSION +) + +if (NCCL_FOUND AND NOT TARGET NCCL::NCCL) + add_library(NCCL::NCCL UNKNOWN IMPORTED) + set_target_properties(NCCL::NCCL PROPERTIES + IMPORTED_LOCATION "${NCCL_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${NCCL_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced(NCCL_INCLUDE_DIR NCCL_LIBRARY) +unset(_NCCL_ROOT) +unset(_NCCL_VERSION_LINES) +unset(_NCCL_VERSION_LINE) +unset(_NCCL_COMPONENT) diff --git a/cmake/FindNVSHMEM.cmake b/cmake/FindNVSHMEM.cmake new file mode 100644 index 00000000..782e7368 --- /dev/null +++ b/cmake/FindNVSHMEM.cmake @@ -0,0 +1,62 @@ +# Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +include(FindPackageHandleStandardArgs) + +set(_NVSHMEM_ROOT "${NVSHMEM_ROOT}") +if (NOT _NVSHMEM_ROOT AND NOT "$ENV{NVSHMEM_ROOT}" STREQUAL "") + set(_NVSHMEM_ROOT "$ENV{NVSHMEM_ROOT}") +elseif (NOT _NVSHMEM_ROOT AND NOT "$ENV{NVCOMPILER_SHMEM_HOME}" STREQUAL "") + set(_NVSHMEM_ROOT "$ENV{NVCOMPILER_SHMEM_HOME}") +elseif (NOT _NVSHMEM_ROOT AND NOT "$ENV{NVCOMPILER_COMM_LIBS_HOME}" STREQUAL "") + set(_NVSHMEM_ROOT "$ENV{NVCOMPILER_COMM_LIBS_HOME}") +endif() + +if (_NVSHMEM_ROOT) + find_path(NVSHMEM_INCLUDE_DIR + NAMES nvshmem.h + HINTS "${_NVSHMEM_ROOT}" + PATH_SUFFIXES include nvshmem/include + NO_DEFAULT_PATH + ) + find_library(NVSHMEM_HOST_LIBRARY + NAMES nvshmem_host + HINTS "${_NVSHMEM_ROOT}" + PATH_SUFFIXES lib lib64 nvshmem/lib nvshmem/lib64 + NO_DEFAULT_PATH + ) + find_library(NVSHMEM_DEVICE_LIBRARY + NAMES nvshmem_device + HINTS "${_NVSHMEM_ROOT}" + PATH_SUFFIXES lib lib64 nvshmem/lib nvshmem/lib64 + NO_DEFAULT_PATH + ) +else() + find_path(NVSHMEM_INCLUDE_DIR NAMES nvshmem.h PATHS ENV CPATH) + find_library(NVSHMEM_HOST_LIBRARY NAMES nvshmem_host PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) + find_library(NVSHMEM_DEVICE_LIBRARY NAMES nvshmem_device PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) +endif() + +find_package_handle_standard_args(NVSHMEM + REQUIRED_VARS NVSHMEM_HOST_LIBRARY NVSHMEM_DEVICE_LIBRARY NVSHMEM_INCLUDE_DIR +) + +if (NVSHMEM_FOUND AND NOT TARGET NVSHMEM::host) + add_library(NVSHMEM::host UNKNOWN IMPORTED) + set_target_properties(NVSHMEM::host PROPERTIES + IMPORTED_LOCATION "${NVSHMEM_HOST_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${NVSHMEM_INCLUDE_DIR}" + ) +endif() + +if (NVSHMEM_FOUND AND NOT TARGET NVSHMEM::device) + add_library(NVSHMEM::device UNKNOWN IMPORTED) + set_target_properties(NVSHMEM::device PROPERTIES + IMPORTED_LOCATION "${NVSHMEM_DEVICE_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${NVSHMEM_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced(NVSHMEM_INCLUDE_DIR NVSHMEM_HOST_LIBRARY NVSHMEM_DEVICE_LIBRARY) +unset(_NVSHMEM_ROOT) diff --git a/examples/cc/taylor_green/CMakeLists.txt b/examples/cc/taylor_green/CMakeLists.txt index fb771907..89778a1d 100644 --- a/examples/cc/taylor_green/CMakeLists.txt +++ b/examples/cc/taylor_green/CMakeLists.txt @@ -17,10 +17,10 @@ target_include_directories(tg PRIVATE ${CMAKE_BINARY_DIR}/include ${MPI_CXX_INCLUDE_DIRS} - ${NVHPC_CUFFT_INCLUDE_DIR} + ${CUDECOMP_CUFFT_INCLUDE_DIR} ) target_link_libraries(tg PRIVATE MPI::MPI_CXX) -target_link_libraries(tg PRIVATE NVHPC::CUFFT) +target_link_libraries(tg PRIVATE ${CUDECOMP_CUFFT_TARGET}) target_link_libraries(tg PRIVATE cudecomp) set_target_properties(tg PROPERTIES LINKER_LANGUAGE CXX) diff --git a/examples/fortran/poisson/CMakeLists.txt b/examples/fortran/poisson/CMakeLists.txt index 2ec91d14..a713af04 100644 --- a/examples/fortran/poisson/CMakeLists.txt +++ b/examples/fortran/poisson/CMakeLists.txt @@ -8,10 +8,10 @@ target_include_directories(poisson PRIVATE ${CMAKE_BINARY_DIR}/include ${MPI_Fortran_INCLUDE_DIRS} - ${NVHPC_CUFFT_INCLUDE_DIR} + ${CUDECOMP_CUFFT_INCLUDE_DIR} ) target_link_libraries(poisson PRIVATE MPI::MPI_Fortran) -target_link_libraries(poisson PRIVATE NVHPC::CUFFT) +target_link_libraries(poisson PRIVATE ${CUDECOMP_CUFFT_TARGET}) target_link_libraries(poisson PRIVATE cudecomp) target_link_libraries(poisson PRIVATE cudecomp_fort) target_compile_options(poisson PRIVATE $<$:-cpp -cuda -gpu=${CUF_GPU_ARG}>) diff --git a/examples/fortran/taylor_green/CMakeLists.txt b/examples/fortran/taylor_green/CMakeLists.txt index e7f9c1c3..e2c5de85 100644 --- a/examples/fortran/taylor_green/CMakeLists.txt +++ b/examples/fortran/taylor_green/CMakeLists.txt @@ -9,10 +9,10 @@ target_include_directories(tg_fortran PRIVATE ${CMAKE_BINARY_DIR}/include ${MPI_Fortran_INCLUDE_DIRS} - ${NVHPC_CUFFT_INCLUDE_DIR} + ${CUDECOMP_CUFFT_INCLUDE_DIR} ) target_link_libraries(tg_fortran PRIVATE MPI::MPI_Fortran) -target_link_libraries(tg_fortran PRIVATE NVHPC::CUFFT) +target_link_libraries(tg_fortran PRIVATE ${CUDECOMP_CUFFT_TARGET}) target_link_libraries(tg_fortran PRIVATE cudecomp) target_link_libraries(tg_fortran PRIVATE cudecomp_fort) target_compile_options(tg_fortran PRIVATE $<$:-cpp -cuda -acc -gpu=${CUF_GPU_ARG}>) diff --git a/tests/cc/CMakeLists.txt b/tests/cc/CMakeLists.txt index 23b48730..68b6c91f 100644 --- a/tests/cc/CMakeLists.txt +++ b/tests/cc/CMakeLists.txt @@ -36,11 +36,11 @@ foreach(tgt ${transpose_test_targets_cc} ${halo_test_targets_cc}) ${CMAKE_CURRENT_SOURCE_DIR}/../../include ${MPI_CXX_INCLUDE_DIRS} ${NCCL_INCLUDE_DIR} - ${NVHPC_CUFFT_INCLUDE_DIR} - ${NVHPC_CUDA_INCLUDE_DIR} + ${CUDECOMP_CUFFT_INCLUDE_DIR} + ${CUDECOMP_CUDA_INCLUDE_DIR} ) target_link_libraries(${tgt} PRIVATE MPI::MPI_CXX) - target_link_libraries(${tgt} PRIVATE NVHPC::CUDART) + target_link_libraries(${tgt} PRIVATE ${CUDECOMP_CUDART_TARGET}) target_link_libraries(${tgt} PUBLIC cudecomp) target_compile_options(${tgt} PRIVATE -O3) endforeach() diff --git a/tests/ctest/CMakeLists.txt b/tests/ctest/CMakeLists.txt index d8b944c7..ca60b6a4 100644 --- a/tests/ctest/CMakeLists.txt +++ b/tests/ctest/CMakeLists.txt @@ -47,7 +47,7 @@ configure_file( add_library(cudecomp_test_support STATIC) if (NOT CUDECOMP_BUILD_CPU_ONLY) target_sources(cudecomp_test_support PRIVATE gpu_test_utils.cc) - target_link_libraries(cudecomp_test_support PUBLIC NVHPC::CUDART ${NCCL_LIBRARY}) + target_link_libraries(cudecomp_test_support PUBLIC ${CUDECOMP_CUDART_TARGET} ${CUDECOMP_NCCL_TARGET}) endif() target_sources(cudecomp_test_support PRIVATE @@ -62,7 +62,7 @@ target_include_directories(cudecomp_test_support ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../include ${CMAKE_BINARY_DIR}/include - ${NVHPC_CUDA_INCLUDE_DIR} + ${CUDECOMP_CUDA_INCLUDE_DIR} ${NCCL_INCLUDE_DIR} ) if (CUDECOMP_ENABLE_NVSHMEM) @@ -76,7 +76,7 @@ if (CUDECOMP_ENABLE_NVSHMEM) ) target_link_libraries(cudecomp_test_support PUBLIC - ${NVSHMEM_LIBRARY_DIR}/libnvshmem_host.so + ${CUDECOMP_NVSHMEM_HOST_TARGET} ) endif() target_link_libraries(cudecomp_test_support @@ -171,7 +171,7 @@ target_link_libraries(cudecomp_test_automatic_workspace PRIVATE cudecomp cudecomp_test_support - NVHPC::CUTENSOR + ${CUDECOMP_CUTENSOR_TARGET} ) set_target_properties(cudecomp_test_automatic_workspace PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests/ctest @@ -209,7 +209,7 @@ target_link_libraries(cudecomp_test_transpose PRIVATE cudecomp cudecomp_test_support - NVHPC::CUTENSOR + ${CUDECOMP_CUTENSOR_TARGET} ) set_target_properties(cudecomp_test_transpose PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests/ctest @@ -256,7 +256,7 @@ target_link_libraries(cudecomp_test_halo PRIVATE cudecomp cudecomp_test_support - NVHPC::CUTENSOR + ${CUDECOMP_CUTENSOR_TARGET} ) set_target_properties(cudecomp_test_halo PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests/ctest From eed142fc3123ce21370fd3aa208836d5219c7840 Mon Sep 17 00:00:00 2001 From: romerojosh Date: Tue, 6 Oct 2026 16:32:23 +0000 Subject: [PATCH 2/7] Report full NVHPC CUDA toolkit version Signed-off-by: romerojosh --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bec0ce05..ee2c0f80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -227,6 +227,14 @@ if (CUDECOMP_BUILD_FORTRAN) ) endif() set(CUDECOMP_NVFORTRAN_CUDA_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}") + string(REGEX MATCH "V([0-9]+\\.[0-9]+\\.[0-9]+)" + CUDECOMP_NVFORTRAN_NVCC_FULL_VERSION_MATCH + "${CUDECOMP_NVFORTRAN_NVCC_OUTPUT}") + if (CUDECOMP_NVFORTRAN_NVCC_FULL_VERSION_MATCH) + set(CUDECOMP_NVFORTRAN_CUDA_FULL_VERSION "${CMAKE_MATCH_1}") + else() + set(CUDECOMP_NVFORTRAN_CUDA_FULL_VERSION "${CUDECOMP_NVFORTRAN_CUDA_VERSION}") + endif() if (NOT CUDECOMP_NVFORTRAN_CUDA_VERSION STREQUAL CUDECOMP_CUDA_VERSION) message(FATAL_ERROR @@ -278,7 +286,7 @@ endif() if (CUDECOMP_BUILD_FORTRAN) message(STATUS " Fortran compiler: ${CMAKE_Fortran_COMPILER} (${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION})") if (CUDECOMP_NVFORTRAN_EXTERNAL_CUDA_OVERRIDE) - message(STATUS " NVHPC CUDA Toolkit: ${CUDECOMP_NVFORTRAN_CUDA_HOME} (${CUDECOMP_NVFORTRAN_CUDA_VERSION})") + message(STATUS " NVHPC CUDA Toolkit: ${CUDECOMP_NVFORTRAN_CUDA_HOME} (${CUDECOMP_NVFORTRAN_CUDA_FULL_VERSION})") endif() endif() message(STATUS " CUDA Toolkit: ${CUDAToolkit_LIBRARY_ROOT} (${CUDAToolkit_VERSION})") From 096982eb70155a418088740f13ceb9c7623179d9 Mon Sep 17 00:00:00 2001 From: romerojosh Date: Tue, 6 Oct 2026 16:54:34 +0000 Subject: [PATCH 3/7] Use relocatable CMake install paths Adopt GNUInstallDirs for installed artifacts and remove compatibility branches made unreachable by the CMake 3.18 minimum. Signed-off-by: romerojosh --- CMakeLists.txt | 24 +++++--------------- benchmark/CMakeLists.txt | 8 ++----- examples/cc/basic_usage/CMakeLists.txt | 8 ++----- examples/cc/taylor_green/CMakeLists.txt | 8 ++----- examples/fortran/basic_usage/CMakeLists.txt | 2 +- examples/fortran/poisson/CMakeLists.txt | 2 +- examples/fortran/taylor_green/CMakeLists.txt | 2 +- tests/cc/CMakeLists.txt | 2 +- tests/ctest/CMakeLists.txt | 6 +---- tests/fortran/CMakeLists.txt | 2 +- 10 files changed, 18 insertions(+), 46 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee2c0f80..b702a9af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,6 @@ cmake_minimum_required(VERSION 3.18) set(CMAKE_CXX_STANDARD 17) -if (CMAKE_VERSION VERSION_LESS "3.18") - # Workaround with older CMake versions to propagate C++17 standard flags - set(CMAKE_CUDA_FLAGS "-std=c++17") -endif() - set(CMAKE_DISABLE_SOURCE_CHANGES ON) set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) if (NOT CMAKE_BUILD_TYPE) @@ -92,6 +87,7 @@ list(JOIN CUDECOMP_VERSION_COMPONENTS "." CUDECOMP_VERSION) set(CUDECOMP_SOVERSION 0) project(cudecomp VERSION ${CUDECOMP_VERSION} LANGUAGES ${LANGS}) +include(GNUInstallDirs) if (CUDECOMP_BUILD_FORTRAN AND NOT CUDECOMP_BUILD_CPU_ONLY AND NOT CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") @@ -317,15 +313,7 @@ target_link_libraries(cudecomp PUBLIC MPI::MPI_CXX) if (CUDECOMP_BUILD_CPU_ONLY) target_sources(cudecomp PRIVATE src/cudecomp_kernels_cpu.cc) else() - # Set NVCC flags for requested compute capability - if (CMAKE_VERSION VERSION_LESS 3.18) - foreach(CUDA_CC ${CUDECOMP_CUDA_CC_LIST}) - list(APPEND CUDA_CC_FLAGS -gencode=arch=compute_${CUDA_CC},code=sm_${CUDA_CC}) - endforeach() - target_compile_options(cudecomp PRIVATE $<$: ${CUDA_CC_FLAGS}>) - else() - set_target_properties(cudecomp PROPERTIES CUDA_ARCHITECTURES "${CUDECOMP_CUDA_CC_LIST}") - endif() + set_target_properties(cudecomp PROPERTIES CUDA_ARCHITECTURES "${CUDECOMP_CUDA_CC_LIST}") target_compile_options(cudecomp PRIVATE $<$:-Wno-deprecated-gpu-targets >) @@ -428,8 +416,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/cudecomp_version.h ${CMAKE_BI install( TARGETS cudecomp - LIBRARY DESTINATION lib - PUBLIC_HEADER DESTINATION include + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) # Building Fortran shared lib and module @@ -470,13 +458,13 @@ if (CUDECOMP_BUILD_FORTRAN) install( TARGETS cudecomp_fort - LIBRARY DESTINATION lib + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) # Install cuDecomp modules install( FILES ${CMAKE_BINARY_DIR}/include/cudecomp.mod ${CMAKE_BINARY_DIR}/include/cudecomp_internal.mod - DESTINATION include + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) endif() diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index f0693cd5..3b297971 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -7,11 +7,7 @@ set(benchmark_targets foreach(tgt ${benchmark_targets}) add_executable(${tgt}) - if (CMAKE_VERSION VERSION_LESS 3.18) - target_compile_options(${tgt} PRIVATE $<$: ${CUDA_CC_FLAGS}>) - else() - set_target_properties(${tgt} PROPERTIES CUDA_ARCHITECTURES "${CUDECOMP_CUDA_CC_LIST}") - endif() + set_target_properties(${tgt} PROPERTIES CUDA_ARCHITECTURES "${CUDECOMP_CUDA_CC_LIST}") target_compile_options(${tgt} PRIVATE $<$:-Wno-deprecated-gpu-targets >) target_sources(${tgt} PRIVATE @@ -35,5 +31,5 @@ target_compile_definitions(benchmark_c2c_f PRIVATE C2C USE_FLOAT) install( TARGETS ${benchmark_targets} - RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/benchmark + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/benchmark ) diff --git a/examples/cc/basic_usage/CMakeLists.txt b/examples/cc/basic_usage/CMakeLists.txt index 08340f9e..3b47fa37 100644 --- a/examples/cc/basic_usage/CMakeLists.txt +++ b/examples/cc/basic_usage/CMakeLists.txt @@ -18,11 +18,7 @@ target_sources(basic_usage_autotune_cc foreach(tgt ${basic_usage_targets_cc}) string(REPLACE "_cc" "" bin_name ${tgt}) set_target_properties(${tgt} PROPERTIES OUTPUT_NAME ${bin_name}) - if (CMAKE_VERSION VERSION_LESS 3.18) - target_compile_options(${tgt} PRIVATE $<$: ${CUDA_CC_FLAGS}>) - else() - set_target_properties(${tgt} PROPERTIES CUDA_ARCHITECTURES "${CUDECOMP_CUDA_CC_LIST}") - endif() + set_target_properties(${tgt} PROPERTIES CUDA_ARCHITECTURES "${CUDECOMP_CUDA_CC_LIST}") target_compile_options(${tgt} PRIVATE $<$:-Wno-deprecated-gpu-targets >) target_include_directories(${tgt} PRIVATE @@ -36,5 +32,5 @@ endforeach() install( TARGETS ${basic_usage_targets_cc} - RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/examples/cc/basic_usage + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/examples/cc/basic_usage ) diff --git a/examples/cc/taylor_green/CMakeLists.txt b/examples/cc/taylor_green/CMakeLists.txt index 89778a1d..b3c72cc3 100644 --- a/examples/cc/taylor_green/CMakeLists.txt +++ b/examples/cc/taylor_green/CMakeLists.txt @@ -5,11 +5,7 @@ target_sources(tg tg.cu ) -if (CMAKE_VERSION VERSION_LESS 3.18) - target_compile_options(tg PRIVATE $<$: ${CUDA_CC_FLAGS}>) -else() - set_target_properties(tg PROPERTIES CUDA_ARCHITECTURES "${CUDECOMP_CUDA_CC_LIST}") -endif() +set_target_properties(tg PROPERTIES CUDA_ARCHITECTURES "${CUDECOMP_CUDA_CC_LIST}") target_compile_options(tg PRIVATE $<$:-Wno-deprecated-gpu-targets >) target_compile_options(tg PRIVATE $<$:-diag-suppress 177>) # Silence unused function warning @@ -26,5 +22,5 @@ set_target_properties(tg PROPERTIES LINKER_LANGUAGE CXX) install( TARGETS tg - RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/examples/cc/taylor_green + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/examples/cc/taylor_green ) diff --git a/examples/fortran/basic_usage/CMakeLists.txt b/examples/fortran/basic_usage/CMakeLists.txt index 78a5bb4d..fa016862 100644 --- a/examples/fortran/basic_usage/CMakeLists.txt +++ b/examples/fortran/basic_usage/CMakeLists.txt @@ -32,5 +32,5 @@ endforeach() install( TARGETS ${basic_usage_targets_f} - RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/examples/fortran/basic_usage + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/examples/fortran/basic_usage ) diff --git a/examples/fortran/poisson/CMakeLists.txt b/examples/fortran/poisson/CMakeLists.txt index a713af04..7607299e 100644 --- a/examples/fortran/poisson/CMakeLists.txt +++ b/examples/fortran/poisson/CMakeLists.txt @@ -19,5 +19,5 @@ target_link_options(poisson PRIVATE $<$:-cpp -cuda -gp install( TARGETS poisson - RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/examples/fortran/poisson + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/examples/fortran/poisson ) diff --git a/examples/fortran/taylor_green/CMakeLists.txt b/examples/fortran/taylor_green/CMakeLists.txt index e2c5de85..0bee2392 100644 --- a/examples/fortran/taylor_green/CMakeLists.txt +++ b/examples/fortran/taylor_green/CMakeLists.txt @@ -19,5 +19,5 @@ target_compile_options(tg_fortran PRIVATE $<$:-cpp -cu target_link_options(tg_fortran PRIVATE $<$:-cpp -cuda -acc -gpu=${CUF_GPU_ARG}>) install( TARGETS tg_fortran - RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/examples/fortran/taylor_green + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/examples/fortran/taylor_green ) diff --git a/tests/cc/CMakeLists.txt b/tests/cc/CMakeLists.txt index 68b6c91f..6d935ce5 100644 --- a/tests/cc/CMakeLists.txt +++ b/tests/cc/CMakeLists.txt @@ -57,5 +57,5 @@ target_compile_definitions(halo_test_C64_cc PRIVATE C64) install( TARGETS ${transpose_test_targets_cc} ${halo_test_targets_cc} - RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/tests/cc + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/tests/cc ) diff --git a/tests/ctest/CMakeLists.txt b/tests/ctest/CMakeLists.txt index ca60b6a4..03efd527 100644 --- a/tests/ctest/CMakeLists.txt +++ b/tests/ctest/CMakeLists.txt @@ -110,11 +110,7 @@ if (CUDECOMP_BUILD_CPU_ONLY) endif() add_executable(cudecomp_test_fortran_cpu_${kind} ${source}) target_compile_definitions(cudecomp_test_fortran_cpu_${kind} PRIVATE CUDECOMP_BUILD_CPU_ONLY) - if (CMAKE_VERSION VERSION_LESS 3.18) - target_compile_options(cudecomp_test_fortran_cpu_${kind} PRIVATE -cpp) - else() - set_target_properties(cudecomp_test_fortran_cpu_${kind} PROPERTIES Fortran_PREPROCESS ON) - endif() + set_target_properties(cudecomp_test_fortran_cpu_${kind} PROPERTIES Fortran_PREPROCESS ON) target_compile_options(cudecomp_test_fortran_cpu_${kind} PRIVATE $<$:-ffree-line-length-none>) target_include_directories(cudecomp_test_fortran_cpu_${kind} PRIVATE ${CMAKE_BINARY_DIR}/include) diff --git a/tests/fortran/CMakeLists.txt b/tests/fortran/CMakeLists.txt index 90a0328a..e061272f 100644 --- a/tests/fortran/CMakeLists.txt +++ b/tests/fortran/CMakeLists.txt @@ -56,5 +56,5 @@ target_compile_definitions(halo_test_C64_f PUBLIC C64) install( TARGETS ${transpose_test_targets_f} ${halo_test_targets_f} - RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/tests/fortran + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/tests/fortran ) From 2dcb5e665d3d86f66dbf66a217d03e80f652a0c4 Mon Sep 17 00:00:00 2001 From: romerojosh Date: Tue, 6 Oct 2026 16:59:27 +0000 Subject: [PATCH 4/7] Include algorithm declarations in API tests Signed-off-by: romerojosh --- tests/ctest/api_tests.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ctest/api_tests.cc b/tests/ctest/api_tests.cc index 0e9a15bb..d6bdec22 100644 --- a/tests/ctest/api_tests.cc +++ b/tests/ctest/api_tests.cc @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include #include From 221886ef88dbd69e6f91af85f355ad0a590e7ad1 Mon Sep 17 00:00:00 2001 From: romerojosh Date: Tue, 6 Oct 2026 17:28:12 +0000 Subject: [PATCH 5/7] Preserve versioned NVHPC dependency paths Signed-off-by: romerojosh --- CMakeLists.txt | 17 +++++++++++++++++ cmake/FindCUTENSOR.cmake | 19 +++++++++++++++++-- cmake/FindNCCL.cmake | 19 +++++++++++++++++-- cmake/FindNVSHMEM.cmake | 25 ++++++++++++++++++++++--- 4 files changed, 73 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b702a9af..0c18cc9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,23 @@ set(CUDECOMP_SOVERSION 0) project(cudecomp VERSION ${CUDECOMP_VERSION} LANGUAGES ${LANGS}) include(GNUInstallDirs) +# Locate a standard NVHPC SDK root without requiring its optional environment +# variables. Explicit dependency roots still take precedence in the find modules. +foreach(CUDECOMP_COMPILER IN ITEMS + "${CMAKE_CXX_COMPILER}" + "${CMAKE_CUDA_COMPILER}" + "${CMAKE_Fortran_COMPILER}") + if (CUDECOMP_COMPILER) + get_filename_component(CUDECOMP_COMPILER_REALPATH "${CUDECOMP_COMPILER}" REALPATH) + if (CUDECOMP_COMPILER_REALPATH MATCHES "^(.+)/compilers/bin/[^/]+$") + set(CUDECOMP_NVHPC_SDK_ROOT "${CMAKE_MATCH_1}") + break() + endif() + endif() +endforeach() +unset(CUDECOMP_COMPILER) +unset(CUDECOMP_COMPILER_REALPATH) + if (CUDECOMP_BUILD_FORTRAN AND NOT CUDECOMP_BUILD_CPU_ONLY AND NOT CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") message(FATAL_ERROR "The cuDecomp Fortran bindings require nvfortran.") diff --git a/cmake/FindCUTENSOR.cmake b/cmake/FindCUTENSOR.cmake index 16611ecb..ecbe4113 100644 --- a/cmake/FindCUTENSOR.cmake +++ b/cmake/FindCUTENSOR.cmake @@ -43,8 +43,21 @@ if (_CUTENSOR_ROOT) NO_DEFAULT_PATH ) else() - find_path(CUTENSOR_INCLUDE_DIR NAMES cutensor.h PATHS ENV CPATH) - find_library(CUTENSOR_LIBRARY NAMES cutensor PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) + set(_CUTENSOR_NVHPC_ROOT + "${CUDECOMP_NVHPC_SDK_ROOT}/math_libs/${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}") + if (CUDECOMP_NVHPC_SDK_ROOT AND IS_DIRECTORY "${_CUTENSOR_NVHPC_ROOT}") + list(APPEND _CUTENSOR_PATHS "${_CUTENSOR_NVHPC_ROOT}") + endif() + find_path(CUTENSOR_INCLUDE_DIR + NAMES cutensor.h + PATHS ${_CUTENSOR_PATHS} ENV CPATH + PATH_SUFFIXES ${_CUTENSOR_INCLUDE_SUFFIXES} + ) + find_library(CUTENSOR_LIBRARY + NAMES cutensor + PATHS ${_CUTENSOR_PATHS} ENV LIBRARY_PATH ENV LD_LIBRARY_PATH + PATH_SUFFIXES ${_CUTENSOR_LIBRARY_SUFFIXES} + ) endif() if (CUTENSOR_INCLUDE_DIR) @@ -79,6 +92,8 @@ unset(_CUTENSOR_TARGET_NAMES) unset(_CUTENSOR_TARGET_NAME) unset(_CUTENSOR_INCLUDE_SUFFIXES) unset(_CUTENSOR_LIBRARY_SUFFIXES) +unset(_CUTENSOR_NVHPC_ROOT) +unset(_CUTENSOR_PATHS) unset(_CUTENSOR_VERSION_LINES) unset(_CUTENSOR_VERSION_LINE) unset(_CUTENSOR_COMPONENT) diff --git a/cmake/FindNCCL.cmake b/cmake/FindNCCL.cmake index bbac7783..1b0f87cb 100644 --- a/cmake/FindNCCL.cmake +++ b/cmake/FindNCCL.cmake @@ -27,8 +27,21 @@ if (_NCCL_ROOT) NO_DEFAULT_PATH ) else() - find_path(NCCL_INCLUDE_DIR NAMES nccl.h PATHS ENV CPATH) - find_library(NCCL_LIBRARY NAMES nccl PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) + set(_NCCL_NVHPC_ROOT + "${CUDECOMP_NVHPC_SDK_ROOT}/comm_libs/${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}/nccl") + if (CUDECOMP_NVHPC_SDK_ROOT AND IS_DIRECTORY "${_NCCL_NVHPC_ROOT}") + list(APPEND _NCCL_PATHS "${_NCCL_NVHPC_ROOT}") + endif() + find_path(NCCL_INCLUDE_DIR + NAMES nccl.h + PATHS ${_NCCL_PATHS} ENV CPATH + PATH_SUFFIXES include + ) + find_library(NCCL_LIBRARY + NAMES nccl + PATHS ${_NCCL_PATHS} ENV LIBRARY_PATH ENV LD_LIBRARY_PATH + PATH_SUFFIXES lib lib64 + ) endif() if (NCCL_INCLUDE_DIR) @@ -59,6 +72,8 @@ endif() mark_as_advanced(NCCL_INCLUDE_DIR NCCL_LIBRARY) unset(_NCCL_ROOT) +unset(_NCCL_NVHPC_ROOT) +unset(_NCCL_PATHS) unset(_NCCL_VERSION_LINES) unset(_NCCL_VERSION_LINE) unset(_NCCL_COMPONENT) diff --git a/cmake/FindNVSHMEM.cmake b/cmake/FindNVSHMEM.cmake index 782e7368..bc9b2c21 100644 --- a/cmake/FindNVSHMEM.cmake +++ b/cmake/FindNVSHMEM.cmake @@ -33,9 +33,26 @@ if (_NVSHMEM_ROOT) NO_DEFAULT_PATH ) else() - find_path(NVSHMEM_INCLUDE_DIR NAMES nvshmem.h PATHS ENV CPATH) - find_library(NVSHMEM_HOST_LIBRARY NAMES nvshmem_host PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) - find_library(NVSHMEM_DEVICE_LIBRARY NAMES nvshmem_device PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) + set(_NVSHMEM_NVHPC_ROOT + "${CUDECOMP_NVHPC_SDK_ROOT}/comm_libs/${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}/nvshmem") + if (CUDECOMP_NVHPC_SDK_ROOT AND IS_DIRECTORY "${_NVSHMEM_NVHPC_ROOT}") + list(APPEND _NVSHMEM_PATHS "${_NVSHMEM_NVHPC_ROOT}") + endif() + find_path(NVSHMEM_INCLUDE_DIR + NAMES nvshmem.h + PATHS ${_NVSHMEM_PATHS} ENV CPATH + PATH_SUFFIXES include + ) + find_library(NVSHMEM_HOST_LIBRARY + NAMES nvshmem_host + PATHS ${_NVSHMEM_PATHS} ENV LIBRARY_PATH ENV LD_LIBRARY_PATH + PATH_SUFFIXES lib lib64 + ) + find_library(NVSHMEM_DEVICE_LIBRARY + NAMES nvshmem_device + PATHS ${_NVSHMEM_PATHS} ENV LIBRARY_PATH ENV LD_LIBRARY_PATH + PATH_SUFFIXES lib lib64 + ) endif() find_package_handle_standard_args(NVSHMEM @@ -60,3 +77,5 @@ endif() mark_as_advanced(NVSHMEM_INCLUDE_DIR NVSHMEM_HOST_LIBRARY NVSHMEM_DEVICE_LIBRARY) unset(_NVSHMEM_ROOT) +unset(_NVSHMEM_NVHPC_ROOT) +unset(_NVSHMEM_PATHS) From 0bfda6d2cc3330be72d8ccfa5b11a565ac2fe16a Mon Sep 17 00:00:00 2001 From: romerojosh Date: Tue, 6 Oct 2026 17:41:54 +0000 Subject: [PATCH 6/7] Find cuFFT headers alongside the selected library Signed-off-by: romerojosh --- CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c18cc9f..1df0424d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,6 +179,17 @@ find_package(CUTENSOR REQUIRED) set(CUDECOMP_CUDART_TARGET CUDA::cudart) set(CUDECOMP_CUTENSOR_TARGET CUTENSOR::CUTENSOR) set(CUDECOMP_CUFFT_TARGET CUDA::cufft) +get_target_property(CUDECOMP_CUFFT_LIBRARY ${CUDECOMP_CUFFT_TARGET} IMPORTED_LOCATION) +get_filename_component(CUDECOMP_CUFFT_LIBRARY_DIR "${CUDECOMP_CUFFT_LIBRARY}" DIRECTORY) +get_filename_component(CUDECOMP_CUFFT_ROOT "${CUDECOMP_CUFFT_LIBRARY_DIR}" DIRECTORY) +find_path(CUDECOMP_CUFFT_INCLUDE_DIR + NAMES cufft.h + HINTS ${CUDAToolkit_INCLUDE_DIRS} "${CUDECOMP_CUFFT_ROOT}/include" + PATHS ENV CPATH + REQUIRED +) +unset(CUDECOMP_CUFFT_LIBRARY_DIR) +unset(CUDECOMP_CUFFT_ROOT) set(CUDECOMP_CUDA_VERSION "${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}") set(CUDECOMP_CUDA_INCLUDE_DIR "${CUDAToolkit_INCLUDE_DIRS}") foreach(CUDECOMP_CUDA_INCLUDE_ROOT IN LISTS CUDAToolkit_INCLUDE_DIRS) @@ -187,7 +198,6 @@ foreach(CUDECOMP_CUDA_INCLUDE_ROOT IN LISTS CUDAToolkit_INCLUDE_DIRS) endif() endforeach() set(CUDECOMP_CUTENSOR_INCLUDE_DIR "${CUTENSOR_INCLUDE_DIR}") -set(CUDECOMP_CUFFT_INCLUDE_DIR "${CUDAToolkit_INCLUDE_DIRS}") set(CUDECOMP_CUDA_STUBS_DIR "${CUDAToolkit_LIBRARY_DIR}/stubs") if (CUDECOMP_BUILD_FORTRAN) @@ -353,6 +363,7 @@ else() ${CMAKE_CURRENT_SOURCE_DIR}/include ${MPI_CXX_INCLUDE_DIRS} ${CUDECOMP_CUDA_INCLUDE_DIR} + ${CUDECOMP_CUFFT_INCLUDE_DIR} ${CUDECOMP_CUTENSOR_INCLUDE_DIR} ${NCCL_INCLUDE_DIR} ) From 340d325326a3992f970a12870fa7ee0e5e8012bf Mon Sep 17 00:00:00 2001 From: romerojosh Date: Tue, 6 Oct 2026 17:54:35 +0000 Subject: [PATCH 7/7] Report configured CUDA compute capabilities Signed-off-by: romerojosh --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1df0424d..d5467f44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -313,6 +313,7 @@ endif() endif() endif() message(STATUS " CUDA Toolkit: ${CUDAToolkit_LIBRARY_ROOT} (${CUDAToolkit_VERSION})") + message(STATUS " CUDA compute capabilities: ${CUDECOMP_CUDA_CC_LIST}") message(STATUS " CUTENSOR: ${CUTENSOR_LIBRARY} (${CUTENSOR_VERSION})") message(STATUS " NCCL: ${NCCL_LIBRARY} (${NCCL_VERSION})") if (CUDECOMP_ENABLE_NVSHMEM)