llama-cpp-python icon indicating copy to clipboard operation
llama-cpp-python copied to clipboard

issue tying to install on WSL

Open silvacarl2 opened this issue 11 months ago • 4 comments

no matter what i try, i keep getting this issue on WSL:

pip install --upgrade --no-cache-dir --force-reinstall git+https://github.com/abetlen/llama-cpp-python Defaulting to user installation because normal site-packages is not writeable Collecting git+https://github.com/abetlen/llama-cpp-python Cloning https://github.com/abetlen/llama-cpp-python to /tmp/pip-req-build-7dtawo9w Running command git clone --filter=blob:none --quiet https://github.com/abetlen/llama-cpp-python /tmp/pip-req-build-7dtawo9w Resolved https://github.com/abetlen/llama-cpp-python to commit 2bc1d97c9672320828e70dc8293d5f8754682109 Running command git submodule update --init --recursive -q Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Collecting typing-extensions>=4.5.0 (from llama_cpp_python==0.3.5) Downloading typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB) Collecting numpy>=1.20.0 (from llama_cpp_python==0.3.5) Downloading numpy-2.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (62 kB) Collecting diskcache>=5.6.1 (from llama_cpp_python==0.3.5) Downloading diskcache-5.6.3-py3-none-any.whl.metadata (20 kB) Collecting jinja2>=2.11.3 (from llama_cpp_python==0.3.5) Downloading jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB) Collecting MarkupSafe>=2.0 (from jinja2>=2.11.3->llama_cpp_python==0.3.5) Downloading MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.0 kB) Downloading diskcache-5.6.3-py3-none-any.whl (45 kB) Downloading jinja2-3.1.4-py3-none-any.whl (133 kB) Downloading numpy-2.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.4 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.4/16.4 MB 83.9 MB/s eta 0:00:00 Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB) Downloading MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20 kB) Building wheels for collected packages: llama_cpp_python Building wheel for llama_cpp_python (pyproject.toml) ... -Killed

silvacarl2 avatar Dec 20 '24 22:12 silvacarl2

This is an out-of-memory problem, I'm facing the same. The build keep allocating more and more memory, and eventually crashes. For me, it crashes after allocating about 40Gb (!) mem

adam-ah avatar Jan 19 '25 09:01 adam-ah

try increasing your swap space

silvacarl2 avatar Jan 19 '25 21:01 silvacarl2

Not wanting to be rude but if the compilation process of such a small piece of software eats up 40gb of ram and wanting even more, the issue is not with my settings, obviously

adam-ah avatar Jan 19 '25 21:01 adam-ah

I'm experiencing the same issue, where the process consumes 188GB of RAM, leading to a crash. The solution below resolved it for me:

Solution: Compile with Ninja Support

1. Install Ninja

  • Run the following command to install Ninja:
pip install ninja
  • Build llama-cpp-python with Binary Preference
pip install llama-cpp-python -v --prefer-binary

Note: The -v flag enables verbose output for debugging purposes.

PedroCorcaque avatar Feb 04 '25 17:02 PedroCorcaque