Skip to content

Commit 56c1218

Browse files
committed
Linux kcpp-ROCm pyinstaller script
Linux pyinstaller script to compile a single file executable of KoboldCpp-ROCm. File Size ends up to be about 1.1GB because it adds in all ROCm GPU kernels and library files. (could possibly be improved)
1 parent c39c357 commit 56c1218

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

make_pyinstaller.sh

100644100755
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#!/bin/bash
2-
3-
pyinstaller --noconfirm --onefile --clean --console --collect-all customtkinter --icon "./niko.ico" \
2+
NUMCPUS=`grep -c '^processor' /proc/cpuinfo` # Get max number of CPU threads
3+
NUMCPUS=$(echo "($NUMCPUS*0.75+0.5)/1" | bc) # Set CPU threads to 3/4th avail. threads, rounding to nearest whole number
4+
printf "\033[33;1mMake sure you've installed OpenCL and OpenBLAS by using \"sudo apt install libclblast-dev libopenblas-dev\"\n\n\n\n\n\n\033[0m\n"
5+
sleep 4
6+
# install dependencies
7+
pip install pyinstaller customtkinter && make clean && \
8+
# Ensure all backends are built then build executable file
9+
make LLAMA_HIPBLAS=1 LLAMA_CLBLAST=1 LLAMA_OPENBLAS=1 -j$NUMCPUS && \
10+
pyinstaller --noconfirm --onefile --clean --console --collect-all customtkinter --collect-all libclblast-dev --collect-all libopenblas-dev --collect-all clinfo --icon ".\niko.ico" \
411
--add-data "./klite.embd:." \
512
--add-data "./kcpp_docs.embd:." \
613
--add-data "./koboldcpp_default.so:." \
@@ -9,6 +16,10 @@ pyinstaller --noconfirm --onefile --clean --console --collect-all customtkinter
916
--add-data "./koboldcpp_noavx2.so:." \
1017
--add-data "./koboldcpp_clblast.so:." \
1118
--add-data "./koboldcpp_clblast_noavx2.so:." \
19+
--add-data "./koboldcpp_hipblas.so:." \
20+
--add-data "/opt/rocm/lib/libhipblas.so:." \
21+
--add-data "/opt/rocm/lib/librocblas.so:." \
1222
--add-data "./rwkv_vocab.embd:." \
1323
--add-data "./rwkv_world_vocab.embd:." \
14-
"./koboldcpp.py" -n "koboldcpp"
24+
--add-data "/opt/rocm/lib/rocblas:." \
25+
"./koboldcpp.py" -n "koboldcpp_rocm"

0 commit comments

Comments
 (0)