NVIDIA / NVIDIA/cuda-samples

error: exception specification is incompatible with that of previous function "cospi"

Open
#378 3 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

OS: Ubuntu 25.04
Cuda version: 12.9

After installing the Nvidia driver and CUDA driver, I always run the cuda-samples to test that it is working as expected. It has worked previously but last time I installed it, the samples cannot be compiled as they run into this issue:

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

     extern double cospi (double __x) noexcept (true); extern double __cospi (double __x) noexcept (true);
                                      ^
  /usr/include/x86_64-linux-gnu/bits/mathcalls.h(81): error: exception
  specification is incompatible with that of previous function "sinpi"
  (declared at line 2556 of
  /usr/local/cuda-12.9/bin/../targets/x86_64-linux/include/crt/math_functions.h)

     extern double sinpi (double __x) noexcept (true); extern double __sinpi (double __x) noexcept (true);
                                      ^
  /usr/include/x86_64-linux-gnu/bits/mathcalls.h(79): error: exception
  specification is incompatible with that of previous function "cospif"
  (declared at line 2623 of
  /usr/local/cuda-12.9/bin/../targets/x86_64-linux/include/crt/math_functions.h)

     extern float cospif (float __x) noexcept (true); extern float __cospif (float __x) noexcept (true);
                                     ^
  /usr/include/x86_64-linux-gnu/bits/mathcalls.h(81): error: exception
  specification is incompatible with that of previous function "sinpif"
  (declared at line 2579 of
  /usr/local/cuda-12.9/bin/../targets/x86_64-linux/include/crt/math_functions.h)


     extern float sinpif (float __x) noexcept (true); extern float __sinpif (float __x) noexcept (true);

This forum post show there are several people that have this issue across other CUDA versions and Distro's. The workaround is included in this post but this has been an issue for several months now, is there an offical solution planned for this? Running CUDA compilations through Nvidias docker image works as well.

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

Reproduce the CUDA samples build on Ubuntu 25.04 with CUDA 12.9 and inspect the conflicting declarations in /usr/include/x86_64-linux-gnu/bits/mathcalls.h and CUDA's crt/math_functions.h. Compare the forum workaround and the NVIDIA CUDA Docker image, then verify that the samples compile without the workaround or document the required compatibility fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, docker, linux, ubuntu
Domain
build-system, devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.