diff --git a/.github/workflows/kcpp-build-release-win-full-cu12.yaml b/.github/workflows/kcpp-build-release-win-full-cu12.yaml new file mode 100644 index 0000000000000..5ed6df620b114 --- /dev/null +++ b/.github/workflows/kcpp-build-release-win-full-cu12.yaml @@ -0,0 +1,77 @@ +name: Koboldcpp Builder Windows Full Binaries CUDA 12 + +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: concedo_experimental + + - 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: Build Non-CUDA + id: make_build + run: | + make -j ${env:NUMBER_OF_PROCESSORS} + + - uses: Jimver/cuda-toolkit@v0.2.11 + id: cuda-toolkit + with: + cuda: '12.1.0' + + - 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 ${env:NUMBER_OF_PROCESSORS} + mv bin/Release/koboldcpp_cublas.dll ../koboldcpp_cublas.dll + 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\v12.1\bin\cublasLt64_12.dll" . + copy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin\cublas64_12.dll" . + ls + + - name: Package PyInstallers + id: make_pyinstaller + run: | + ./make_pyinstaller_cuda12.bat + + - name: Save artifact + uses: actions/upload-artifact@v3 + with: + name: kcpp_windows_pyinstallers + path: dist/ diff --git a/cudart64_12.dll b/cudart64_12.dll new file mode 100644 index 0000000000000..cbc961fce445c Binary files /dev/null and b/cudart64_12.dll differ diff --git a/make_pyinstaller_cuda12.bat b/make_pyinstaller_cuda12.bat new file mode 100644 index 0000000000000..1b2bcf44b8864 --- /dev/null +++ b/make_pyinstaller_cuda12.bat @@ -0,0 +1 @@ +PyInstaller --noconfirm --onefile --clean --console --collect-all customtkinter --icon "./nikogreen.ico" --add-data "./winclinfo.exe;." --add-data "./OpenCL.dll;." --add-data "./klite.embd;." --add-data "./kcpp_docs.embd;." --add-data "./koboldcpp_default.dll;." --add-data "./koboldcpp_openblas.dll;." --add-data "./koboldcpp_failsafe.dll;." --add-data "./koboldcpp_noavx2.dll;." --add-data "./libopenblas.dll;." --add-data "./koboldcpp_clblast.dll;." --add-data "./koboldcpp_clblast_noavx2.dll;." --add-data "./koboldcpp_vulkan_noavx2.dll;." --add-data "./clblast.dll;." --add-data "./koboldcpp_vulkan.dll;." --add-data "./vulkan-1.dll;." --add-data "./koboldcpp_cublas.dll;." --add-data "./cublas64_12.dll;." --add-data "./cublasLt64_12.dll;." --add-data "./cudart64_12.dll;." --add-data "./msvcp140.dll;." --add-data "./msvcp140_codecvt_ids.dll;." --add-data "./vcruntime140.dll;." --add-data "./vcruntime140_1.dll;." --add-data "./rwkv_vocab.embd;." --add-data "./rwkv_world_vocab.embd;." "./koboldcpp.py" -n "koboldcpp_cu12.exe" \ No newline at end of file