llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

llama-cli: error while loading shared libraries: libllama.so: cannot open shared object file: No such file or directory

Open erickwill opened this issue 1 year ago • 11 comments

Name and Version

Version: llama-b4434-bin-ubuntu-x64

Operating systems

Linux

Which llama.cpp modules do you know to be affected?

llama-cli

Command line

[erick@Xeon bin]$  ./llama-cli -m ~/Apps/Llama/EVA-LLaMA-3.33-70B-v0.1.Q4_K_M.gguf -p "I believe the meaning of life is" -n 128

Problem description & steps to reproduce

Trying to run this new version and got this message: [erick@Xeon bin]$ ./llama-cli -m ~/Apps/Llama/EVA-LLaMA-3.33-70B-v0.1.Q4_K_M.gguf -p "I believe the meaning of life is" -n 128 ./llama-cli: error while loading shared libraries: libllama.so: cannot open shared object file: No such file or directory

The last build version that works properly is: llama-b4406-bin-ubuntu-x64

First Bad Commit

The last build version that works properly is: llama-b4406-bin-ubuntu-x64

Relevant log output

No response

erickwill avatar Jan 07 '25 14:01 erickwill

Did you locate the path to libllama.so in your system after the installation and tried to append this path to LD_LIBRARY_PATH?

ahadji05 avatar Jan 12 '25 20:01 ahadji05

Got the same by using the binary files. What do you mean with installation? Should i not work out of the box with binary files?

CyberT33N avatar Jan 16 '25 12:01 CyberT33N

So when you build it locally it will work I'll just go this way

git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp


# https://github.com/ggerganov/llama.cpp/blob/master/docs/build.md
# CUDA BUILD
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release

cd build/bin
./llama-cli -m "/home/user/test/xxxxxxxxxx.gguf"

CyberT33N avatar Jan 16 '25 12:01 CyberT33N

Last builds do not include the .so library anymore. Related: https://github.com/ggerganov/llama.cpp/issues/11144

pqnet avatar Jan 16 '25 16:01 pqnet

Can confirm Ubuntu zip files do not include libllama.so anymore. As a workaround you can either compile it yourself or get the libraries from the Docker version.

maicogg avatar Jan 24 '25 15:01 maicogg

Will be fixed with the next release: #11392

Please close the issue when you confirm.

ggerganov avatar Jan 24 '25 16:01 ggerganov

Will be fixed with the next release: #11392

Please close the issue when you confirm.

Have tested b4552, it works on my machine(s). Output of ldd llama-cli on Ubuntu 24.04.1:

 ldd llama-cli
        linux-vdso.so.1 (0x00007fff8b081000)
        libllama.so (0x00007fdfde534000)
        libggml.so (0x00007fdfde525000)
        libggml-base.so (0x00007fdfde451000)
        libcurl.so.4 => /lib/x86_64-linux-gnu/libcurl.so.4 (0x00007fdfde383000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fdfde105000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fdfde01a000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fdfddfec000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdfdddda000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fdfde801000)
        libggml-cpu.so (0x00007fdfddd22000)
        libggml-rpc.so (0x00007fdfddd0e000)
        libnghttp2.so.14 => /lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007fdfddce1000)
        libidn2.so.0 => /lib/x86_64-linux-gnu/libidn2.so.0 (0x00007fdfddcbf000)
        librtmp.so.1 => /lib/x86_64-linux-gnu/librtmp.so.1 (0x00007fdfddca1000)
        libssh.so.4 => /lib/x86_64-linux-gnu/libssh.so.4 (0x00007fdfddc30000)
        libpsl.so.5 => /lib/x86_64-linux-gnu/libpsl.so.5 (0x00007fdfddc1c000)
        libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 (0x00007fdfddb72000)
        libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007fdfdd65d000)
        libgssapi_krb5.so.2 => /lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007fdfdd609000)
        libldap.so.2 => /lib/x86_64-linux-gnu/libldap.so.2 (0x00007fdfdd5ac000)
        liblber.so.2 => /lib/x86_64-linux-gnu/liblber.so.2 (0x00007fdfdd59c000)
        libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007fdfdd4e2000)
        libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007fdfdd4d4000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fdfdd4b6000)
        libgomp.so.1 => /lib/x86_64-linux-gnu/libgomp.so.1 (0x00007fdfdd460000)
        libunistring.so.5 => /lib/x86_64-linux-gnu/libunistring.so.5 (0x00007fdfdd2b3000)
        libgnutls.so.30 => /lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007fdfdd0b9000)
        libhogweed.so.6 => /lib/x86_64-linux-gnu/libhogweed.so.6 (0x00007fdfdd071000)
        libnettle.so.8 => /lib/x86_64-linux-gnu/libnettle.so.8 (0x00007fdfdd01a000)
        libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fdfdcf96000)
        libkrb5.so.3 => /lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007fdfdcecd000)
        libk5crypto.so.3 => /lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007fdfdcea1000)
        libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007fdfdce9b000)
        libkrb5support.so.0 => /lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007fdfdce8c000)
        libsasl2.so.2 => /lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007fdfdce72000)
        libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007fdfdce4f000)
        libp11-kit.so.0 => /lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007fdfdccab000)
        libtasn1.so.6 => /lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007fdfdcc95000)
        libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007fdfdcc8c000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fdfdcc79000)
        libffi.so.8 => /lib/x86_64-linux-gnu/libffi.so.8 (0x00007fdfdcc6d000)

pqnet avatar Jan 25 '25 19:01 pqnet

b4641

./build/bin/llama-cli ./build/bin/llama-cli: error while loading shared libraries: libllama.so: cannot open shared object file: No such file or directory

system: Ubuntu 18

Liozhang avatar Feb 05 '25 04:02 Liozhang

b4641

./build/bin/llama-cli ./build/bin/llama-cli: error while loading shared libraries: libllama.so: cannot open shared object file: No such file or directory

system: Ubuntu 18

@Liozhang you have to go into the bin directory to help it find the library:

cd build/bin
./llama-cli

or configure your dynamic loader to find the library in that directory

pqnet avatar Feb 06 '25 10:02 pqnet

For people like me who want to package the binary version for their distro, the fix was simply to install the libraries into the system-wide shared library path.

Example adapted from the AUR package I've put together:

sudo install -Dm755 build/bin/lib* -t /usr/lib/

For a concise and helpful intro to shared libraries, see this chapter from the LPI 101 learning material.

neitsab avatar Feb 14 '25 12:02 neitsab

For people like me who want to package the binary version for their distro, the fix was simply to install the libraries into the system-wide shared library path.

Example adapted from the AUR package I've put together:

sudo install -Dm755 build/bin/lib* -t /usr/lib/

For a concise and helpful intro to shared libraries, see this chapter from the LPI 101 learning material.

If you are not creating a package, it is better to not mess with the directories where the package manager is putting their stuff, and use /usr/local/lib

pqnet avatar Feb 15 '25 14:02 pqnet

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Apr 01 '25 01:04 github-actions[bot]