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

[BUG]: thrust::cuda_cub::launcher::triple_chevron is called in headers even for non CUDA compilers #3376

Open
1 task done
caugonnet opened this issue Jan 14, 2025 · 1 comment
Labels
bug Something isn't working right.

Comments

@caugonnet
Copy link
Contributor

Is this a duplicate?

Type of Bug

Compile-time Error

Component

Thrust

Describe the bug

When compiling cuGraph code with a recent CCCL, some .cpp file compiled with a non CUDA compiler includes headers which eventually include headers that do need a CUDA compiler.

I am not sure if the problem is in RAFT, RMM, Thrust or CUB here ! Maybe some additional safeguard in CCCL headers would be helpful to detect we are using an inappropriate compiler earlier in the list of nested includes ?

In file included from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/cub/../../../cub/cub/detail/launcher/cuda_runtime.cuh:15,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/cub/../../../cub/cub/util_device.cuh:762,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/system/cuda/detail/util.h:42,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/system/cuda/detail/malloc_and_free.h:36,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/system/detail/adl/malloc_and_free.h:50,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/system/detail/generic/memory.inl:32,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/system/detail/generic/memory.h:70,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/detail/reference.h:38,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/memory.h:35,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/device_ptr.h:33,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/device_free.h:32,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/device_malloc_allocator.h:32,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/rmm-src/include/rmm/mr/device/thrust_allocator_adaptor.hpp:26,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/rmm-src/include/rmm/exec_policy.hpp:27,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/raft-src/cpp/include/raft/core/resource/thrust_policy.hpp:22,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/raft-src/cpp/include/raft/core/device_resources.hpp:35,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/raft-src/cpp/include/raft/core/handle.hpp:19,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/include/cugraph/utilities/dataframe_buffer.hpp:20,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/include/cugraph/edge_property.hpp:19,
                 from /home/caugonnet/git/caugonnet_cugraph/cpp/include/cugraph/algorithms.hpp:20:
/home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/system/cuda/detail/core/triple_chevron_launch.h: In member function 'cudaError_t thrust::cuda_cub::launcher::triple_chevron::doit_host(K, const Args& ...) const':
/home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/system/cuda/detail/core/triple_chevron_launch.h:112:10: error: expected primary-expression before '<' token
  112 |       k<<<grid, block, shared_mem, stream>>>(args...);
      |          ^
/home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/system/cuda/detail/core/triple_chevron_launch.h:112:44: error: expected primary-expression before '>' token
  112 |       k<<<grid, block, shared_mem, stream>>>(args...);
      |                                            ^
/home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/system/cuda/detail/core/triple_chevron_launch.h:112:50: error: expected ')' before '...' token
  112 |       k<<<grid, block, shared_mem, stream>>>(args...);
      |                                                  ^~~
/home/caugonnet/git/caugonnet_cugraph/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust/thrust/system/cuda/detail/core/triple_chevron_launch.h:112:45: note: to match this '('
  112 |       k<<<grid, block, shared_mem, stream>>>(args...);
      |                                             ^

How to Reproduce

Compile the cpp lib for that branch which updates CCCL in cuGraph rapidsai/cugraph#4833

Expected behavior

The RAFT header should be compilable from any compiler, or report some error earlier

Reproduction link

No response

Operating System

No response

nvidia-smi output

No response

NVCC version

No response

@caugonnet caugonnet added the bug Something isn't working right. label Jan 14, 2025
@github-project-automation github-project-automation bot moved this to Todo in CCCL Jan 14, 2025
@caugonnet caugonnet changed the title [BUG]: [BUG]: thrust::cuda_cub::launcher::triple_chevron is called in headers even for non CUDA compilers Jan 14, 2025
@caugonnet
Copy link
Contributor Author

caugonnet commented Jan 14, 2025

We should probably surround these headers with "#ifdef CUDA compilers"

cub/cub/detail/launcher/cuda_runtime.cuh
cub/cub/util_device.cuh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right.
Projects
Status: Todo
Development

No branches or pull requests

1 participant