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!
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:
The output: