-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinstall.sh
executable file
·75 lines (61 loc) · 2.09 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# Title: ntop.sh
# Author: Pelochus
# Brief: Basic installation script for Rockchip NPUs, including LLMs and RKNN Toolkit 2
# Check for more info: https://github.com/Pelochus/ezrknpu/
message_print() {
echo
echo "#########################################"
echo $1
echo "#########################################"
echo
}
# If zero, both NN and LLM will be installed
[ $# = 0 ]
ARGCOUNT_IS_ZERO=$?
if [[ $1 = '-h' ]]
then
echo
echo "ezrknpu install help"
echo
echo "If you want to install both LLM and NN-Toolkit do not provide any parameter"
echo
echo "-llm: \ŧOnly installs ezrknn-llm"
echo "-nn: \tOnly installs ezrknn-toolkit2"
echo "-h: \tShows this help screen"
echo
echo "For more information visit https://github.com/Pelochus/ezrknpu"
echo
exit
fi
message_print "Installing apt dependencies..."
sudo apt update
sudo apt install -y git git-lfs python-is-python3 python3-pip python3-dev build-essential cmake libxslt1-dev zlib1g-dev libglib2.0-dev libsm6 libprotobuf-dev libhdf5-dev
OS_VERSION=$(grep 'VERSION_ID' /etc/os-release | awk -F '=' '{print $2}' | tr -d '"')
if $(dpkg --compare-versions "${OS_VERSION}" "ge" "24.10")
then
sudo apt install -y libgl1 libglx-mesa0
else
sudo apt install -y libgl1-mesa-glx
fi
# sudo apt install -y adb # For running the NPU in Android
message_print "Cloning main repo with submodules..."
# This also clones submodules
# Add --remote-submodules if you want to update submodules to latest commit and not current repo commit
git clone --recurse-submodules -j2 https://github.com/Pelochus/ezrknpu
cd ezrknpu
message_print "Updating submodules..."
git submodule update --recursive --remote # Submodules should be updated, but just in case I forget
if [[ $1 = '-llm' || $ARGCOUNT_IS_ZERO ]]
then
message_print "Installing RKNN LLM with install.sh script..."
cd ezrknn-llm
bash install.sh
fi
if [[ $1 = '-nn' || $ARGCOUNT_IS_ZERO ]]
then
message_print "Installing RKNN Toolkit 2 with install.sh script..."
cd ../ezrknn-toolkit2
bash install.sh
fi
message_print "Everything done!"