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] Linker error: undefined reference to cudf::detail::initialize_with_identity #16752

Closed
matal-nvidia opened this issue Sep 5, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@matal-nvidia
Copy link

matal-nvidia commented Sep 5, 2024

Describe the bug
In our project, we wanted to upgrade from cudf-24.06 to cudf-24.08, but when we compile it runs into a linker error for the libcudf function cudf::detail::initialize_with_identity.

Minimal reproducible example

#include <vector>
#include <cudf/detail/aggregation/aggregation.cuh>

int main(int argc, char *argv[]) {
  std::vector<cudf::aggregation::Kind> aggs;
  cudf::table sparse_table;
  cudf::mutable_table_view sparse_table_view = sparse_table.mutable_view();
  cudf::detail::initialize_with_identity(sparse_table_view, aggs,
                                         rmm::cuda_stream_default);

  return 0;
}
[100%] Linking CUDA executable main
/home/matal/miniconda3/envs/repro/bin/../lib/gcc/x86_64-conda-linux-gnu/11.4.0/../../../../x86_64-conda-linux-gnu/bin/ld: CMakeFiles/main.dir/main.cu.o: in function `main':
tmpxft_00017340_00000000-6_main.compute_90.cudafe1.cpp:(.text+0xb6): undefined reference to `cudf::detail::initialize_with_identity(cudf::mutable_table_view&, std::vector<cudf::aggregation::Kind, std::allocator<cudf::aggregation::Kind> > const&, rmm::cuda_stream_view)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/main.dir/build.make:103: main] Error 1
make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/main.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Environment overview

Cmake file:

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)

if (NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
  set(CMAKE_CUDA_ARCHITECTURES "70" "80" "90")
endif()

# Setup rapids-cmake
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RAPIDS.cmake)
  file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-24.08/RAPIDS.cmake
       ${CMAKE_CURRENT_BINARY_DIR}/RAPIDS.cmake
  )
endif()
include(${CMAKE_CURRENT_BINARY_DIR}/RAPIDS.cmake)
include(rapids-cpm)
include(rapids-find)
rapids_cpm_init()


set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CUDA_STANDARD 17)

add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-Wall>")
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-Werror>")
add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:--compiler-options=-Wall>")
add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:--compiler-options=-Werror>")
add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:--expt-extended-lambda>")
add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:--expt-relaxed-constexpr>")
add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:--generate-line-info>")

# needed for clang-tidy
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

rapids_find_package(cudf CONFIG REQUIRED COMPONENTS testing)
add_executable(main main.cu)
target_link_libraries(main PUBLIC cudf::cudf)

Conda environment looks like this

# packages in environment at /home/matal/miniconda3/envs/repro-1:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
aws-c-auth                0.7.27               hc36b679_0    conda-forge
aws-c-cal                 0.7.4                h2abdd08_0    conda-forge
aws-c-common              0.9.27               h4bc722e_0    conda-forge
aws-c-compression         0.2.19               haa50ccc_0    conda-forge
aws-c-event-stream        0.4.3                h570d160_0    conda-forge
aws-c-http                0.8.8                h9b61739_1    conda-forge
aws-c-io                  0.14.18              h49c7fd3_7    conda-forge
aws-c-mqtt                0.10.4              h5c8269d_18    conda-forge
aws-c-s3                  0.6.4               h9204347_12    conda-forge
aws-c-sdkutils            0.1.19               h038f3f9_2    conda-forge
aws-checksums             0.1.18              h038f3f9_10    conda-forge
aws-crt-cpp               0.28.2               he9a34a3_1    conda-forge
aws-sdk-cpp               1.11.379             hc1bef60_8    conda-forge
azure-core-cpp            1.13.0               h935415a_0    conda-forge
azure-identity-cpp        1.8.0                hd126650_2    conda-forge
azure-storage-blobs-cpp   12.12.0              hd2e3451_0    conda-forge
azure-storage-common-cpp  12.7.0               h10ac4d7_1    conda-forge
azure-storage-files-datalake-cpp 12.11.0              h325d260_1    conda-forge
bzip2                     1.0.8                h4bc722e_7    conda-forge
c-ares                    1.33.1               heb4867d_0    conda-forge
ca-certificates           2024.8.30            hbcca054_0    conda-forge
cachetools                5.5.0              pyhd8ed1ab_0    conda-forge
cmake                     3.26.4               hcfe8598_0    conda-forge
cuda-cccl_linux-64        12.5.39              ha770c72_0    conda-forge
cuda-crt-dev_linux-64     12.5.82              ha770c72_0    conda-forge
cuda-crt-tools            12.5.82              ha770c72_0    conda-forge
cuda-cudart               12.5.82              he02047a_0    conda-forge
cuda-cudart-dev           12.5.82              he02047a_0    conda-forge
cuda-cudart-dev_linux-64  12.5.82              h85509e4_0    conda-forge
cuda-cudart-static        12.5.82              he02047a_0    conda-forge
cuda-cudart-static_linux-64 12.5.82              h85509e4_0    conda-forge
cuda-cudart_linux-64      12.5.82              h85509e4_0    conda-forge
cuda-nvcc-dev_linux-64    12.5.82              ha770c72_0    conda-forge
cuda-nvcc-impl            12.5.82              hd3aeb46_0    conda-forge
cuda-nvcc-tools           12.5.82              hd3aeb46_0    conda-forge
cuda-nvrtc                12.5.82              he02047a_0    conda-forge
cuda-nvvm-dev_linux-64    12.5.82              ha770c72_0    conda-forge
cuda-nvvm-impl            12.5.82              h59595ed_0    conda-forge
cuda-nvvm-tools           12.5.82              h59595ed_0    conda-forge
cuda-python               12.6.0          py310h521d3fa_0    conda-forge
cuda-version              12.5                 hd4f0392_3    conda-forge
cudf                      24.08.02        cuda12_py310_240814_ge776742c28_0    rapidsai
cupy                      13.3.0          py310h1b77274_0    conda-forge
cupy-core                 13.3.0          py310hc8bf42c_0    conda-forge
dlpack                    0.8                  h59595ed_3    conda-forge
expat                     2.6.2                h59595ed_0    conda-forge
fastrlock                 0.8.2           py310hc6cd4ac_2    conda-forge
fmt                       10.2.1               h00ab1b0_0    conda-forge
fsspec                    2024.6.1           pyhff2d567_0    conda-forge
gflags                    2.2.2             he1b5a44_1004    conda-forge
glog                      0.7.1                hbabe93e_0    conda-forge
icu                       75.1                 he02047a_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
krb5                      1.21.3               h659f571_0    conda-forge
ld_impl_linux-64          2.40                 hf3520f5_7    conda-forge
libabseil                 20240116.2      cxx17_he02047a_1    conda-forge
libarrow                  16.1.0          h8d2e343_26_cpu    conda-forge
libarrow-acero            16.1.0          h5888daf_26_cpu    conda-forge
libarrow-dataset          16.1.0          h5888daf_26_cpu    conda-forge
libarrow-substrait        16.1.0          hf54134d_26_cpu    conda-forge
libblas                   3.9.0           23_linux64_openblas    conda-forge
libbrotlicommon           1.1.0                hb9d3cd8_2    conda-forge
libbrotlidec              1.1.0                hb9d3cd8_2    conda-forge
libbrotlienc              1.1.0                hb9d3cd8_2    conda-forge
libcblas                  3.9.0           23_linux64_openblas    conda-forge
libcrc32c                 1.1.2                h9c3ff4c_0    conda-forge
libcublas                 12.5.3.2             he02047a_0    conda-forge
libcudf                   24.08.02        cuda12_240814_ge776742c28_0    rapidsai
libcufft                  11.2.3.61            he02047a_0    conda-forge
libcufile                 1.10.1.7             he02047a_0    conda-forge
libcufile-dev             1.10.1.7             he02047a_0    conda-forge
libcurand                 10.3.6.82            he02047a_0    conda-forge
libcurl                   8.9.1                hdb1bdb2_0    conda-forge
libcusolver               11.6.3.83            he02047a_0    conda-forge
libcusparse               12.5.1.3             he02047a_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 hd590300_2    conda-forge
libevent                  2.1.12               hf998b51_1    conda-forge
libexpat                  2.6.2                h59595ed_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc                    14.1.0               h77fa898_1    conda-forge
libgcc-ng                 14.1.0               h69a702a_1    conda-forge
libgfortran               14.1.0               h69a702a_1    conda-forge
libgfortran-ng            14.1.0               h69a702a_1    conda-forge
libgfortran5              14.1.0               hc5f4f2c_1    conda-forge
libgomp                   14.1.0               h77fa898_1    conda-forge
libgoogle-cloud           2.28.0               h26d7fe4_0    conda-forge
libgoogle-cloud-storage   2.28.0               ha262f82_0    conda-forge
libgrpc                   1.62.2               h15f2491_0    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
libkvikio                 24.08.02        cuda12_240807_g6b80a5c_0    rapidsai
liblapack                 3.9.0           23_linux64_openblas    conda-forge
libllvm14                 14.0.6               hcd5def8_4    conda-forge
libnghttp2                1.58.0               h47da74e_1    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libnvjitlink              12.5.82              he02047a_0    conda-forge
libopenblas               0.3.27          pthreads_hac2b453_1    conda-forge
libparquet                16.1.0          h39682fd_26_cpu    conda-forge
libprotobuf               4.25.3               h08a7969_0    conda-forge
libre2-11                 2023.09.01           h5a48ba9_2    conda-forge
librmm                    24.08.02        cuda12_240807_g5aa8ebe6_0    rapidsai
libsqlite                 3.46.1               hadc24fc_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx                 14.1.0               hc0a3c3a_1    conda-forge
libstdcxx-ng              14.1.0               h4852527_1    conda-forge
libthrift                 0.20.0               h0e7cc3e_1    conda-forge
libutf8proc               2.8.0                h166bdaf_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libuv                     1.48.0               hd590300_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libxml2                   2.12.7               he7c6b58_4    conda-forge
libzlib                   1.3.1                h4ab18f5_1    conda-forge
llvmlite                  0.43.0          py310h1a6248f_1    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
markdown-it-py            3.0.0              pyhd8ed1ab_0    conda-forge
mdurl                     0.1.2              pyhd8ed1ab_0    conda-forge
ncurses                   6.5                  he02047a_1    conda-forge
numba                     0.60.0          py310h5dc88bb_0    conda-forge
numpy                     1.26.4          py310hb13e2d6_0    conda-forge
nvcomp                    3.0.6                h10b603f_0    conda-forge
nvtx                      0.2.10          py310h2372a71_0    conda-forge
openssl                   3.3.2                hb9d3cd8_0    conda-forge
orc                       2.0.2                h669347b_0    conda-forge
packaging                 24.1               pyhd8ed1ab_0    conda-forge
pandas                    2.2.2           py310hf9f9076_1    conda-forge
pip                       24.2               pyh8b19718_1    conda-forge
pyarrow                   16.1.0          py310hb7f781d_5    conda-forge
pyarrow-core              16.1.0          py310hda9dd24_5_cpu    conda-forge
pygments                  2.18.0             pyhd8ed1ab_0    conda-forge
pynvjitlink               0.3.0           py310hd269673_0    rapidsai
python                    3.10.14         hd12c33a_0_cpython    conda-forge
python-dateutil           2.9.0              pyhd8ed1ab_0    conda-forge
python-tzdata             2024.1             pyhd8ed1ab_0    conda-forge
python_abi                3.10                    5_cp310    conda-forge
pytz                      2024.1             pyhd8ed1ab_0    conda-forge
re2                       2023.09.01           h7f4b329_2    conda-forge
readline                  8.2                  h8228510_1    conda-forge
rhash                     1.4.3                hd590300_2    conda-forge
rich                      13.7.1             pyhd8ed1ab_0    conda-forge
rmm                       24.08.02        cuda12_py310_240807_g5aa8ebe6_0    rapidsai
s2n                       1.5.1                h3400bea_0    conda-forge
setuptools                73.0.1             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.2.1                ha2e4443_0    conda-forge
spdlog                    1.12.0               hd2e6256_2    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
typing_extensions         4.12.2             pyha770c72_0    conda-forge
tzdata                    2024a                h8827d51_1    conda-forge
wheel                     0.44.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
zlib                      1.3.1                h4ab18f5_1    conda-forge
zstd                      1.5.6                ha6fb4c9_0    conda-forge
@matal-nvidia matal-nvidia added the bug Something isn't working label Sep 5, 2024
@matal-nvidia matal-nvidia changed the title [BUG] [BUG] Linker error for cudf::detail::initialize_with_identity Sep 5, 2024
@matal-nvidia matal-nvidia changed the title [BUG] Linker error for cudf::detail::initialize_with_identity [BUG] Linker error: undefined reference to cudf::detail::initialize_with_identity Sep 5, 2024
@davidwendt
Copy link
Contributor

The detail namespace functions are internal and are not part of the public API.
Can you provide some detail on why need to call this?

@vyasr
Copy link
Contributor

vyasr commented Sep 20, 2024

@matal-nvidia any thoughts on the above? For context, detail APIs have been explicitly hidden from our published libraries as of #15982.

@matal-nvidia
Copy link
Author

Thanks!

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

No branches or pull requests

3 participants