Skip to content

Commit 58038cd

Browse files
committed
try using qemu to do the pyinstaller
1 parent e9d2332 commit 58038cd

File tree

3 files changed

+58
-19
lines changed

3 files changed

+58
-19
lines changed

.github/workflows/kcpp-build-release-arm64.yaml

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,53 @@
11
name: Koboldcpp Linux ARM64
22

3-
on: workflow_dispatch
3+
on:
4+
workflow_dispatch
5+
46
env:
57
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
6-
NOAVX2: 1
78

89
jobs:
910
linux-arm:
1011
runs-on: ubuntu-latest
1112
steps:
12-
- name: Clone
13+
- name: Clone Repository
1314
id: checkout
1415
uses: actions/checkout@v3
1516
with:
1617
ref: ${{ github.head_ref || github.ref_name }}
1718

18-
- name: Build Dependencies
19-
id: depends1
19+
- name: Setup Build Environment
20+
id: setup_environment
2021
run: |
2122
sudo apt-get update
22-
sudo apt-get install -y python3 python3-pip python3-dev build-essential \
23-
libffi-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev \
24-
crossbuild-essential-arm64 qemu qemu-user qemu-user-static \
25-
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
23+
sudo apt-get install -y \
24+
build-essential \
25+
crossbuild-essential-arm64 \
26+
gcc-aarch64-linux-gnu \
27+
g++-aarch64-linux-gnu \
28+
python3 \
29+
python3-tk \
30+
python3-pip \
31+
qemu-user-static \
32+
binfmt-support \
33+
qemu-user-binfmt \
34+
libffi-dev:arm64 \
35+
zlib1g-dev:arm64 \
36+
libssl-dev:arm64
37+
sudo update-binfmts --enable qemu-aarch64
2638
27-
- name: Python Dependencies
28-
id: depends2
39+
- name: Install ARM64 Python Environment
40+
id: install_arm_python
2941
run: |
30-
pip install customtkinter pyinstaller tk
42+
# Install ARM64 Python with QEMU emulation
43+
sudo apt-get install -y python3-arm64 python3-pip-arm64
44+
sudo ln -sf /usr/bin/python3-arm64 /usr/bin/python3-arm
45+
sudo ln -sf /usr/bin/pip3-arm64 /usr/bin/pip3-arm
46+
47+
# Install necessary Python packages in ARM64 environment
48+
python3-arm -m pip install --no-cache-dir customtkinter pyinstaller tk psutil
3149
32-
- name: Build with ARM NEON Support
50+
- name: Build for ARM
3351
id: build_binary
3452
run: |
3553
# Enable cross-compilation for ARM
@@ -40,14 +58,35 @@ jobs:
4058
export UNAME_M=aarch64
4159
export UNAME_S=Linux
4260
61+
# Build any necessary C/C++ components
4362
make LLAMA_PORTABLE=1
4463
chmod +x './create_ver_file.sh'
45-
. create_ver_file.sh
46-
pyinstaller --noconfirm --onefile --collect-all customtkinter --collect-all psutil --add-data './koboldcpp_default.so:.' --add-data './kcpp_adapters:./kcpp_adapters' --add-data './koboldcpp.py:.' --add-data './klite.embd:.' --add-data './kcpp_docs.embd:.' --add-data './kcpp_sdui.embd:.' --add-data './taesd.embd:.' --add-data './taesd_xl.embd:.' --add-data './rwkv_vocab.embd:.' --add-data './rwkv_world_vocab.embd:.' --version-file './version.txt' --clean --console koboldcpp.py -n "koboldcpp-linux-arm64"
64+
./create_ver_file.sh
4765
48-
- name: Save artifact
66+
# Package with ARM64 PyInstaller
67+
python3-arm -m pyinstaller \
68+
--noconfirm \
69+
--onefile \
70+
--collect-all customtkinter \
71+
--collect-all psutil \
72+
--add-data './koboldcpp_default.so:.' \
73+
--add-data './kcpp_adapters:./kcpp_adapters' \
74+
--add-data './koboldcpp.py:.' \
75+
--add-data './klite.embd:.' \
76+
--add-data './kcpp_docs.embd:.' \
77+
--add-data './kcpp_sdui.embd:.' \
78+
--add-data './taesd.embd:.' \
79+
--add-data './taesd_xl.embd:.' \
80+
--add-data './rwkv_vocab.embd:.' \
81+
--add-data './rwkv_world_vocab.embd:.' \
82+
--version-file './version.txt' \
83+
--clean \
84+
--console \
85+
koboldcpp.py \
86+
-n "koboldcpp-linux-arm64"
87+
88+
- name: Save Artifact
4989
uses: actions/upload-artifact@v3
5090
with:
5191
name: kcpp_linux_arm64_binary
5292
path: dist/
53-

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ else
395395
ifndef LLAMA_HIPBLAS
396396
ifndef LLAMA_VULKAN
397397
ifndef LLAMA_METAL
398-
NOTIFY_MSG = @echo -e '\nYou did a basic CPU build. For faster speeds, install and link a BLAS library. \nSet LLAMA_VULKAN=1 to compile with Vulkan support. This is just a reminder, not an error.'
398+
NOTIFY_MSG = @echo -e '\n***\nYou did a basic CPU build. For faster speeds, consider installing and linking a GPU BLAS library. For example, set LLAMA_VULKAN=1 to compile with Vulkan support. Read the KoboldCpp Wiki for more information. This is just a reminder, not an error.\n***\n'
399399
endif
400400
endif
401401
endif

koboldcpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4344,7 +4344,7 @@ def main(launch_args,start_server=True):
43444344
show_gui()
43454345
except Exception as ex:
43464346
exitcounter = 999
4347-
ermsg = "Reason: " + str(ex) + "\nFile selection GUI unsupported.\ncustomtkinter python module required!\n\nPlease check command line options with --help"
4347+
ermsg = "Reason: " + str(ex) + "\nFile selection GUI unsupported.\ncustomtkinter python module required!\n\nYou must use the command line instead, e.g. python ./koboldcpp.py --help"
43484348
show_gui_msgbox("Warning, GUI failed to start",ermsg)
43494349
if args.skiplauncher:
43504350
print("Note: In order to use --skiplauncher, you need to specify a model with --model")

0 commit comments

Comments
 (0)