how to compile on last gcc?
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- cmake, python
- 領域
- build-system
研究方向
使用 CUDA 11.4 和 GCC 12.2.0 建置 llama-cpp-python 時,錯誤發生在 CMake 辨識 CUDA 編譯器的過程中。查看專案建置腳本中的 CMake 設定,尤其是傳遞給 nvcc 的 flags。問題在於 CUDA 11.4 與較新 GCC 版本之間的相容性;檢查專案是否記錄了受支援的編譯器版本,或是否需要某個 workaround flag。測試包括修改 CMake 引數或環境變數,以確認建置是否成功。
由索引模型根據 Issue 內容生成。
描述
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?
- 主要語言
- Python
- 星號
- 10.6k
- 分支
- 1.5k
- 平均合併
- 3 小時 57 分鐘
- 30 天內合併 PR
- 4
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
abetlen/llama-cpp-python 的其他 Issue
-
Seven llama_sampler_init_* bindings admit keyword arguments that the ctypes function object silently drops可能已有人在做 @Belal0066 於 17 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 88/100
abetlen/llama-cpp-python#2371 ·
維護者通常 1 天內回覆
-
uv add llama-cpp-python wheels fails for versions above 0.3.30可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 65/100
abetlen/llama-cpp-python#2352 · 1 則留言 · 2 個 reaction ·
維護者通常 1 天內回覆
-
Docs: consolidate build-from-source and GPU backend guide可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
abetlen/llama-cpp-python#2314 ·
維護者通常 1 天內回覆
-
Llama.embed() calls LlamaBatch.add_sequence with old 3-arg signature; missing logits_array可能重新可做 @lxcxjxhx 於 94 天前認領,目前沒有進行中的 PR。 未關閉
難度 2/5 1-3 小時 新手友好度 65/100
abetlen/llama-cpp-python#2211 · 2 則留言 ·
維護者通常 1 天內回覆
-
Llama() silently accepts and discards `embedding` kwarg; .embed() then raises confusingly可能已有人在做 @Anai-Guo 於 34 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 65/100
abetlen/llama-cpp-python#2210 ·
維護者通常 1 天內回覆
查看 abetlen/llama-cpp-python 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 86/100
UKGovernmentBEIS/inspect_ai#5802 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
no-human-ai/no_human#660 ·
維護者通常 1 天內回覆
-
documentation good first issue
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
documentation need help question
難度 1/5 1-3 小時 新手友好度 66/100
phonology024/babelscribe#26 ·
-
bug
難度 2/5 1-3 小時 新手友好度 62/100