File size: 3,127 Bytes
1d30d42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Koboldcpp Windows Full Binaries

on: workflow_dispatch
env:
  BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
  windows:
    runs-on: windows-2019
    steps:
      - name: Clone
        id: checkout
        uses: actions/checkout@v3
        with:
          ref: ${{ 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: 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: Rebuild Vulkan Shaders
        id: make_vk_shaders
        run: |
          make vulkan_shaders_gen -j ${env:NUMBER_OF_PROCESSORS}
          echo "Vulkan Shaders Rebuilt"

      - name: Build Non-CUDA
        id: make_build
        run: |
          make LLAMA_CLBLAST=1 LLAMA_VULKAN=1 LLAMA_PORTABLE=1 -j ${env:NUMBER_OF_PROCESSORS}

      - uses: Jimver/[email protected]
        id: cuda-toolkit
        with:
          cuda: '11.4.4'

      - name: Build CUDA
        id: cmake_build
        run: |
          mkdir build
          cd build
          cmake .. -DLLAMA_CUBLAS=ON -DCMAKE_SYSTEM_VERSION="10.0.19041.0"
          cmake --build . --config Release -j 2
          cd ..

      # note: The libraries that come from the github cuda directory seem to be larger, so they are not recommended
      - name: Download CuBLAS Libraries
        run: |
          curl -L https://github.com/LostRuins/koboldcpp/releases/download/cuda11_cublas_libraries/cublas64_11.dll --output cublas64_11.dll
          curl -L https://github.com/LostRuins/koboldcpp/releases/download/cuda11_cublas_libraries/cublasLt64_11.dll --output cublasLt64_11.dll
          ls
      # - name: Copy CuBLAS Libraries
      #   run: |
      #     copy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin\cublasLt64_11.dll" .
      #     copy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin\cublas64_11.dll" .
      #     ls

      - name: Package PyInstallers
        id: make_pyinstaller
        run: |
          ./make_pyinstaller.bat
          ./make_pyinstaller_cuda.bat

      - name: Save artifact
        uses: actions/upload-artifact@v4
        with:
          name: kcpp_windows_pyinstallers
          path: dist/