Repository navigation
Koboldcpp Windows OldPC #272
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Koboldcpp Windows OldPC | |
| 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 | |
| permissions: write-all | |
| steps: | |
| - name: Show runner hardware | |
| shell: pwsh | |
| run: | | |
| Write-Host "::group::GitHub runner" | |
| Write-Host "Name: $env:RUNNER_NAME" | |
| Write-Host "OS/architecture: $env:RUNNER_OS / $env:RUNNER_ARCH" | |
| Write-Host "Image: $env:ImageOS $env:ImageVersion" | |
| Write-Host "::endgroup::" | |
| Write-Host "::group::Machine and operating system" | |
| $system = Get-CimInstance Win32_ComputerSystem | |
| $os = Get-CimInstance Win32_OperatingSystem | |
| $system | Select-Object Manufacturer, Model, SystemType, HypervisorPresent, TotalPhysicalMemory | Format-List | |
| Write-Host ("Installed RAM: {0} bytes ({1:N2} GiB)" -f $system.TotalPhysicalMemory, ($system.TotalPhysicalMemory / 1GB)) | |
| $os | Select-Object Caption, Version, BuildNumber, OSArchitecture | Format-List | |
| Write-Host "::endgroup::" | |
| Write-Host "::group::CPU" | |
| Get-CimInstance Win32_Processor | Select-Object Name, Manufacturer, Description, SocketDesignation, NumberOfCores, NumberOfLogicalProcessors, MaxClockSpeed | Format-List | |
| Write-Host "::endgroup::" | |
| Write-Host "::group::Memory modules" | |
| Get-CimInstance Win32_PhysicalMemory | Select-Object Manufacturer, PartNumber, Capacity, Speed, ConfiguredClockSpeed | Format-List | |
| Write-Host "::endgroup::" | |
| - name: Clone | |
| id: checkout | |
| uses: actions/checkout@v5 | |
| 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@v6 | |
| 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.12.0 psutil==5.9.5 jinja2==3.1.6 | |
| - 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: Build Non-CUDA | |
| id: make_build | |
| run: | | |
| make LLAMA_VULKAN=1 LLAMA_PORTABLE=1 -j ${env:NUMBER_OF_PROCESSORS} LLAMA_NOAVX2=1 | |
| - uses: Jimver/cuda-toolkit@v0.2.35 | |
| id: cuda-toolkit | |
| with: | |
| cuda: '11.4.4' | |
| use-github-cache: false | |
| - name: Build CUDA | |
| id: cmake_build | |
| env: | |
| KCPP_CUDA_ROOT: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }} | |
| run: | | |
| cmake -S . -B build -G "Visual Studio 16 2019" -A x64 -T "cuda=$env:KCPP_CUDA_ROOT" "-DCUDAToolkit_ROOT=$env:KCPP_CUDA_ROOT" "-DKCPP_CUDA_EXPECTED_VERSION=11.4" -DLLAMA_CUBLAS=ON -DLLAMA_AVX2=OFF -DCMAKE_SYSTEM_VERSION="10.0.19041.0" | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| cmake --build build --config Release -j 2 | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| # Package the same toolkit's libraries, including cudart, to avoid mixed versions. | |
| - name: Copy CUDA Libraries | |
| env: | |
| KCPP_CUDA_ROOT: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }} | |
| run: | | |
| foreach ($dll in @('cublas64_11.dll', 'cublasLt64_11.dll', 'cudart64_110.dll')) { | |
| Copy-Item -LiteralPath (Join-Path $env:KCPP_CUDA_ROOT "bin\$dll") -Destination . -Force -ErrorAction Stop | |
| (Get-Item -LiteralPath $dll).VersionInfo | Format-List FileName, FileVersion, ProductVersion | |
| } | |
| - name: Package PyInstallers | |
| id: make_pyinstaller | |
| run: | | |
| ./make_pyinstaller_cuda_oldpc.bat | |
| - name: Save artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: kcpp_windows_pyinstallers | |
| path: dist/ | |
| - name: Upload to GitHub Rolling Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release upload rolling dist/koboldcpp-oldpc.exe --clobber |