Steps to Build and Install llama-cpp-python 0.3.7 w/CUDA on Windows 11 [06/03/2025]
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 90/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
調査の方向性
この issue には、Windows 11 上で CUDA を使用して llama-cpp-python をビルドするための手順が段階的に示されています。検証するには、リポジトリを clone し、submodule を更新し、環境変数を設定して、pip install コマンドを実行します。作業は完了しています。タスクは、これらの手順をプロジェクトの公式ドキュメント、おそらく README または docs/ ディレクトリに統合することです。
索引モデルが issue の本文から書いたものです。
説明
After reviewing multiple GitHub issues, forum discussions, and guides from other Python packages, I was able to successfully build and install llama-cpp-python 0.3.7 with CUDA on Windows 11. Below are the exact steps I followed, which may help others facing similar build issues.
Errors Encountered During Build
I encountered the following build errors even after installing the right build tools. The issue was resolved by updating the llama.cpp submodule.
D:\llama-cpp-python\vendor\llama.cpp\common\log.cpp(28,79): error C2039: 'system_clock': is not a member of 'std::chrono' [%localappdata%\Temp\tmp0zkelev6\build\vendor\llama.cpp\common\common.vcxproj]
D:\llama-cpp-python\vendor\llama.cpp\common\log.cpp(28,79): error C3083: 'system_clock': the symbol to the left of a '::' must be a type [%localappdata%\Temp\tmp0zkelev6\build\vendor\llama.cpp\common\common.vcxproj]
D:\llama-cpp-python\vendor\llama.cpp\common\log.cpp(28,93): error C2039: 'now': is not a member of 'std::chrono' [%localappdata%\Temp\tmp0zkelev6\build\vendor\llama.cpp\common\common.vcxproj]
D:\llama-cpp-python\vendor\llama.cpp\common\log.cpp(28,93): error C3861: 'now': identifier not found [%localappdata%\Temp\tmp0zkelev6\build\vendor\llama.cpp\common\common.vcxproj]
D:\llama-cpp-python\vendor\llama.cpp\common\log.cpp(28,25): error C2672: 'std::chrono::duration_cast': no matching overloaded function found [%localappdata%\Temp\tmp0zkelev6\build\vendor\llama.cpp\common\common.vcxproj]
Hardware Setup
- OS: Windows 11
- CPU: Intel i9-9900K
- GPUs: RTX 3080, RTX A4000
Software Setup
- Git Bash: 2.48.1
- Python: 3.12.9 (likely works with 3.11 and 3.13)
- CMake: 4.0.0-rc3
- Visual Studio 2022: 17.13.2 with the following workloads installed -
- Python development
- Desktop development with C++
- Linux and embedded development with C++
- CUDA Toolkit: 12.8.0 (installed without modifying PhysX, Display, and HD Audio drivers, as they were already installed by the latest Studio Driver Package v572.60 that I'm using)
Installation Steps
Make sure to use Command Prompt and not PowerShell, for the following steps.
1. Clone the Repository
Navigate to the directory where you want to build the package and run:
git clone --recursive -j%NUMBER_OF_PROCESSORS% https://github.com/abetlen/llama-cpp-python.git
2. Navigate to the Package Directory
cd llama-cpp-python
3. Update the llama.cpp Submodule
git submodule update --remote vendor\llama.cpp
4. Set Required Environment Variables
Configure the necessary environment variables:
set FORCE_CMAKE=1
set CMAKE_ARGS=-DGGML_CUDA=ON
# Optional variables to speed up the build process
# set CMAKE_BUILD_PARALLEL_LEVEL=%NUMBER_OF_PROCESSORS%
# set MAKEFLAGS=-j%NUMBER_OF_PROCESSORS%
These are only temporary and will be unset when you exit the current CMD session.
5. Build and Install
Run the following command to build and install the package:
python -m pip install . --no-cache-dir --force-reinstall --upgrade
This setup worked for me, and I hope it helps others facing similar build issues.
- 主要言語
- Python
- スター
- 10.6k
- フォーク
- 1.5k
- 平均マージ
- 6時間 43分
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
abetlen/llama-cpp-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
abetlen/llama-cpp-python#2371 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
abetlen/llama-cpp-python#2352 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
abetlen/llama-cpp-python#2211 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
abetlen/llama-cpp-python#2210 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
abetlen/llama-cpp-python#2145 ·
abetlen/llama-cpp-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anthropics/skills#1811 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
speaches-ai/speaches#678 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
datalayer/mcp-compose#42 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
conda-forge/spacy-feedstock#177 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
UKGovernmentBEIS/inspect_evals#2523 ·