Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when run with docker: error while loading shared libraries: libggml.so #140

Open
franksonet opened this issue Oct 11, 2023 · 4 comments

Comments

@franksonet
Copy link

franksonet commented Oct 11, 2023

Environment:

MacOS M1 pro

Model:

chatglm2-6b量化模型

Error:

Run with docker

docker run -it --rm -v $PWD:/opt liplusx/chatglm.cpp:main \
    ./build/bin/main -m /opt/chatglm2-ggml.bin -p "你好"

Error:

./build/bin/main: error while loading shared libraries: libggml.so: cannot open shared object file: No such file or directory
@franksonet franksonet changed the title Mac上Docker运行报错: error while loading shared libraries: libggml.so Error when run with docker: error while loading shared libraries: libggml.so Oct 14, 2023
@oncloudit
Copy link

oncloudit commented Nov 3, 2023

same error in centos 7.6 with both Building Locally and Pre Build Option.

@M1saka10010
Copy link

M1saka10010 commented Nov 11, 2023

same error in debian11(wsl) with both Building Locally and Pre Build Option.

@meicale
Copy link

meicale commented Nov 12, 2023

Same error on WSL2(ubuntu 22.04) with pre build docker image.

@sosoayaen
Copy link

Cause of the Issue:
The corresponding executable file main couldn't find the libggml.so file in the system during runtime. Indeed, in the Dockerfile, only the final executable file was copied to the final image, while the dynamic library libggml.so was missed.

Solution:
Modify the Dockerfile. Below the line where the main executable is copied, also copy the libggml.so. The Dockerfile should be updated as follows:

COPY --from=build /chatglm.cpp/build/bin/main /chatglm.cpp/build/bin/main
COPY --from=build /chatglm.cpp/build/lib/libggml.so /chatglm.cpp/build/lib/libggml.so

Rebuild this image and restart to fix this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants