diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake index e4c3e511bd..442737d844 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -600,6 +600,7 @@ endif() if(onnxruntime_ENABLE_DLPACK) message(STATUS "dlpack is enabled.") + onnxruntime_fetchcontent_declare( dlpack URL ${DEP_URL_dlpack} @@ -607,9 +608,8 @@ if(onnxruntime_ENABLE_DLPACK) EXCLUDE_FROM_ALL FIND_PACKAGE_ARGS NAMES dlpack ) - # We can't use onnxruntime_fetchcontent_makeavailable since some part of the the dlpack code is Linux only. - # For example, dlpackcpp.h uses posix_memalign. - FetchContent_Populate(dlpack) + onnxruntime_fetchcontent_makeavailable(dlpack) + endif() endif() if(onnxruntime_ENABLE_TRAINING OR (onnxruntime_ENABLE_TRAINING_APIS AND onnxruntime_BUILD_UNIT_TESTS)) diff --git a/cmake/onnxruntime_framework.cmake b/cmake/onnxruntime_framework.cmake index 969d604c88..cfed6c4e96 100644 --- a/cmake/onnxruntime_framework.cmake +++ b/cmake/onnxruntime_framework.cmake @@ -77,8 +77,7 @@ endif() if (onnxruntime_ENABLE_TRAINING_OPS) target_include_directories(onnxruntime_framework PRIVATE ${ORTTRAINING_ROOT}) if (onnxruntime_ENABLE_TRAINING_TORCH_INTEROP OR onnxruntime_ENABLE_TRITON) - onnxruntime_add_include_to_target(onnxruntime_framework Python::Module) - target_include_directories(onnxruntime_framework PRIVATE ${dlpack_SOURCE_DIR}/include) + onnxruntime_add_include_to_target(onnxruntime_framework Python::Module dlpack::dlpack) endif() endif() if (onnxruntime_USE_MPI) @@ -86,9 +85,7 @@ if (onnxruntime_USE_MPI) endif() if (onnxruntime_ENABLE_ATEN) - # DLPack is a header-only dependency - set(DLPACK_INCLUDE_DIR ${dlpack_SOURCE_DIR}/include) - target_include_directories(onnxruntime_framework PRIVATE ${DLPACK_INCLUDE_DIR}) + onnxruntime_add_include_to_target(onnxruntime_framework dlpack::dlpack) endif() onnxruntime_add_include_to_target(onnxruntime_framework onnxruntime_common onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers safeint_interface Boost::mp11 nlohmann_json::nlohmann_json) diff --git a/cmake/onnxruntime_providers_cpu.cmake b/cmake/onnxruntime_providers_cpu.cmake index 3e1a9edbd1..5d2f01046d 100644 --- a/cmake/onnxruntime_providers_cpu.cmake +++ b/cmake/onnxruntime_providers_cpu.cmake @@ -196,8 +196,7 @@ endif() if (onnxruntime_ENABLE_DLPACK) target_compile_definitions(onnxruntime_providers PRIVATE ENABLE_DLPACK) # DLPack is a header-only dependency - set(DLPACK_INCLUDE_DIR ${dlpack_SOURCE_DIR}/include) - target_include_directories(onnxruntime_providers PRIVATE ${DLPACK_INCLUDE_DIR}) + onnxruntime_add_include_to_target(onnxruntime_providers dlpack::dlpack) endif() if (onnxruntime_ENABLE_TRAINING) diff --git a/cmake/onnxruntime_python.cmake b/cmake/onnxruntime_python.cmake index 7d7416cc91..0ae3b338db 100644 --- a/cmake/onnxruntime_python.cmake +++ b/cmake/onnxruntime_python.cmake @@ -131,7 +131,7 @@ if (onnxruntime_ENABLE_ATEN) endif() if (onnxruntime_ENABLE_DLPACK) - target_include_directories(onnxruntime_pybind11_state PRIVATE ${dlpack_SOURCE_DIR}/include) + onnxruntime_add_include_to_target(onnxruntime_providers dlpack::dlpack) endif() if (onnxruntime_ENABLE_TRAINING) diff --git a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml index 7c0142d041..f3408d9168 100644 --- a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml @@ -106,7 +106,7 @@ stages: parameters: BuildConfig: 'RelWithDebInfo' buildArch: x64 - additionalBuildFlags: --build_wheel --use_dnnl + additionalBuildFlags: --build_wheel --use_dnnl --use_vcpkg msbuildPlatform: x64 isX86: false job_name_suffix: x64_release diff --git a/tools/ci_build/github/linux/docker/migraphx-ci-pipeline-env.Dockerfile b/tools/ci_build/github/linux/docker/migraphx-ci-pipeline-env.Dockerfile index 51591e11ea..e594c6891e 100644 --- a/tools/ci_build/github/linux/docker/migraphx-ci-pipeline-env.Dockerfile +++ b/tools/ci_build/github/linux/docker/migraphx-ci-pipeline-env.Dockerfile @@ -12,7 +12,7 @@ RUN echo "$APT_PREF" > /etc/apt/preferences.d/rocm-pin-600 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && \ - apt-get install -y --no-install-recommends ca-certificates curl libnuma-dev gnupg && \ + apt-get install -y --no-install-recommends ca-certificates ninja-build git zip curl libnuma-dev gnupg && \ curl -sL https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - &&\ printf "deb [arch=amd64] https://repo.radeon.com/rocm/apt/$ROCM_VERSION/ jammy main" | tee /etc/apt/sources.list.d/rocm.list && \ printf "deb [arch=amd64] https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/ubuntu jammy main" | tee /etc/apt/sources.list.d/amdgpu.list && \ @@ -45,10 +45,10 @@ ENV LANG C.UTF-8 WORKDIR /stage # Cmake -ENV CMAKE_VERSION=3.30.1 +ENV CMAKE_VERSION=3.31.5 RUN cd /usr/local && \ wget -q https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz && \ - tar -zxf /usr/local/cmake-3.30.1-Linux-x86_64.tar.gz --strip=1 -C /usr + tar -zxf /usr/local/cmake-3.31.5-Linux-x86_64.tar.gz --strip=1 -C /usr # ccache RUN mkdir -p /tmp/ccache && \