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

rapids_cpm_thrust installs to a location that won't be marked system #98

Conversation

robertmaynard
Copy link
Contributor

Projects such as cudf, and rmm require a newer versions of thrust than can
be found in the oldest supported CUDA toolkit.This requires these components to
install/packaged so that consumers use the same version. To make sure that the
custom version of thrust is used over the CUDA toolkit version we need to ensure
we always use an user include and not a system.

By default if we allow thrust to install into CMAKE_INSTALL_INCLUDEDIR alongside
rmm (or other pacakges) we will get a install tree that looks like this:

  install/include/rmm
  install/include/cub
  install/include/thrust

This is a problem for CMake+NVCC due to the rules around import targets, and
user/system includes. In this case both rmm and thrust will specify an
include path of install/include, while thrust tries to mark it as an user include,
since rmm uses CMake's default of system include. Compilers when provided the same include
as both user and system always goes with system.

Now while rmm could also mark install/include as system this just pushes the issue to
another dependency which isn't built by RAPIDS and comes by and marks install/include as
system.

Instead the more reliable option is to make sure that we get thrust to be placed in an
unique include path that to other project will use. In the case of rapids-cmake we install
the headers to include/rapids/thrust.

@robertmaynard robertmaynard added bug Something isn't working non-breaking Introduces a non-breaking change 3 - Ready for Review Ready for review by team labels Oct 15, 2021
@robertmaynard
Copy link
Contributor Author

@harrism @jrhemstad This closes the loop on the discussion on making sure RAPIDS always uses the newer version of thrust when being components.

With rapids_cpm_thrust being the injection point of these changes all RAPIDS projects will automatically switch to this approach and not pick up a system thrust.

@robertmaynard
Copy link
Contributor Author

@allisonvacanti I think you should be aware of this issue.

@alliepiper
Copy link
Contributor

Compilers when provided the same include as both user and system always goes with system.

This is horrifying 😅 The joys of being packaged with a toolchain....

Is there some way we could simplify this on Thrust's end? I really don't want ya'll to have to maintain a copy of our install rules. If you want to add a Thrust_INSTALL_HEADER_INFIX or some other fix to Thrust I'd be ok with that.

@robertmaynard
Copy link
Contributor Author

I think going with a Thrust_INSTALL_HEADER_INFIX would be perfect. @allisonvacanti If you open an issue for that on Thrust you can assign it to me :)

@alliepiper
Copy link
Contributor

#NVIDIA/thrust#1541 -- we'll need the same changes to the install rules in CUB (in cmake/CubInstallRules.cmake). Thanks Rob :)

@robertmaynard
Copy link
Contributor Author

#NVIDIA/thrust#1541 -- we'll need the same changes to the install rules in CUB (in cmake/CubInstallRules.cmake). Thanks Rob :)

So in my mind this is the way forward:

  • rapids-cmake merges this PR to support Thrust 1.4
  • I update Thrust for release 1.N
  • Thrust 1.N is released
  • update rapids-cmake / RAPIDS to require 1.N

@allisonvacanti reasonable to you?

@alliepiper
Copy link
Contributor

rapids-cmake merges this PR to support Thrust 1.4

Do you mean 1.14?

This sounds good. I don't think you'd have any issues tracking later versions, too, since I don't expect our install rules to change anytime soon. I'll be releasing 1.15 next week.

FYI, the upcoming releases are here. If the INFIX patch is ready by 12/6 we can ship it in 1.16, otherwise it'll wait until 1.17 goes out in February.

@robertmaynard
Copy link
Contributor Author

Do you mean 1.14?

Yes I meant 1.14

robertmaynard and others added 3 commits October 22, 2021 09:24
Projects such as cudf, and rmm require a newer versions of thrust than can
be found in the oldest supported CUDA toolkit.This requires these components to
install/packaged so that consumers use the same version. To make sure that the
custom version of thrust is used over the CUDA toolkit version we need to ensure
we always use an user include and not a system.

By default if we allow thrust to install into `CMAKE_INSTALL_INCLUDEDIR` alongside
rmm (or other pacakges) we will get a install tree that looks like this:

```
  install/include/rmm
  install/include/cub
  install/include/thrust
```

This is a problem for CMake+NVCC due to the rules around import targets, and
user/system includes. In this case both rmm and thrust will specify an
include path of `install/include`, while thrust tries to mark it as an user include,
since rmm uses CMake's default of system include. Compilers when provided the same include
as both user and system always goes with system.

Now while rmm could also mark `install/include` as system this just pushes the issue to
another dependency which isn't built by RAPIDS and comes by and marks `install/include` as
system.

Instead the more reliable option is to make sure that we get thrust to be placed in an
unique include path that to other project will use. In the case of rapids-cmake we install
the headers to `include/rapids/thrust`.
More changes for CI style
@robertmaynard robertmaynard force-pushed the fea/use_custom_thrust_install_rules branch from 7b93c09 to b7ba406 Compare October 22, 2021 13:25
@robertmaynard
Copy link
Contributor Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 2a041d4 into rapidsai:branch-21.12 Oct 25, 2021
@robertmaynard robertmaynard deleted the fea/use_custom_thrust_install_rules branch October 25, 2021 12:10
rapids-bot bot pushed a commit to rapidsai/cugraph that referenced this pull request Jan 23, 2022
…1863)

Originally this PR was about building FAISS shared libs via CPM, but @rlratzel mentioned cuGraph doesn't need FAISS anymore, and it'd be better if we remove it.

If we need FAISS again in the future, we can add `faiss::faiss` back to `target_link_libraries` without needing extra CPM configuration as it will be available [via raft](rapidsai/raft#345).

Edit: Removed more dependencies that we inherit from raft and/or rmm. Depends on rapidsai/raft#345.

Edit 2: I think the CUDA 11.0 thrust issue will be solved by rapidsai/rapids-cmake#98

Authors:
  - Paul Taylor (https://github.com/trxcllnt)
  - Divye Gala (https://github.com/divyegala)

Approvers:
  - Brad Rees (https://github.com/BradReesWork)
  - AJ Schmidt (https://github.com/ajschmidt8)

URL: #1863
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants