1- name : Koboldcpp Linux ROCm
1+ name : KoboldCpp Linux ROCm
22
33on :
44 workflow_dispatch :
1212 required : false
1313 default : ' '
1414
15-
1615env :
1716 BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
1817 KCPP_CUDA : rocm
@@ -23,24 +22,16 @@ jobs:
2322 runs-on : ubuntu-22.04
2423 permissions : write-all
2524 steps :
26- - name : Free Disk Space (Ubuntu)
27- uses : jlumbroso/free-disk-space@main
28- with :
29- # this might remove tools that are actually needed,
30- # if set to "true" but frees about 6 GB
31- tool-cache : true
32-
33- # all of these default to true, but feel free to set to
34- # "false" if necessary for your workflow
35- android : true
36- dotnet : true
37- haskell : true
38- large-packages : true
39- docker-images : true
40- swap-storage : true
25+ - name : Free up disk space before container
26+ run : |
27+ echo "Cleaning up runner to make room for ROCm container..."
28+ sudo rm -rf /usr/share/dotnet
29+ sudo rm -rf /opt/ghc
30+ sudo rm -rf /opt/hostedtoolcache
31+ sudo apt-get clean
32+ df -h
4133
42- - name : Clone
43- id : checkout
34+ - name : Checkout source
4435 uses : actions/checkout@v3
4536 with :
4637 ref : ${{ inputs.commit_hash != '' && inputs.commit_hash || github.head_ref || github.ref_name }}
@@ -49,33 +40,27 @@ jobs:
4940 run : |
5041 echo "Building from ref: ${{ inputs.commit_hash != '' && inputs.commit_hash || github.head_ref || github.ref_name }}"
5142
52- - name : Dependencies
53- id : depends
54- run : |
55- sudo apt update
56- export DEBIAN_FRONTEND=noninteractive
57- sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime
58- echo "tzdata tzdata/Areas select Etc" | sudo debconf-set-selections
59- echo "tzdata tzdata/Zones/Etc select UTC" | sudo debconf-set-selections
60- sudo apt-get -y install git curl bzip2 python3-tk tcl tk
61- curl -fLO https://repo.radeon.com/rocm/installer/rocm-runfile-installer/rocm-rel-6.4.1/ubuntu/22.04/rocm-installer_1.1.1.60401-30-83~22.04.run && sudo bash rocm-installer_1.1.1.60401-30-83~22.04.run deps=install rocm postrocm target="/opt"
62- sudo rm -rf rocm-install*
63-
64- - name : Set Tcl/Tk Paths
65- run : |
66- echo "TCL_LIBRARY=$(find /usr/lib/ -name 'tcl8*' | head -n 1)" >> $GITHUB_ENV
67- echo "TK_LIBRARY=$(find /usr/lib/ -name 'tk8*' | head -n 1)" >> $GITHUB_ENV
68-
69- - name : Build
70- id : make_build
43+ - name : Build inside ROCm container
7144 run : |
72- ./koboldcpp.sh dist
45+ docker run --privileged \
46+ -v "${{ github.workspace }}:/workspace" \
47+ -w /workspace \
48+ -e KCPP_CUDA="rocm" \
49+ -e BRANCH_NAME="${{ github.head_ref || github.ref_name }}" \
50+ rocm/dev-ubuntu-22.04:7.1-complete \
51+ bash -c "
52+ apt update &&
53+ DEBIAN_FRONTEND=noninteractive apt install -y git curl bzip2 python3-tk tcl tk &&
54+ export TCL_LIBRARY=\$(find /usr/lib/ -name 'tcl8*' | head -n 1) &&
55+ export TK_LIBRARY=\$(find /usr/lib/ -name 'tk8*' | head -n 1) &&
56+ ./koboldcpp.sh dist
57+ "
7358
7459 - name : Save artifact
7560 uses : actions/upload-artifact@v4
7661 with :
7762 name : kcpp_linux_binary
78- path : dist/
63+ path : ${{ github.workspace }}/ dist/
7964
8065 - name : Upload to GitHub Release
8166 env :
0 commit comments