Error when using nvcc compiling include cub

Error Info:
/usr/local/cuda-12/bin/nvcc /home/dev/Open-Source/DREAMPlace/dreamplace/ops/pin_pos/src/pin_pos_cuda_segment_kernel.cu -c -o /home/dev/Open-Source/DREAMPlace/build/dreamplace/ops/pin_pos/CMakeFiles/pin_pos_cuda_segment_cuda_tmp.dir/src/./pin_pos_cuda_segment_cuda_tmp_generated_pin_pos_cuda_segment_kernel.cu.o -m64 -DTORCH_EXTENSION_NAME=pin_pos_cuda_segment -DTORCH_MAJOR_VERSION= -DTORCH_MINOR_VERSION= -DENABLE_CUDA=1 -D_GLIBCXX_USE_CXX11_ABI=1 -Xcompiler ,"-O3","-DNDEBUG" -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 --compiler-options -fPIC -DNVCC -I/usr/local/cuda-12/include -I/home/dev/Open-Source/DREAMPlace/thirdparty/flute -I/home/dev/Open-Source/DREAMPlace/thirdparty/OpenTimer -I/home/dev/Open-Source/DREAMPlace/dreamplace/ops/pin_pos/… -I/home/dev/miniconda3/envs/pytorch/lib/python3.8/site-packages/torch/include -I/home/dev/miniconda3/envs/pytorch/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dev/Open-Source/DREAMPlace/thirdparty/pybind11/include -I/home/dev/miniconda3/envs/pytorch/include/python3.8
/usr/local/cuda-12/include/cub/agent/agent_three_way_partition.cuh(78): error: name followed by “::” must be a class or namespace name
struct accumulator_pack_base_t<OffsetT, typename cuda::std::enable_if<sizeof(OffsetT) == 4>::type>
^

/usr/local/cuda-12/include/cub/agent/agent_three_way_partition.cuh(78): error: expected an identifier
struct accumulator_pack_base_t<OffsetT, typename cuda::std::enable_if<sizeof(OffsetT) == 4>::type>
^

/usr/local/cuda-12/include/cub/agent/agent_three_way_partition.cuh(78): error: expected a “>”
struct accumulator_pack_base_t<OffsetT, typename cuda::std::enable_if<sizeof(OffsetT) == 4>::type>
^

/usr/local/cuda-12/include/cub/agent/agent_three_way_partition.cuh(78): error: expected a “;”
struct accumulator_pack_base_t<OffsetT, typename cuda::std::enable_if<sizeof(OffsetT) == 4>::type>

And I have tried gcc 7.5 8.5 9.5 10.5, all not work

1 Like

Please show a minimal complete code example that reproduces the error.

1 Like

Have you tried to downgrade your CUDA version?

See [BUG]: Compilation error after updating to CCCL monorepo · Issue #1170 · NVIDIA/cccl · GitHub

Thanks. I’ve tried this before but it makes no difference. The errors still exist.