how to compile on last gcc?
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cmake, python
- Domain
- build-system
Research direction
The error occurs during CMake's CUDA compiler identification when building llama-cpp-python with CUDA 11.4 and GCC 12.2.0. Look at the CMake configuration in the project's build scripts, particularly flags passed to nvcc. The issue is compatibility between CUDA 11.4 and newer GCC versions; check if the project documents supported compiler versions or if there's a workaround flag needed. Testing involves modifying CMake arguments or environment variables to see if the build succeeds.
Written by the indexing model from the issue text.
Description
export PATH=/usr/local/cuda-11.4/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64:$LD_LIBRARY_PATH
NVCC_PREPEND_FLAGS="-allow-unsupported-compiler" CMAKE_ARGS="-DGGML_CUDA=on -DLLAVA_BUILD=off -DCMAKE_CUDA_FLAGS=-allow-unsupported-compiler" proxychains ../../bin/pip install -U llama-cpp-python
ProxyChains-3.1 (http://proxychains.sf.net)
|DNS-request| pypi.org
|S-chain|-<>-127.0.0.1:4445-<><>-4.2.2.2:53-<><>-OK
|DNS-response| pypi.org is 151.101.0.223
|S-chain|-<>-127.0.0.1:4445-<><>-151.101.0.223:443-<><>-OK
Collecting llama-cpp-python
Using cached llama_cpp_python-0.3.16.tar.gz (50.7 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: typing-extensions>=4.5.0 in /mnt/SOLR/lib/python3.11/site-packages (from llama-cpp-python) (4.15.0)
Requirement already satisfied: numpy>=1.20.0 in /mnt/SOLR/lib/python3.11/site-packages (from llama-cpp-python) (1.26.4)
Collecting diskcache>=5.6.1
Using cached diskcache-5.6.3-py3-none-any.whl (45 kB)
Requirement already satisfied: jinja2>=2.11.3 in /mnt/SOLR/lib/python3.11/site-packages (from llama-cpp-python) (3.1.6)
Requirement already satisfied: MarkupSafe>=2.0 in /mnt/SOLR/lib/python3.11/site-packages (from jinja2>=2.11.3->llama-cpp-python) (3.0.3)
Building wheels for collected packages: llama-cpp-python
Building wheel for llama-cpp-python (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for llama-cpp-python (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [379 lines of output]
*** scikit-build-core 0.11.6 using CMake 3.25.1 (wheel)
*** Configuring CMake...
loading initial cache file /tmp/tmpsrjhdqci/build/CMakeInit.txt
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/x86_64-linux-gnu-gcc - 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/x86_64-linux-gnu-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMAKE_BUILD_TYPE=Release
-- Found Git: /usr/bin/git (found version "2.39.5")
-- 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-11.4/include (found version "11.4.48")
-- CUDA Toolkit found
-- Using CUDA architectures: 50-virtual;61-virtual;70-virtual;75-virtual;80-virtual;86-real
CMake Error at /usr/share/cmake-3.25/Modules/CMakeDetermineCompilerId.cmake:739 (message):
Compiling the CUDA compiler identification source file
"CMakeCUDACompilerId.cu" failed.
Compiler: /usr/local/cuda-11.4/bin/nvcc
Build flags: -allow-unsupported-compiler
Id flags: --keep;--keep-dir;tmp -v
The output was:
1
#$ NVCC_PREPEND_FLAGS="-allow-unsupported-compiler"
#$ _NVVM_BRANCH_=nvvm
#$ _SPACE_=
#$ _CUDART_=cudart
#$ _HERE_=/usr/local/cuda-11.4/bin
#$ _THERE_=/usr/local/cuda-11.4/bin
#$ _TARGET_SIZE_=
#$ _TARGET_DIR_=
#$ _TARGET_DIR_=targets/x86_64-linux
#$ TOP=/usr/local/cuda-11.4/bin/..
#$ NVVMIR_LIBRARY_DIR=/usr/local/cuda-11.4/bin/../nvvm/libdevice
#$
LD_LIBRARY_PATH=/usr/local/cuda-11.4/bin/../lib:/usr/local/cuda-11.4/lib64:
#$
PATH=/usr/local/cuda-11.4/bin/../nvvm/bin:/usr/local/cuda-11.4/bin:/tmp/pip-build-env-zklleoev/overlay/bin:/tmp/pip-build-env-zklleoev/normal/bin:/usr/local/cuda-11.4/bin:/home/user/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
#$ INCLUDES="-I/usr/local/cuda-11.4/bin/../targets/x86_64-linux/include"
#$ LIBRARIES=
"-L/usr/local/cuda-11.4/bin/../targets/x86_64-linux/lib/stubs"
"-L/usr/local/cuda-11.4/bin/../targets/x86_64-linux/lib"
#$ CUDAFE_FLAGS=
#$ PTXAS_FLAGS=
#$ rm tmp/a_dlink.reg.c
#$ gcc -D__NV_NO_HOST_COMPILER_CHECK=1 -D__CUDA_ARCH__=520 -E -x c++
-DCUDA_DOUBLE_MATH_FUNCTIONS -D__CUDACC__ -D__NVCC__
"-I/usr/local/cuda-11.4/bin/../targets/x86_64-linux/include"
-D__CUDACC_VER_MAJOR__=11 -D__CUDACC_VER_MINOR__=4
-D__CUDACC_VER_BUILD__=48 -D__CUDA_API_VER_MAJOR__=11
-D__CUDA_API_VER_MINOR__=4 -include "cuda_runtime.h" -m64
"CMakeCUDACompilerId.cu" -o "tmp/CMakeCUDACompilerId.cpp1.ii"
#$ cicc --c++14 --gnu_version=120200 --orig_src_file_name
"CMakeCUDACompilerId.cu" --allow_managed -arch compute_52 -m64
--no-version-ident -ftz=0 -prec_div=1 -prec_sqrt=1 -fmad=1
--include_file_name "CMakeCUDACompilerId.fatbin.c" -tused
--gen_module_id_file --module_id_file_name
"tmp/CMakeCUDACompilerId.module_id" --gen_c_file_name
"tmp/CMakeCUDACompilerId.cudafe1.c" --stub_file_name
"tmp/CMakeCUDACompilerId.cudafe1.stub.c" --gen_device_file_name
"tmp/CMakeCUDACompilerId.cudafe1.gpu" "tmp/CMakeCUDACompilerId.cpp1.ii" -o
"tmp/CMakeCUDACompilerId.ptx"
/usr/include/stdio.h(189): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(201): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(223): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(260): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(285): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(294): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(303): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(309): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(315): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(830): error: attribute "__malloc__" does not take
arguments
/usr/include/stdlib.h(579): error: attribute "__malloc__" does not take
arguments
/usr/include/stdlib.h(583): error: attribute "__malloc__" does not take
arguments
/usr/include/stdlib.h(812): error: attribute "__malloc__" does not take
arguments
/usr/include/c++/12/bits/stl_pair.h(634): error: argument list for class
template "std::pair" is missing
/usr/include/c++/12/bits/stl_pair.h(634): error: expected a ")"
/usr/include/c++/12/bits/stl_pair.h(634): error: template parameter "_T1"
may not be redeclared in this scope
/usr/include/c++/12/bits/stl_pair.h(634): error: expected a ";"
17 errors detected in the compilation of "CMakeCUDACompilerId.cu".
# --error 0x1 --
Compiling the CUDA compiler identification source file
"CMakeCUDACompilerId.cu" failed.
Compiler: /usr/local/cuda-11.4/bin/nvcc
Build flags:
Id flags: --keep;--keep-dir;tmp -v
The output was:
1
#$ NVCC_PREPEND_FLAGS="-allow-unsupported-compiler"
#$ _NVVM_BRANCH_=nvvm
#$ _SPACE_=
#$ _CUDART_=cudart
#$ _HERE_=/usr/local/cuda-11.4/bin
#$ _THERE_=/usr/local/cuda-11.4/bin
#$ _TARGET_SIZE_=
#$ _TARGET_DIR_=
#$ _TARGET_DIR_=targets/x86_64-linux
#$ TOP=/usr/local/cuda-11.4/bin/..
#$ NVVMIR_LIBRARY_DIR=/usr/local/cuda-11.4/bin/../nvvm/libdevice
#$
LD_LIBRARY_PATH=/usr/local/cuda-11.4/bin/../lib:/usr/local/cuda-11.4/lib64:
#$
PATH=/usr/local/cuda-11.4/bin/../nvvm/bin:/usr/local/cuda-11.4/bin:/tmp/pip-build-env-zklleoev/overlay/bin:/tmp/pip-build-env-zklleoev/normal/bin:/usr/local/cuda-11.4/bin:/home/user/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
#$ INCLUDES="-I/usr/local/cuda-11.4/bin/../targets/x86_64-linux/include"
#$ LIBRARIES=
"-L/usr/local/cuda-11.4/bin/../targets/x86_64-linux/lib/stubs"
"-L/usr/local/cuda-11.4/bin/../targets/x86_64-linux/lib"
#$ CUDAFE_FLAGS=
#$ PTXAS_FLAGS=
#$ rm tmp/a_dlink.reg.c
#$ gcc -D__NV_NO_HOST_COMPILER_CHECK=1 -D__CUDA_ARCH__=520 -E -x c++
-DCUDA_DOUBLE_MATH_FUNCTIONS -D__CUDACC__ -D__NVCC__
"-I/usr/local/cuda-11.4/bin/../targets/x86_64-linux/include"
-D__CUDACC_VER_MAJOR__=11 -D__CUDACC_VER_MINOR__=4
-D__CUDACC_VER_BUILD__=48 -D__CUDA_API_VER_MAJOR__=11
-D__CUDA_API_VER_MINOR__=4 -include "cuda_runtime.h" -m64
"CMakeCUDACompilerId.cu" -o "tmp/CMakeCUDACompilerId.cpp1.ii"
#$ cicc --c++14 --gnu_version=120200 --orig_src_file_name
"CMakeCUDACompilerId.cu" --allow_managed -arch compute_52 -m64
--no-version-ident -ftz=0 -prec_div=1 -prec_sqrt=1 -fmad=1
--include_file_name "CMakeCUDACompilerId.fatbin.c" -tused
--gen_module_id_file --module_id_file_name
"tmp/CMakeCUDACompilerId.module_id" --gen_c_file_name
"tmp/CMakeCUDACompilerId.cudafe1.c" --stub_file_name
"tmp/CMakeCUDACompilerId.cudafe1.stub.c" --gen_device_file_name
"tmp/CMakeCUDACompilerId.cudafe1.gpu" "tmp/CMakeCUDACompilerId.cpp1.ii" -o
"tmp/CMakeCUDACompilerId.ptx"
/usr/include/stdio.h(189): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(201): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(223): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(260): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(285): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(294): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(303): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(309): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(315): error: attribute "__malloc__" does not take
arguments
/usr/include/stdio.h(830): error: attribute "__malloc__" does not take
arguments
/usr/include/stdlib.h(579): error: attribute "__malloc__" does not take
arguments
/usr/include/stdlib.h(583): error: attribute "__malloc__" does not take
arguments
/usr/include/stdlib.h(812): error: attribute "__malloc__" does not take
arguments
/usr/include/c++/12/bits/stl_pair.h(634): error: argument list for class
template "std::pair" is missing
/usr/include/c++/12/bits/stl_pair.h(634): error: expected a ")"
/usr/include/c++/12/bits/stl_pair.h(634): error: template parameter "_T1"
may not be redeclared in this scope
/usr/include/c++/12/bits/stl_pair.h(634): error: expected a ";"
17 errors detected in the compilation of "CMakeCUDACompilerId.cu".
# --error 0x1 --
Call Stack (most recent call first):
/usr/share/cmake-3.25/Modules/CMakeDetermineCompilerId.cmake:6 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
/usr/share/cmake-3.25/Modules/CMakeDetermineCompilerId.cmake:48 (__determine_compiler_id_test)
/usr/share/cmake-3.25/Modules/CMakeDetermineCUDACompiler.cmake:307 (CMAKE_DETERMINE_COMPILER_ID)
vendor/llama.cpp/ggml/src/ggml-cuda/CMakeLists.txt:43 (enable_language)
-- Configuring incomplete, errors occurred!
See also "/tmp/tmpsrjhdqci/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/tmpsrjhdqci/build/CMakeFiles/CMakeError.log".
*** CMake configuration failed
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for llama-cpp-python
Failed to build llama-cpp-python
ERROR: Could not build wheels for llama-cpp-python, which is required to install pyproject.toml-based projects
It need gcc10, I should compile gcc10?
llama-cpp-python have exists version for cuda 11?
- Dominant language
- Python
- Stars
- 10.7k
- Forks
- 1.5k
- Avg merge
- 1h 40m
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from abetlen/llama-cpp-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
abetlen/llama-cpp-python#2424 ·
Maintainers usually reply within 1 day
-
Seven llama_sampler_init_* bindings admit keyword arguments that the ctypes function object silently dropsPossibly taken @Belal0066 claimed this 59 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
abetlen/llama-cpp-python#2371 ·
Maintainers usually reply within 1 day
-
uv add llama-cpp-python wheels fails for versions above 0.3.30Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
abetlen/llama-cpp-python#2352 · 1 comment · 3 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
abetlen/llama-cpp-python#2314 ·
Maintainers usually reply within 1 day
-
Llama.embed() calls LlamaBatch.add_sequence with old 3-arg signature; missing logits_arrayMay be free again @lxcxjxhx claimed this 136 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
abetlen/llama-cpp-python#2211 · 2 comments ·
Maintainers usually reply within 1 day
All issues in abetlen/llama-cpp-python
Similar issues
-
Bug IronPython Python 3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pyrevitlabs/pyRevit#4184 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 74/100
jqueryscript/awesome-claude-code#1009 ·
-
tests
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
[Plugin] 群聊记忆 · 人格养成Open
Difficulty 1/5 1-3 hours Newbie friendliness 74/100