Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Continuous integration and CMake/CUDA #156

Merged
merged 7 commits into from
Aug 10, 2024

Conversation

griwodz
Copy link
Member

@griwodz griwodz commented Jul 26, 2024

Description

The PR makes two contributions that are partially interdependent:

  1. Continuous Integration (CI) has been updated.
  2. CMake files have been updated and use CUDA as a first-order language.

CUDA as a first-order language has been available since CMake 3.18 and is in a good shape now. It is no longer necessary to hack linking and target behaviour, the creation of shared or non-shared libraries and target properties.

CI has been failing for a rather long while because the Linux, Visual Studio and CUDA versions were outdated. CI is now building the following combinations:

  • Ubuntu 20.04 + CUDA 11.8
  • Ubuntu 22.04 + CUDA 12.1
  • Windows Visual Studio 17 2022 v143 + CUDA 12.5

Features list

  • CI works again (without static linking for Windows because of deprecated CMake/boost interaction)
  • PopSift's cmake files do no longer require manual maintenance of CUDA Compute Cabilitiies (CCs), this is inherited from new CMake versions.
  • Sets of CC can be selected by setting CMAKE_CUDA_ARCHITECTURES to all, all-major or native. All means of all CCs supported by the current SDK, native means just the CC of the development machine, while all-major compiles only a few CCs for each major revision. CCs can also be chosen explicitly.
  • CMake requirement has been increased to version 3.27. This may be too conservative, but 3.18 is the absolute minimum. On Windows, 3.31 is included in Toolset v143. On Ubuntu, 3.30 is available as a Snap (apt repo is at 3.22).
  • Boost requirement has been increased to 1.71. This prepares for the new handling of Boost as a CMake dependency (since Boost 1.70).

Implementation remarks

  • Linux CI builds PopSift static and shared. Windows builds PopSift only shared. The reason is that the static Windows build fails on Boost. This should be addressed in a separate PR that switches to CMake policy CMP0167. This new policy uses Boost's own CMake integration and will hopefully solve the static linking challenges.
  • CI configurations must use CMAKE_CUDA_ARCHITECTURES=all-major because the CI machines don't have any GPU
  • There is apparently no way to set a minimum CC for first-order CUDA
  • Applications using PopSift with other CUDA functions may have to link CUDA explicitly, until now they got it "for free" through PopSift. For example, popsift-demo and popsift-match could not longer call cudaDeviceReset or cudaDeviceSynchronize without linking libcudart explicitly. Instead of doing this, I added reset and sync functions to the popsift::cuda namespace. Previously, we exported the libcudart dependency as PUBLIC, but that doesn't happen with first-order CUDA.
  • CUDA nvtx had to be updated to the new CUDA nvtx3, and code had to be changed because I couldn't find the older nvtx library for Windows any more.
  • Dropped cuBlas as a dependency because PopSift doesn't use it.
  • Some variables have changed due to first-order CUDA. A notable example is that CUDA_INCLUDE_DIRS is now CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.

The supported CCs are specified differently now, "native" and "all" simplify choices.
libcudevrt is now a private dependencies of libpopsift.
Applications using popsift with other CUDA functions may have to link it explicitly.
@griwodz griwodz self-assigned this Jul 26, 2024
@griwodz griwodz added scope:build review cuda issues related to cuda versions labels Jul 26, 2024
@griwodz griwodz linked an issue Jul 29, 2024 that may be closed by this pull request
Carsten Griwodz added 5 commits July 31, 2024 09:37
require at least Boost 1.71 for demo applications
use Ubuntu 22.04 and CUDA SDK 11/12
use CMake to 3.24
remove cuBlas from linking, not used in PopSift
added dependencies on CUDAToolkit to config file
change CC from native to all-major because build system has no GPU
platform toolset for VS19
disable NVTX explicitly
let BUILD_SHARED_LIBS determine if popsift is built as shared or static
using shared cudart library is given by CMAKE_CUDA_RUNTIME_LIBRARY
@griwodz griwodz force-pushed the dev/cmake-lang-cuda branch from 926d336 to 2175ee5 Compare July 31, 2024 08:29
@griwodz griwodz changed the title [WIP] CUDA as first order language [WIP] Update to Continuous integration and CMake/CUDA Jul 31, 2024
@griwodz griwodz changed the title [WIP] Update to Continuous integration and CMake/CUDA Update to Continuous integration and CMake/CUDA Jul 31, 2024
@griwodz griwodz added the ready label Jul 31, 2024
@griwodz griwodz requested a review from simogasp July 31, 2024 11:25
@griwodz griwodz requested a review from fabiencastan August 8, 2024 07:26
@fabiencastan fabiencastan added this to the v0.9.1 milestone Aug 9, 2024
@fabiencastan fabiencastan merged commit bdd37e5 into develop Aug 10, 2024
6 checks passed
@fabiencastan fabiencastan deleted the dev/cmake-lang-cuda branch August 10, 2024 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda issues related to cuda versions ready review scope:build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ci] Continuous integration for both Linux and Windows must be updated
2 participants