forked from airockchip/rknn-llm
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathinstall.sh
49 lines (33 loc) · 1.33 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# Made by Pelochus
# Check for more info: https://github.com/Pelochus/ezrknn-llm/
message_print() {
echo
echo "#########################################"
echo $1
echo "#########################################"
echo
}
message_print "Checking root permission..."
if [ "$EUID" -ne 0 ]; then
echo "Please run this script as root!"
exit
fi
# message_print "Changing to repository..."
# git clone https://github.com/Pelochus/ezrknn-llm.git
# cd ezrknn-llm/
message_print "Installing RKNN LLM libraries..."
cp ./rkllm-runtime/runtime/Linux/librkllm_api/aarch64/* /usr/lib
cp ./rkllm-runtime/runtime/Linux/librkllm_api/include/* /usr/local/include
message_print "Compiling LLM runtime for Linux..."
cd ./rkllm-runtime/examples/rkllm_api_demo/
bash build-linux.sh
message_print "Moving rkllm to /usr/bin..."
cp ./build/build_linux_aarch64_Release/llm_demo /usr/bin/rkllm # We also change the name for remembering how to call it from shell
message_print "Increasing file limit for all users (needed for LLMs to run)..."
echo "* soft nofile 16384" >> /etc/security/limits.conf
echo "* hard nofile 1048576" >> /etc/security/limits.conf
# Add root too, just in case
echo "root soft nofile 16384" >> /etc/security/limits.conf
echo "root hard nofile 1048576" >> /etc/security/limits.conf
message_print "Done installing ezrknn-llm!"