rapidsai / cugraph

cuGraph - RAPIDS Graph Analytics Library
https://docs.rapids.ai/api/cugraph/stable/
Apache License 2.0
1.67k stars 299 forks source link

[BUG]: No known features for CUDA compiler after including cugraph/cpp/CMakeLists.txt #3861

Closed pknowles closed 11 months ago

pknowles commented 11 months ago

Version

branch-23.10

Which installation method(s) does this occur on?

Source

Describe the bug.

When depending on the cmake cugraph library, I get the following error:

CMake Error in CMakeLists.txt:
  No known features for CUDA compiler

  ""

  version .

I asked about this cmake message here: https://stackoverflow.com/q/77130941/1888983

Minimum reproducible example

- Install https://developer.download.nvidia.com/compute/machine-learning/nccl/secure/2.18.5/agnostic/aarch64sbsa/nccl_2.18.5-1+cuda12.2_aarch64.txz to /usr/local/share/nccl
- git clone git@github.com:rapidsai/cugraph.git
- Create CMakeLists.txt:

cmake_minimum_required(VERSION 3.20)
project(test_project)

set(USE_CUGRAPH_OPS OFF)
list(APPEND CMAKE_PREFIX_PATH "/usr/local/share/nccl")
add_subdirectory(cugraph/cpp)

find_package(CUDAToolkit REQUIRED)

add_executable(test
    main.cpp
)
target_link_libraries(test PRIVATE
    CUDA::cudart
    cugraph
)

Relevant log output

-- Building for GPU_ARCHS = 60-real;70-real;75-real;80-real;86-real;90
-- Building with debugging flags
-- Disabling functions that reference cugraph-ops
-- CPM: using local package libcudacxx@2.1.1.0
-- CPM: adding package cuco@0.0.1 (5186b39522e13a3681c0eb591db4eaacbf969485)
-- CPM: cuco: using local package Thrust@1.17.2.0
-- CPM: adding package raft@23.10.00 (branch-23.10)
-- CPM: raft: adding package rmm@23.10 (branch-23.10)
-- RMM: RMM_LOGGING_LEVEL = 'INFO'
-- CPM: raft: rmm: adding package fmt@9.1.0 (9.1.0)
-- Module support is disabled.
-- Version: 9.1.0
-- Build type: Debug
-- CXX_STANDARD: 11
-- Required features: cxx_variadic_templates
-- rapids-cmake [fmt]: applied diff no_debug_warnings.diff to fix issue: 'No warnings during debug builds [https://github.com/fmtlib/fmt/issues/3351]'
-- CPM: raft: rmm: adding package spdlog@1.11.0 (v1.11.0)
-- Build spdlog: 1.11.0
-- Build type: Debug
-- Generating install
-- CPM: raft: adding package NvidiaCutlass@2.10.0 (v2.10.0)
-- CMake Version: 3.27.1
-- CUDART: /usr/local/cuda/lib64/libcudart.so
-- CUDA Driver: /usr/local/cuda/lib64/stubs/libcuda.so
-- NVRTC: /usr/local/cuda/lib64/libnvrtc.so
-- Default Install Location: install
-- CUDA Compilation Architectures: 53;60;61;70;72;75;80;86
-- Enable caching of reference results in conv unit tests
-- Enable rigorous conv problem sizes in conv unit tests
-- Using NVCC flags: -DCUTLASS_TEST_LEVEL=0;-DCUTLASS_TEST_ENABLE_CACHED_RESULTS=1;-DCUTLASS_CONV_UNIT_TEST_RIGOROUS_SIZE_ENABLED=1;-DCUTLASS_DEBUG_TRACE_LEVEL=0;$<$<BOOL:1>:-Xcompiler=-Wconversion>;$<$<BOOL:1>:-Xcompiler=-fno-strict-aliasing>;-lineinfo
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
-- CUTLASS Revision: Unable to detect, Git returned code 128.
-- Configuring cublas ...
-- cuBLAS Disabled.
-- Configuring cuBLAS ... done.
-- CPM: adding package GTest@1.13.0 (v1.13.0)
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) (Required is at least version "1.8.11")
-- CUDAToolkit_VERSION '12.2.91'
-- Configuring done (2.6s)
CMake Error in CMakeLists.txt:
  No known features for CUDA compiler

  ""

  version .

CMake Generate step failed.  Build files cannot be regenerated correctly.

Environment details

No response

Other/Misc.

No response

Code of Conduct

pknowles commented 11 months ago

Note that I don't see this error when configuring cugraph like so:

mkdir cugraph/cpp/build
cd cugraph/cpp/build
cmake .. -DCMAKE_PREFIX_PATH="/usr/local/share/nccl" -DUSE_CUGRAPH_OPS=OFF

Is it possible cugraph is un-setting some variables that cmake would otherwise need, or setting something that could conflict with an add_executable()?

I understand the expected use case migth be to compile and package the dependency myself before referencing it as a pre-built binary, but it would be nicer for developers to have dependencies of a project build themselves in one go with as few steps as possible.

pknowles commented 11 months ago

It seems adding enable_language(CUDA) magically makes this error go away.

Closing as this is more of a bad-error-message cmake bug IMO.