Skip to content

Cannot run llama.cpp on termux. Bash permission denied #447

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

Closed
ManuXD32 opened this issue Mar 23, 2023 · 4 comments
Closed

Cannot run llama.cpp on termux. Bash permission denied #447

ManuXD32 opened this issue Mar 23, 2023 · 4 comments

Comments

@ManuXD32
Copy link

When trying to run './bin/main/ -m ./models/7B/ggml-model-q4_0.bin -n 128' termux throws this output:
bash: ./bin/main: permission denied

@KerfuffleV2
Copy link
Collaborator

KerfuffleV2 commented Mar 24, 2023

There's no ./bin and you also have a slash after main/ which wouldn't work even if the executable was there. Use ./main -m etc

Obviously you have to compile it first using make. Refer to the README in the repo. It has instructions for all this stuff.

@prsyahmi
Copy link

You might have no execute permission. Have you chmod +x ./bin/main?

@ManuXD32
Copy link
Author

@KerfuffleV2 @prsyahmi thank you for your help, the problem was that i wasn't running it from $HOME.

@olealgoritme
Copy link

The limitation is that the file system is read-only on newer Android versions.
Apps, like termux, has write-access in their app directories, so we move the files there.
Move the compiled binary and model to the ~/ ($HOME) directory (termux app directory).

adb push llama /sdcard/
adb push model.bin /sdcard/
cd /sdcard
mv llama ~/
mv model.bin ~/
cd ~/
chmod +x llama
./llama

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