diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d262aaef8..7aeb7773fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ # limitations under the License. -cmake_minimum_required(VERSION 3.24 FATAL_ERROR) +cmake_minimum_required(VERSION 3.25 FATAL_ERROR) list(APPEND CMAKE_MESSAGE_CONTEXT "morpheus") diff --git a/ci/conda/recipes/morpheus/meta.yaml b/ci/conda/recipes/morpheus/meta.yaml index 5bd1da8b98..456a090abb 100644 --- a/ci/conda/recipes/morpheus/meta.yaml +++ b/ci/conda/recipes/morpheus/meta.yaml @@ -33,8 +33,9 @@ outputs: # Note: Setting a default value here will overwrite the value from the # shell! Defaults should be set in the run_conda_build.sh script - CMAKE_CUDA_ARCHITECTURES - - MORPHEUS_PYTHON_BUILD_STUBS - MORPHEUS_CACHE_DIR + - MORPHEUS_PYTHON_BUILD_STUBS + - MORPHEUS_SUPPORT_DOCA - PARALLEL_LEVEL run_exports: - {{ pin_subpackage("morpheus", max_pin="x.x") }} @@ -47,9 +48,11 @@ outputs: - {{ compiler("c") }} - {{ compiler("cxx") }} - {{ compiler("cuda") }} + - automake 1.16.5 # Needed for DOCA build - ccache - - cmake 3.24 + - cmake 3.25 - cuda-cudart-dev {{ cuda_compiler_version }} # Needed by CMake to compile a test application + - libtool # Needed for DOCA build - ninja host: - cuda-toolkit {{ cuda_compiler_version }} @@ -63,6 +66,7 @@ outputs: - pybind11-stubgen 0.10.5 - python {{ python }} - rapidjson 1.1 + - rdma-core >=48 # Needed for DOCA. Compatible with UCX 1.14.1 - scikit-build 0.17.1 - versioneer-518 run: diff --git a/ci/conda/recipes/morpheus/morpheus_build.sh b/ci/conda/recipes/morpheus/morpheus_build.sh index f45aa3cc1b..679c80892e 100644 --- a/ci/conda/recipes/morpheus/morpheus_build.sh +++ b/ci/conda/recipes/morpheus/morpheus_build.sh @@ -16,6 +16,9 @@ # It is assumed that this script is executed from the root of the repo directory by conda-build # (https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake) +# Need to ensure this value is set before checking it in the if block +MORPHEUS_SUPPORT_DOCA=${MORPHEUS_SUPPORT_DOCA:-OFF} + # This will store all of the cmake args. Make sure to prepend args to allow # incoming values to overwrite them CMAKE_ARGS=${CMAKE_ARGS:-""} @@ -32,6 +35,15 @@ if [[ -n "${MORPHEUS_CACHE_DIR}" ]]; then mkdir -p ${MORPHEUS_CACHE_DIR} fi +if [[ ${MORPHEUS_SUPPORT_DOCA} == @(TRUE|ON) ]]; then + CMAKE_ARGS="-DMORPHEUS_SUPPORT_DOCA=ON ${CMAKE_ARGS}" + + # Set the CMAKE_CUDA_ARCHITECTURES to just 80;86 since that is what DOCA supports for now + CMAKE_CUDA_ARCHITECTURES="80;86" + + echo "MORPHEUS_SUPPORT_DOCA is ON. Setting CMAKE_CUDA_ARCHITECTURES to supported values: '${CMAKE_CUDA_ARCHITECTURES}'" +fi + CMAKE_ARGS="-DCMAKE_MESSAGE_CONTEXT_SHOW=ON ${CMAKE_ARGS}" CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX=$PREFIX ${CMAKE_ARGS}" CMAKE_ARGS="-DCMAKE_INSTALL_LIBDIR=lib ${CMAKE_ARGS}" @@ -45,6 +57,7 @@ CMAKE_ARGS="-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON ${CMAKE_ARGS}" CMAKE_ARGS="-DCMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES=-"RAPIDS"} ${CMAKE_ARGS}" CMAKE_ARGS="-DPython_EXECUTABLE=${PYTHON} ${CMAKE_ARGS}" CMAKE_ARGS="-DPYTHON_EXECUTABLE=${PYTHON} ${CMAKE_ARGS}" # for pybind11 +CMAKE_ARGS="--log-level=VERBOSE ${CMAKE_ARGS}" if [[ "${USE_SCCACHE}" == "1" ]]; then CMAKE_ARGS="-DCCACHE_PROGRAM_PATH=$(which sccache) ${CMAKE_ARGS}" diff --git a/ci/conda/recipes/run_conda_build.sh b/ci/conda/recipes/run_conda_build.sh index 094543f139..3a52e10190 100755 --- a/ci/conda/recipes/run_conda_build.sh +++ b/ci/conda/recipes/run_conda_build.sh @@ -90,6 +90,7 @@ fi # And default channels (with optional channel alias) CONDA_ARGS_ARRAY+=("-c" "${CONDA_CHANNEL_ALIAS:+"${CONDA_CHANNEL_ALIAS%/}/"}rapidsai") +CONDA_ARGS_ARRAY+=("-c" "${CONDA_CHANNEL_ALIAS:+"${CONDA_CHANNEL_ALIAS%/}/"}nvidia/label/cuda-11.8.0") CONDA_ARGS_ARRAY+=("-c" "${CONDA_CHANNEL_ALIAS:+"${CONDA_CHANNEL_ALIAS%/}/"}nvidia") CONDA_ARGS_ARRAY+=("-c" "${CONDA_CHANNEL_ALIAS:+"${CONDA_CHANNEL_ALIAS%/}/"}nvidia/label/dev") CONDA_ARGS_ARRAY+=("-c" "${CONDA_CHANNEL_ALIAS:+"${CONDA_CHANNEL_ALIAS%/}/"}pytorch") diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 856cae2f41..c01516fa29 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -17,9 +17,8 @@ list(APPEND CMAKE_MESSAGE_CONTEXT "dep") morpheus_utils_initialize_cpm(MORPHEUS_CACHE_DIR) -if (VERBOSE) - morpheus_utils_print_config() -endif() + +morpheus_utils_print_config() # First, load the package_config functions include(${CMAKE_CURRENT_LIST_DIR}/package_config/register_api.cmake) diff --git a/cmake/package_search/Finddoca.cmake b/cmake/package_search/Finddoca.cmake index 88915f27ae..77c07f865d 100644 --- a/cmake/package_search/Finddoca.cmake +++ b/cmake/package_search/Finddoca.cmake @@ -15,9 +15,6 @@ # Often this is installed in /opt/mellanox/doca. If so, run `set(doca_ROOT "/opt/mellanox/doca")` before calling this # file -# List of required args. Start with INCLUDE_DIR since the first one is displayed -list(APPEND doca_REQUIRED_VARS doca_INCLUDE_DIR) - if(DEFINED doca_ROOT) # Usually, dpdk is up and over one # /opt/mellanox/doca @@ -29,113 +26,120 @@ if(DEFINED doca_ROOT) endif() # Now find DPDK -find_package(libdpdk QUIET) -list(APPEND doca_REQUIRED_VARS libdpdk_FOUND) - -# CMAKE_LIBRARY_ARCHITECTURE needs to be set for this to work correctly. Save the value so we can restore -set(_saved_CMAKE_LIBRARY_ARCHITECTURE ${CMAKE_LIBRARY_ARCHITECTURE}) - -if(NOT DEFINED CMAKE_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE x86_64-linux-gnu) -endif() +find_package(libdpdk) -# Find the include path -find_path( - doca_INCLUDE_DIR doca_gpunetio.h -) -mark_as_advanced(doca_INCLUDE_DIR) - -# Find all of the libraries -list(APPEND doca_REQUIRED_LIBS - doca_eth - doca_flow - doca_gpunetio - doca_gpunetio_device +# Create a scope to allow variables to be set locally without altering the parent scope +block(SCOPE_FOR VARIABLES + PROPAGATE + doca_FOUND + doca_VERSION ) -foreach(library_name IN LISTS doca_REQUIRED_LIBS) - find_library( - ${library_name}_LIBRARY - NAMES ${library_name} - ) - mark_as_advanced(${library_name}_LIBRARY) - list(APPEND doca_REQUIRED_VARS ${library_name}_LIBRARY) -endforeach() + # List of required args. Start with INCLUDE_DIR since the first one is displayed + list(APPEND doca_REQUIRED_VARS libdpdk_FOUND doca_INCLUDE_DIR) -macro(parse_define_number define_name file_string output_variable) - string(REGEX MATCH "#define ${define_name} ([^\n]+)\n" _ "${file_string}") - set(${output_variable} "${CMAKE_MATCH_1}") -endmacro() + # This library will always be installed on the host. Allow that to be searched here (Should fix this up in the future) + set("CMAKE_FIND_ROOT_PATH_MODE_INCLUDE" BOTH) + set("CMAKE_FIND_ROOT_PATH_MODE_LIBRARY" BOTH) -macro(parse_define_string define_name file_string output_variable) - string(REGEX MATCH "#define ${define_name} \"([^\n]+)\"\n" _ "${file_string}") - set(${output_variable} "${CMAKE_MATCH_1}") -endmacro() + # CMAKE_LIBRARY_ARCHITECTURE needs to be set for this to work correctly. Will be restored at the end of the block + if(NOT DEFINED CMAKE_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE x86_64-linux-gnu) + endif() -# Parse the version number -if (DEFINED doca_INCLUDE_DIR) + # Find the include path + find_path( + doca_INCLUDE_DIR doca_gpunetio.h + ) + mark_as_advanced(doca_INCLUDE_DIR) + + # Find all of the libraries + list(APPEND doca_REQUIRED_LIBS + doca_eth + doca_flow + doca_gpunetio + doca_gpunetio_device + ) - message(VERBOSE "doca_INCLUDE_DIR: ${doca_INCLUDE_DIR}") + foreach(library_name IN LISTS doca_REQUIRED_LIBS) + find_library( + ${library_name}_LIBRARY + NAMES ${library_name} + ) + mark_as_advanced(${library_name}_LIBRARY) + list(APPEND doca_REQUIRED_VARS ${library_name}_LIBRARY) + endforeach() - find_file(doca_VERSION_FILE - NAMES doca_version.h - PATHS ${doca_INCLUDE_DIR} - NO_DEFAULT_PATH - ) - mark_as_advanced(doca_VERSION_FILE) + macro(parse_define_number define_name file_string output_variable) + string(REGEX MATCH "#define ${define_name} ([^\n]+)\n" _ "${file_string}") + set(${output_variable} "${CMAKE_MATCH_1}") + endmacro() - if (DEFINED doca_VERSION_FILE) - message(VERBOSE "doca_VERSION_FILE: ${doca_VERSION_FILE}") + macro(parse_define_string define_name file_string output_variable) + string(REGEX MATCH "#define ${define_name} \"([^\n]+)\"\n" _ "${file_string}") + set(${output_variable} "${CMAKE_MATCH_1}") + endmacro() - file(READ ${doca_VERSION_FILE} version_file_string) + # Parse the version number + if (DEFINED doca_INCLUDE_DIR) - parse_define_string(DOCA_VER_STRING "${version_file_string}" doca_FULL_VERSION) - parse_define_number(DOCA_VER_MAJOR "${version_file_string}" doca_MAJOR_VERSION) - parse_define_number(DOCA_VER_MINOR "${version_file_string}" doca_MINOR_VERSION) - parse_define_number(DOCA_VER_PATCH "${version_file_string}" doca_PATCH_VERSION) + find_file(doca_VERSION_FILE + NAMES doca_version.h + PATHS ${doca_INCLUDE_DIR} + NO_DEFAULT_PATH + ) + mark_as_advanced(doca_VERSION_FILE) - # Set the version variable - set(doca_VERSION "${doca_FULL_VERSION}") + if (DEFINED doca_VERSION_FILE) - endif() + file(READ ${doca_VERSION_FILE} version_file_string) -endif() + parse_define_string(DOCA_VER_STRING "${version_file_string}" doca_VERSION_FULL) + parse_define_number(DOCA_VER_MAJOR "${version_file_string}" doca_VERSION_MAJOR) + parse_define_number(DOCA_VER_MINOR "${version_file_string}" doca_VERSION_MINOR) + parse_define_number(DOCA_VER_PATCH "${version_file_string}" doca_VERSION_PATCH) -# Restore CMAKE_LIBRARY_ARCHITECTURE now that we are done -set(CMAKE_LIBRARY_ARCHITECTURE ${_saved_CMAKE_LIBRARY_ARCHITECTURE}) + # Set the version variable + set(doca_VERSION "${doca_VERSION_FULL}") -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(doca - FOUND_VAR doca_FOUND - REQUIRED_VARS - ${doca_REQUIRED_VARS} - VERSION_VAR doca_VERSION -) + endif() -if(doca_FOUND) + endif() - list(APPEND doca_child_targets) + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(doca + FOUND_VAR doca_FOUND + REQUIRED_VARS + ${doca_REQUIRED_VARS} + VERSION_VAR doca_VERSION + ) - foreach(library_name IN LISTS doca_REQUIRED_LIBS) - if(NOT TARGET doca::${library_name}) - add_library(${library_name} UNKNOWN IMPORTED GLOBAL) - add_library(doca::${library_name} ALIAS ${library_name}) - set_target_properties(${library_name} PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION "${${library_name}_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${doca_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "libdpdk::libdpdk" + if(doca_FOUND) + + list(APPEND doca_child_targets) + + foreach(library_name IN LISTS doca_REQUIRED_LIBS) + if(NOT TARGET doca::${library_name}) + add_library(${library_name} UNKNOWN IMPORTED GLOBAL) + add_library(doca::${library_name} ALIAS ${library_name}) + set_target_properties(${library_name} PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${${library_name}_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${doca_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "libdpdk::libdpdk" + ) + + # Add to the list of dependent targets + list(APPEND doca_child_targets doca::${library_name}) + endif() + endforeach() + + if(NOT TARGET doca::doca) + add_library(doca::doca INTERFACE IMPORTED GLOBAL) + set_target_properties(doca::doca PROPERTIES + INTERFACE_LINK_LIBRARIES "${doca_child_targets}" ) - - # Add to the list of dependent targets - list(APPEND doca_child_targets doca::${library_name}) endif() - endforeach() - - if(NOT TARGET doca::doca) - add_library(doca::doca INTERFACE IMPORTED GLOBAL) - set_target_properties(doca::doca PROPERTIES - INTERFACE_LINK_LIBRARIES "${doca_child_targets}" - ) endif() -endif() + +endblock() diff --git a/cmake/package_search/Findlibdpdk.cmake b/cmake/package_search/Findlibdpdk.cmake index d873869a4e..fcfd1e7fb9 100644 --- a/cmake/package_search/Findlibdpdk.cmake +++ b/cmake/package_search/Findlibdpdk.cmake @@ -12,89 +12,84 @@ # the License. # ============================================================================= -# Often this is installed in /opt/mellanox/libdpdk. If so, run `set(libdpdk_ROOT "/opt/mellanox/libdpdk")` before calling this +# Often this is installed in /opt/mellanox/dpdk. If so, run `set(libdpdk_ROOT "/opt/mellanox/dpdk")` before calling this # file -# List of required args. Start with INCLUDE_DIR since the first one is displayed - -list(APPEND libdpdk_REQUIRED_VARS libdpdk_INCLUDE_DIR) - # Find BSD -find_package(bsd QUIET) -list(APPEND doca_REQUIRED_VARS bsd_FOUND) - -# CMAKE_LIBRARY_ARCHITECTURE needs to be set for this to work correctly. Save the value so we can restore -set(_saved_CMAKE_LIBRARY_ARCHITECTURE ${CMAKE_LIBRARY_ARCHITECTURE}) - -if(NOT DEFINED CMAKE_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE x86_64-linux-gnu) -endif() - -# Find the include path -find_path( - libdpdk_INCLUDE_DIR rte_eal.h - PATH_SUFFIXES dpdk -) -mark_as_advanced(libdpdk_INCLUDE_DIR) +find_package(bsd) -# Find all of the libraries -list(APPEND libdpdk_REQUIRED_LIBS - rte_eal +# Create a scope to allow variables to be set locally without altering the parent scope +block(SCOPE_FOR VARIABLES + PROPAGATE + libdpdk_FOUND + libdpdk_VERSION ) -foreach(library_name IN LISTS libdpdk_REQUIRED_LIBS) - find_library( - ${library_name}_LIBRARY - NAMES ${library_name} - ) - mark_as_advanced(${library_name}_LIBRARY) - list(APPEND libdpdk_REQUIRED_VARS ${library_name}_LIBRARY) -endforeach() + # List of required args. Start with INCLUDE_DIR since the first one is displayed + list(APPEND libdpdk_REQUIRED_VARS bsd_FOUND libdpdk_INCLUDE_DIR) -macro(parse_define_number define_name file_string output_variable) - string(REGEX MATCH "#define ${define_name} ([^\n]+)\n" _ "${file_string}") - set(${output_variable} "${CMAKE_MATCH_1}") -endmacro() + # CMAKE_LIBRARY_ARCHITECTURE needs to be set for this to work correctly. Will be restored at the end of the block + if(NOT DEFINED CMAKE_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE x86_64-linux-gnu) + endif() -macro(parse_define_string define_name file_string output_variable) - string(REGEX MATCH "#define ${define_name} \"([^\n]+)\"\n" _ "${file_string}") - set(${output_variable} "${CMAKE_MATCH_1}") -endmacro() + # This library will always be installed on the host. Allow that to be searched here (Should fix this up in the future) + set("CMAKE_FIND_ROOT_PATH_MODE_INCLUDE" BOTH) + set("CMAKE_FIND_ROOT_PATH_MODE_LIBRARY" BOTH) -# Restore CMAKE_LIBRARY_ARCHITECTURE now that we are done -set(CMAKE_LIBRARY_ARCHITECTURE ${_saved_CMAKE_LIBRARY_ARCHITECTURE}) + # Find the include path + find_path( + libdpdk_INCLUDE_DIR rte_eal.h + PATH_SUFFIXES dpdk + ) + mark_as_advanced(libdpdk_INCLUDE_DIR) -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(libdpdk - FOUND_VAR libdpdk_FOUND - REQUIRED_VARS - ${libdpdk_REQUIRED_VARS} -) + # Find all of the libraries + list(APPEND libdpdk_REQUIRED_LIBS + rte_eal + ) -if(libdpdk_FOUND) + foreach(library_name IN LISTS libdpdk_REQUIRED_LIBS) + find_library( + ${library_name}_LIBRARY + NAMES ${library_name} + ) + mark_as_advanced(${library_name}_LIBRARY) + list(APPEND libdpdk_REQUIRED_VARS ${library_name}_LIBRARY) + endforeach() - list(APPEND libdpdk_child_targets) + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(libdpdk + FOUND_VAR libdpdk_FOUND + REQUIRED_VARS + ${libdpdk_REQUIRED_VARS} + ) - foreach(library_name IN LISTS libdpdk_REQUIRED_LIBS) - if(NOT TARGET libdpdk::${library_name}) - add_library(${library_name} SHARED IMPORTED GLOBAL) - add_library(libdpdk::${library_name} ALIAS ${library_name}) - set_target_properties(${library_name} PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION "${${library_name}_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${libdpdk_INCLUDE_DIR};${libdpdk_INCLUDE_DIR}/../x86_64-linux-gnu/dpdk" - INTERFACE_LINK_LIBRARIES "bsd::bsd" + if(libdpdk_FOUND) + + list(APPEND libdpdk_child_targets) + + foreach(library_name IN LISTS libdpdk_REQUIRED_LIBS) + if(NOT TARGET libdpdk::${library_name}) + add_library(${library_name} SHARED IMPORTED GLOBAL) + add_library(libdpdk::${library_name} ALIAS ${library_name}) + set_target_properties(${library_name} PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${${library_name}_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${libdpdk_INCLUDE_DIR};${libdpdk_INCLUDE_DIR}/../x86_64-linux-gnu/dpdk" + INTERFACE_LINK_LIBRARIES "bsd::bsd" + ) + + # Add to the list of dependent targets + list(APPEND libdpdk_child_targets libdpdk::${library_name}) + endif() + endforeach() + + if(NOT TARGET libdpdk::libdpdk) + add_library(libdpdk::libdpdk INTERFACE IMPORTED) + set_target_properties(libdpdk::libdpdk PROPERTIES + INTERFACE_LINK_LIBRARIES "${libdpdk_child_targets}" ) - - # Add to the list of dependent targets - list(APPEND libdpdk_child_targets libdpdk::${library_name}) endif() - endforeach() - - if(NOT TARGET libdpdk::libdpdk) - add_library(libdpdk::libdpdk INTERFACE IMPORTED) - set_target_properties(libdpdk::libdpdk PROPERTIES - INTERFACE_LINK_LIBRARIES "${libdpdk_child_targets}" - ) endif() -endif() +endblock() diff --git a/docker/conda/environments/cuda11.8_dev.yml b/docker/conda/environments/cuda11.8_dev.yml index 8235cdc6c1..c4d38cfe18 100644 --- a/docker/conda/environments/cuda11.8_dev.yml +++ b/docker/conda/environments/cuda11.8_dev.yml @@ -31,7 +31,7 @@ dependencies: - ccache>=3.7 - clangdev=16 - click >=8 - - cmake=3.24 + - cmake=3.25 - configargparse=1.5 - cuda-compiler=11.8 - cuda-nvml-dev=11.8 @@ -95,8 +95,9 @@ dependencies: - pytorch-cuda - pytorch=2.0.1 - rapidjson=1.1.0 - - requests=2.31 + - rdma-core >=48 # Needed for DOCA. Compatible with UCX 1.14.1 - requests-cache=1.1 + - requests=2.31 - scikit-build=0.17.1 - scikit-learn=1.2.2 - sphinx diff --git a/external/morpheus-visualizations b/external/morpheus-visualizations index bc1aa508b5..3f2b340cea 160000 --- a/external/morpheus-visualizations +++ b/external/morpheus-visualizations @@ -1 +1 @@ -Subproject commit bc1aa508b5540fbbf2af50bafe1a49c0d9750fe1 +Subproject commit 3f2b340ceae9b2eaddaa4be6db47cab74271a8f9 diff --git a/external/utilities b/external/utilities index 486ff32e77..2c26582577 160000 --- a/external/utilities +++ b/external/utilities @@ -1 +1 @@ -Subproject commit 486ff32e77f504624545c82dfb9e39d65e79b572 +Subproject commit 2c26582577de9c9101f7e7c1bda3d7cc90344fb3