mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-09 06:19:14 +02:00
add workflow for older pc
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
name: Koboldcpp Windows OlderPC Nocuda
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
commit_hash:
|
||||
description: 'Optional commit hash to build from'
|
||||
required: false
|
||||
default: ''
|
||||
|
||||
env:
|
||||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
||||
|
||||
jobs:
|
||||
windows:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: Clone
|
||||
id: checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ inputs.commit_hash != '' && inputs.commit_hash || github.head_ref || github.ref_name }}
|
||||
|
||||
- name: Show Commit Used
|
||||
run: |
|
||||
echo "Building from ref: ${{ inputs.commit_hash != '' && inputs.commit_hash || github.head_ref || github.ref_name }}"
|
||||
|
||||
- name: Get Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8.10
|
||||
|
||||
- name: Install python dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install customtkinter==5.2.0 pyinstaller==5.11.0 psutil==5.9.5
|
||||
|
||||
- name: Display full Visual Studio info Before
|
||||
run: |
|
||||
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -products * -format json
|
||||
shell: pwsh
|
||||
|
||||
- name: Visual Studio 2019 Reinstall
|
||||
shell: cmd
|
||||
run: |
|
||||
@echo off
|
||||
echo Preparing setup
|
||||
curl -fLO https://download.visualstudio.microsoft.com/download/pr/1fbe074b-8ae1-4e9b-8e83-d1ce4200c9d1/61098e228df7ba3a6a8b4e920a415ad8878d386de6dd0f23f194fe1a55db189a/vs_Enterprise.exe
|
||||
vs_Enterprise.exe --quiet --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.CLI.Support --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.Workload.UniversalBuildTools --add Microsoft.VisualStudio.Component.VC.CMake.Project
|
||||
echo Waiting for VS2019 setup
|
||||
set "ProcessName=setup.exe"
|
||||
:CheckProcess
|
||||
tasklist /FI "IMAGENAME eq %ProcessName%" | find /I "%ProcessName%" >nul
|
||||
if %errorlevel%==0 (
|
||||
ping 127.0.0.1 /n 5 >nul
|
||||
goto CheckProcess
|
||||
)
|
||||
echo VS2019 Setup completed
|
||||
exit /b 0
|
||||
|
||||
- name: Disable Visual Studio 2022 by Renaming
|
||||
run: |
|
||||
Rename-Item "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" "Enterprise_DISABLED"
|
||||
shell: pwsh
|
||||
|
||||
- name: Display full Visual Studio info After
|
||||
run: |
|
||||
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -products * -format json
|
||||
shell: pwsh
|
||||
|
||||
- name: Download and install win64devkit
|
||||
run: |
|
||||
curl -L https://github.com/skeeto/w64devkit/releases/download/v1.22.0/w64devkit-1.22.0.zip --output w64devkit.zip
|
||||
Expand-Archive w64devkit.zip -DestinationPath .
|
||||
|
||||
- name: Add w64devkit to PATH
|
||||
run: |
|
||||
echo "$(Get-Location)\w64devkit\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
|
||||
|
||||
- name: Print System Environment Variables
|
||||
id: printvars
|
||||
run: |
|
||||
echo "Number of processors: ${env:NUMBER_OF_PROCESSORS}"
|
||||
echo "Processor Architecture: ${env:PROCESSOR_ARCHITECTURE}"
|
||||
echo "Computer Name: ${env:COMPUTERNAME}"
|
||||
wmic cpu get name
|
||||
wmic os get TotalVisibleMemorySize, FreePhysicalMemory
|
||||
|
||||
- name: Build Non-CUDA
|
||||
id: make_build
|
||||
run: |
|
||||
make LLAMA_CLBLAST=1 LLAMA_VULKAN=1 LLAMA_PORTABLE=1 -j ${env:NUMBER_OF_PROCESSORS} LLAMA_NOAVX1=1
|
||||
|
||||
- name: Package PyInstallers
|
||||
id: make_pyinstaller
|
||||
run: |
|
||||
./make_pyinstaller_oldpc.bat
|
||||
|
||||
- name: Save artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: kcpp_windows_pyinstallers
|
||||
path: dist/
|
||||
@@ -164,13 +164,19 @@ CXXV := $(shell $(CXX) --version | head -n 1)
|
||||
# For x86 based architectures
|
||||
ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686 amd64))
|
||||
ifdef LLAMA_PORTABLE
|
||||
SIMPLECFLAGS += -mavx -msse3 -mssse3
|
||||
SIMPLERCFLAGS += -msse3 -mssse3
|
||||
ifdef LLAMA_NOAVX1
|
||||
FULLCFLAGS += -msse3 -mssse3
|
||||
SIMPLECFLAGS += -msse3 -mssse3
|
||||
else
|
||||
ifdef LLAMA_NOAVX2
|
||||
FULLCFLAGS += -msse3 -mssse3 -mavx
|
||||
FULLCFLAGS += -mavx -msse3 -mssse3
|
||||
SIMPLECFLAGS += -mavx -msse3 -mssse3
|
||||
else
|
||||
FULLCFLAGS += -mavx2 -msse3 -mssse3 -mfma -mf16c -mavx
|
||||
SIMPLECFLAGS += -mavx -msse3 -mssse3
|
||||
endif # LLAMA_NOAVX2
|
||||
endif # LLAMA_NOAVX1
|
||||
else
|
||||
CFLAGS += -march=native -mtune=native
|
||||
SIMPLECFLAGS += -march=native -mtune=native
|
||||
|
||||
+6
-2
@@ -27,12 +27,16 @@ fi
|
||||
KCPP_CUDA=$(<conda/envs/linux/cudaver)
|
||||
KCPP_CUDAAPPEND=-cuda${KCPP_CUDA//.}$KCPP_APPEND
|
||||
|
||||
LLAMA_NOAVX1_FLAG=""
|
||||
LLAMA_NOAVX2_FLAG=""
|
||||
ARCHES_FLAG=""
|
||||
NO_WMMA_FLAG=""
|
||||
if [ -n "$NOAVX2" ]; then
|
||||
LLAMA_NOAVX2_FLAG="LLAMA_NOAVX2=1"
|
||||
fi
|
||||
if [ -n "$NOAVX1" ]; then
|
||||
LLAMA_NOAVX1_FLAG="LLAMA_NOAVX1=1"
|
||||
fi
|
||||
if [ -n "$ARCHES_CU11" ]; then
|
||||
ARCHES_FLAG="LLAMA_ARCHES_CU11=1"
|
||||
fi
|
||||
@@ -47,9 +51,9 @@ if [ -n "$NO_WMMA" ]; then
|
||||
fi
|
||||
|
||||
if [ "$KCPP_CUDA" = "rocm" ]; then
|
||||
bin/micromamba run -r conda -p conda/envs/linux make -j$(nproc) LLAMA_VULKAN=1 LLAMA_CLBLAST=1 LLAMA_HIPBLAS=1 LLAMA_PORTABLE=1 LLAMA_USE_BUNDLED_GLSLC=1 LLAMA_ADD_CONDA_PATHS=1 $LLAMA_NOAVX2_FLAG $ARCHES_FLAG $NO_WMMA_FLAG
|
||||
bin/micromamba run -r conda -p conda/envs/linux make -j$(nproc) LLAMA_VULKAN=1 LLAMA_CLBLAST=1 LLAMA_HIPBLAS=1 LLAMA_PORTABLE=1 LLAMA_USE_BUNDLED_GLSLC=1 LLAMA_ADD_CONDA_PATHS=1 $LLAMA_NOAVX1_FLAG $LLAMA_NOAVX2_FLAG $ARCHES_FLAG $NO_WMMA_FLAG
|
||||
else
|
||||
bin/micromamba run -r conda -p conda/envs/linux make -j$(nproc) LLAMA_VULKAN=1 LLAMA_CLBLAST=1 LLAMA_CUBLAS=1 LLAMA_PORTABLE=1 LLAMA_USE_BUNDLED_GLSLC=1 LLAMA_ADD_CONDA_PATHS=1 $LLAMA_NOAVX2_FLAG $ARCHES_FLAG $NO_WMMA_FLAG
|
||||
bin/micromamba run -r conda -p conda/envs/linux make -j$(nproc) LLAMA_VULKAN=1 LLAMA_CLBLAST=1 LLAMA_CUBLAS=1 LLAMA_PORTABLE=1 LLAMA_USE_BUNDLED_GLSLC=1 LLAMA_ADD_CONDA_PATHS=1 $LLAMA_NOAVX1_FLAG $LLAMA_NOAVX2_FLAG $ARCHES_FLAG $NO_WMMA_FLAG
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
call create_ver_file.bat
|
||||
PyInstaller --onedir --noconfirm --clean --console --runtime-hook "./tools/kcpplauncherhook.py" --icon "./niko.ico" --version-file "./version.txt" "./koboldcpp.py" -n "koboldcpp-launcher"
|
||||
PyInstaller --noconfirm --onefile --clean --console --collect-all customtkinter --collect-all psutil --icon "./niko.ico" --add-data "./dist/koboldcpp-launcher/koboldcpp-launcher.exe;." --add-data "./simpleclinfo.exe;." --add-data "./simplecpuinfo.exe;." --add-data "./aria2c-win.exe;." --add-data "./OpenCL.dll;." --add-data "./kcpp_adapters;./kcpp_adapters" --add-data "./koboldcpp.py;." --add-data "./json_to_gbnf.py;." --add-data "./LICENSE.md;." --add-data "./MIT_LICENSE_GGML_SDCPP_LLAMACPP_ONLY.md;." --add-data "./embd_res;./embd_res" --add-data "./koboldcpp_failsafe.dll;." --add-data "./koboldcpp_noavx2.dll;." --add-data "./koboldcpp_clblast_noavx2.dll;." --add-data "./koboldcpp_clblast_failsafe.dll;." --add-data "./koboldcpp_vulkan_noavx2.dll;." --add-data "./clblast.dll;." --version-file "./version.txt" "./koboldcpp.py" -n "koboldcpp-nocuda-oldpc.exe"
|
||||
Reference in New Issue
Block a user