Skip to content

Compile bug: Can't compile with cuda 12.8 in Kubuntu 25.10 #17041

@juanml82

Description

@juanml82

Git commit

B6962

Operating systems

Linux

GGML backends

CUDA

Problem description & steps to reproduce

I'm trying to compile llama.cpp in Kubuntu 25.10 with cuda 12.8 and drivers 580.95.05 but the compiler fails,

First Bad Commit

No response

Compile command

cmake -B build -DGGML_CUDA=ON

Relevant log output

juan@Kubuntu:~/llama.cpp$ cmake -B build -DGGML_CUDA=ON -DGGML_CUDA_FA=ON \
  -DCMAKE_C_COMPILER=/usr/bin/gcc-14 \
  -DCMAKE_CXX_COMPILER=/usr/bin/g++-14 \
  -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/gcc-14 \
  -DCMAKE_CUDA_FLAGS="--allow-unsupported-compiler"
-- The C compiler identification is GNU 14.3.0
-- The CXX compiler identification is GNU 14.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc-14 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-14 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMAKE_BUILD_TYPE=Release
-- Found Git: /usr/bin/git (found version "2.51.0")
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/gcc-14
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- GGML_SYSTEM_ARCH: x86
-- Including CPU backend
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- x86 detected
-- Adding CPU backend variant ggml-cpu: -march=native 
-- Found CUDAToolkit: /usr/local/cuda-12.8/targets/x86_64-linux/include (found version "12.8.93")
-- CUDA Toolkit found
-- Using CUDA architectures: native
CMake Error at /usr/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:865 (message):
  Compiling the CUDA compiler identification source file
  "CMakeCUDACompilerId.cu" failed.

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

  Build flags: --allow-unsupported-compiler

  Id flags: --keep;--keep-dir;tmp;-ccbin=/usr/bin/gcc-14 -v



  The output was:

  2

  nvcc warning : Support for offline compilation for architectures prior to
  '<compute/sm/lto>_75' will be removed in a future release (Use
  -Wno-deprecated-gpu-targets to suppress warning).

  #$ _NVVM_BRANCH_=nvvm

  #$ _SPACE_=

  #$ _CUDART_=cudart

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

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

  #$ _TARGET_SIZE_=

  #$ _TARGET_DIR_=

  #$ _TARGET_DIR_=targets/x86_64-linux

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

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

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

  #$
  LD_LIBRARY_PATH=/usr/local/cuda-12.8/bin/../lib:/usr/local/cuda-12.8/lib64:/usr/local/cuda-13.0/lib64:/usr/local/cuda-12.8/lib64:/usr/local/cuda-13.0/lib64:/mnt/shared/sd-test/llama_cpp_kubuntu/llama.cpp/build-cuda/bin:


  #$
  PATH=/usr/local/cuda-12.8/bin/../nvvm/bin:/usr/local/cuda-12.8/bin:/usr/local/cuda-12.8/bin:/usr/local/cuda-13.0/bin:/usr/local/cuda-12.8/bin:/usr/local/cuda-13.0/bin:/home/juan/miniconda3/condabin:/home/juan/.local/bin:/usr/share/pyenv/shims:/usr/share/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/juan/.local/bin:/home/juan/.local/bin:/home/juan/go/bin


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

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

  #$ CUDAFE_FLAGS=

  #$ PTXAS_FLAGS=

  #$ rm tmp/a_dlink.reg.c

  #$ "/usr/bin"/gcc-14 -D__NV_NO_HOST_COMPILER_CHECK=1
  -D__CUDA_ARCH_LIST__=520 -D__NV_LEGACY_LAUNCH -E -x c++ -D__CUDACC__
  -D__NVCC__ "-I/usr/local/cuda-12.8/bin/../targets/x86_64-linux/include"
  -D__CUDACC_VER_MAJOR__=12 -D__CUDACC_VER_MINOR__=8
  -D__CUDACC_VER_BUILD__=93 -D__CUDA_API_VER_MAJOR__=12
  -D__CUDA_API_VER_MINOR__=8 -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 --gnu_version=140300 --display_error_number
  --orig_src_file_name "CMakeCUDACompilerId.cu" --orig_src_path_name
  "/home/juan/llama.cpp/build/CMakeFiles/3.31.6/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(83): error: exception
  specification is incompatible with that of previous function "cospi"
  (declared at line 2601 of
  /usr/local/cuda-12.8/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(85): error: exception
  specification is incompatible with that of previous function "sinpi"
  (declared at line 2556 of
  /usr/local/cuda-12.8/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(206): error: exception
  specification is incompatible with that of previous function "rsqrt"
  (declared at line 597 of
  /usr/local/cuda-12.8/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(83): error: exception
  specification is incompatible with that of previous function "cospif"
  (declared at line 2623 of
  /usr/local/cuda-12.8/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(85): error: exception
  specification is incompatible with that of previous function "sinpif"
  (declared at line 2579 of
  /usr/local/cuda-12.8/bin/../targets/x86_64-linux/include/crt/math_functions.h)


     extern float sinpif (float __x) noexcept (true); extern float __sinpif (float __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 621 of
  /usr/local/cuda-12.8/bin/../targets/x86_64-linux/include/crt/math_functions.h)


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

  

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

  # --error 0x2 --





  Compiling the CUDA compiler identification source file
  "CMakeCUDACompilerId.cu" failed.

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

  Build flags:

  Id flags: --keep;--keep-dir;tmp;-ccbin=/usr/bin/gcc-14 -v



  The output was:

  2

  nvcc warning : Support for offline compilation for architectures prior to
  '<compute/sm/lto>_75' will be removed in a future release (Use
  -Wno-deprecated-gpu-targets to suppress warning).

  #$ _NVVM_BRANCH_=nvvm

  #$ _SPACE_=

  #$ _CUDART_=cudart

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

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

  #$ _TARGET_SIZE_=

  #$ _TARGET_DIR_=

  #$ _TARGET_DIR_=targets/x86_64-linux

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

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

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

  #$
  LD_LIBRARY_PATH=/usr/local/cuda-12.8/bin/../lib:/usr/local/cuda-12.8/lib64:/usr/local/cuda-13.0/lib64:/usr/local/cuda-12.8/lib64:/usr/local/cuda-13.0/lib64:/mnt/shared/sd-test/llama_cpp_kubuntu/llama.cpp/build-cuda/bin:


  #$
  PATH=/usr/local/cuda-12.8/bin/../nvvm/bin:/usr/local/cuda-12.8/bin:/usr/local/cuda-12.8/bin:/usr/local/cuda-13.0/bin:/usr/local/cuda-12.8/bin:/usr/local/cuda-13.0/bin:/home/juan/miniconda3/condabin:/home/juan/.local/bin:/usr/share/pyenv/shims:/usr/share/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/juan/.local/bin:/home/juan/.local/bin:/home/juan/go/bin


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

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

  #$ CUDAFE_FLAGS=

  #$ PTXAS_FLAGS=

  #$ rm tmp/a_dlink.reg.c

  #$ "/usr/bin"/gcc-14 -D__CUDA_ARCH_LIST__=520 -D__NV_LEGACY_LAUNCH -E -x
  c++ -D__CUDACC__ -D__NVCC__
  "-I/usr/local/cuda-12.8/bin/../targets/x86_64-linux/include"
  -D__CUDACC_VER_MAJOR__=12 -D__CUDACC_VER_MINOR__=8
  -D__CUDACC_VER_BUILD__=93 -D__CUDA_API_VER_MAJOR__=12
  -D__CUDA_API_VER_MINOR__=8 -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 --gnu_version=140300 --display_error_number
  --orig_src_file_name "CMakeCUDACompilerId.cu" --orig_src_path_name
  "/home/juan/llama.cpp/build/CMakeFiles/3.31.6/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(83): error: exception
  specification is incompatible with that of previous function "cospi"
  (declared at line 2601 of
  /usr/local/cuda-12.8/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(85): error: exception
  specification is incompatible with that of previous function "sinpi"
  (declared at line 2556 of
  /usr/local/cuda-12.8/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(206): error: exception
  specification is incompatible with that of previous function "rsqrt"
  (declared at line 597 of
  /usr/local/cuda-12.8/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(83): error: exception
  specification is incompatible with that of previous function "cospif"
  (declared at line 2623 of
  /usr/local/cuda-12.8/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(85): error: exception
  specification is incompatible with that of previous function "sinpif"
  (declared at line 2579 of
  /usr/local/cuda-12.8/bin/../targets/x86_64-linux/include/crt/math_functions.h)


     extern float sinpif (float __x) noexcept (true); extern float __sinpif (float __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 621 of
  /usr/local/cuda-12.8/bin/../targets/x86_64-linux/include/crt/math_functions.h)


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

  

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

  # --error 0x2 --





Call Stack (most recent call first):
  /usr/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /usr/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test)
  /usr/share/cmake-3.31/Modules/CMakeDetermineCUDACompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID)
  ggml/src/ggml-cuda/CMakeLists.txt:41 (enable_language)


-- Configuring incomplete, errors occurred!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions