NVIDIA / NVIDIA/cuda-samples

Problem building deviceQuery with Ubuntu 26.04 package cuda-toolkit-13-1

Open
#442 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
9.6k
Forks
2.4k
Avg merge
53m
Merged PRs (30d)
1

Description

I'm on Ubuntu 26.04 LTS, with CUDA Toolkit 13.1.1 installed via sudo apt install cuda-toolkit-13-1, coming from the Ubuntu packages.

Steps to reproduce:

cd ~/Downloads
git clone https://github.com/NVIDIA/cuda-samples.git
cd ~/Downloads/cuda-samples/cpp/1_Utilities/deviceQuery
mkdir build && cd build
cmake ..

The output:

-- The C compiler identification is GNU 15.2.0
-- The CXX compiler identification is GNU 15.2.0
CMake Error at /usr/share/cmake-4.2/Modules/CMakeDetermineCompilerId.cmake:928 (message):
  Compiling the CUDA compiler identification source file
  "CMakeCUDACompilerId.cu" failed.

  Compiler: /usr/local/cuda-13.1/bin/nvcc

  Build flags:

  Id flags: --keep;--keep-dir;tmp -v



  The output was:

  2

  #$ _NVVM_BRANCH_=nvvm

  #$ _SPACE_=

  #$ _CUDART_=cudart

  #$ _HERE_=/usr/local/cuda-13.1/bin

  #$ _THERE_=/usr/local/cuda-13.1/bin

  #$ _TARGET_SIZE_=

  #$ _TARGET_DIR_=

  #$ _TARGET_DIR_=targets/x86_64-linux

  #$ TOP=/usr/local/cuda-13.1/bin/..

  #$ CICC_PATH=/usr/local/cuda-13.1/bin/../nvvm/bin

  #$ NVVMIR_LIBRARY_DIR=/usr/local/cuda-13.1/bin/../nvvm/libdevice

  #$ LD_LIBRARY_PATH=/usr/local/cuda-13.1/bin/../lib:

  #$
  PATH=/usr/local/cuda-13.1/bin/../nvvm/bin:/usr/local/cuda-13.1/bin:/home/myname/.cargo/bin:/usr/local/cuda-13.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

  #$ INCLUDES="-I/usr/local/cuda-13.1/bin/../targets/x86_64-linux/include"

  #$ SYSTEM_INCLUDES="-isystem"
  "/usr/local/cuda-13.1/bin/../targets/x86_64-linux/include/cccl"

  #$ LIBRARIES=
  "-L/usr/local/cuda-13.1/bin/../targets/x86_64-linux/lib/stubs"
  "-L/usr/local/cuda-13.1/bin/../targets/x86_64-linux/lib"

  #$ CUDAFE_FLAGS=

  #$ PTXAS_FLAGS=

  #$ rm tmp/a_dlink.reg.c

  #$ gcc -D__CUDA_ARCH_LIST__=750 -E -x c++ -D__CUDACC__ -D__NVCC__
  "-I/usr/local/cuda-13.1/bin/../targets/x86_64-linux/include" "-isystem"
  "/usr/local/cuda-13.1/bin/../targets/x86_64-linux/include/cccl"
  -D__CUDACC_VER_MAJOR__=13 -D__CUDACC_VER_MINOR__=1
  -D__CUDACC_VER_BUILD__=115 -D__CUDA_API_VER_MAJOR__=13
  -D__CUDA_API_VER_MINOR__=1 -D__NVCC_DIAG_PRAGMA_SUPPORT__=1
  -D__CUDACC_DEVICE_ATOMIC_BUILTINS__=1 -include "cuda_runtime.h" -m64
  "CMakeCUDACompilerId.cu" -o "tmp/CMakeCUDACompilerId.cpp4.ii"

  #$ cudafe++ --c++17 --static-host-stub --device-hidden-visibility
  --gnu_version=150200 --display_error_number --orig_src_file_name
  "CMakeCUDACompilerId.cu" --orig_src_path_name
  "/home/myname/Downloads/cuda-samples/cpp/1_Utilities/deviceQuery/build/CMakeFiles/4.2.3/CompilerIdCUDA/CMakeCUDACompilerId.cu"
  --allow_managed --m64 --parse_templates --gen_c_file_name
  "tmp/CMakeCUDACompilerId.cudafe1.cpp" --stub_file_name
  "CMakeCUDACompilerId.cudafe1.stub.c" --gen_module_id_file
  --module_id_file_name "tmp/CMakeCUDACompilerId.module_id"
  "tmp/CMakeCUDACompilerId.cpp4.ii"

  /usr/include/x86_64-linux-gnu/bits/mathcalls.h(206): error: exception
  specification is incompatible with that of previous function "rsqrt"
  (declared at line 629 of
  /usr/local/cuda-13.1/bin/../targets/x86_64-linux/include/crt/math_functions.h)

     extern double rsqrt (double __x) noexcept (true); extern double __rsqrt (double __x) noexcept (true);
                                      ^



  /usr/include/x86_64-linux-gnu/bits/mathcalls.h(206): error: exception
  specification is incompatible with that of previous function "rsqrtf"
  (declared at line 653 of
  /usr/local/cuda-13.1/bin/../targets/x86_64-linux/include/crt/math_functions.h)

     extern float rsqrtf (float __x) noexcept (true); extern float __rsqrtf (float __x) noexcept (true);
                                     ^



  2 errors detected in the compilation of "CMakeCUDACompilerId.cu".

  # --error 0x2 --





Call Stack (most recent call first):
  /usr/share/cmake-4.2/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /usr/share/cmake-4.2/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test)
  /usr/share/cmake-4.2/Modules/CMakeDetermineCUDACompiler.cmake:163 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:5 (project)


-- Configuring incomplete, errors occurred!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in cpp/1_Utilities/deviceQuery/CMakeLists.txt and reproduce the failure with cmake .. using the stated Ubuntu and CUDA Toolkit versions. Trace CMake's CUDA compiler-identification step and the conflicting declarations in CUDA's crt/math_functions.h and Ubuntu's bits/mathcalls.h. Done means deviceQuery configures successfully without the rsqrt or rsqrtf errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, ubuntu
Domain
build-system, compilers, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.