1717 name : Test on CUDA Build
1818 runs-on : gpu
1919 if : github.repository_owner == 'deepmodeling'
20+ env :
21+ CCACHE_BASEDIR : ${{ github.workspace }}
22+ CCACHE_MAXSIZE : 5G
2023 container :
2124 image : ghcr.io/deepmodeling/abacus-cuda
2225 volumes :
@@ -25,14 +28,22 @@ jobs:
2528
2629 steps :
2730 - name : Checkout
28- uses : actions/checkout@v7
31+ uses : actions/checkout@v7.0.1
2932 with :
3033 submodules : recursive
3134
35+ - name : Report runner info
36+ run : |
37+ echo "runner_name=$RUNNER_NAME"
38+ case "$RUNNER_NAME" in
39+ gpu-runner-*) echo "runner_type=pod" ;;
40+ *) echo "runner_type=vm" ;;
41+ esac
42+
3243 - name : Install CI tools
3344 run : |
3445 sudo apt-get update
35- sudo apt-get install -y ccache xz-utils ninja-build pkg-config
46+ sudo apt-get install -y ccache xz-utils ninja-build pkg-config zstd
3647
3748 - name : Install external tools from toolchain
3849 run : |
@@ -41,15 +52,60 @@ jobs:
4152 ./scripts/stage4/install_stage4.sh
4253 cd ..
4354
55+ - name : Restore ccache
56+ id : ccache
57+ if : startsWith(runner.name, 'gpu-runner-')
58+ uses : actions/cache/restore@v4
59+ with :
60+ path : /tmp/ccache.tar.zst
61+ key : ccache-cuda-${{ github.sha }}
62+ restore-keys : |
63+ ccache-cuda-
64+
65+ - name : Unpack ccache
66+ if : steps.ccache.outputs.cache-hit == 'true'
67+ run : |
68+ sudo mkdir -p /github/home/.ccache
69+ sudo tar -I zstd -xf /tmp/ccache.tar.zst -C /github/home
70+ sudo chown -R $(whoami) /github/home/.ccache
71+
72+ - name : ccache stats (before build)
73+ run : |
74+ ccache --zero-stats || true
75+ ccache -s
76+
4477 - name : Configure & Build
4578 run : |
4679 nvidia-smi
4780 source toolchain/install/setup
4881 rm -rf build
49- cmake -B build -G Ninja -DUSE_CUDA=ON -DBUILD_TESTING=ON -DENABLE_FLOAT_FFTW=ON
50- cmake --build build -j4
82+ cmake -B build -G Ninja -DUSE_CUDA=ON -DBUILD_TESTING=ON -DENABLE_FLOAT_FFTW=ON \
83+ -DCMAKE_CUDA_ARCHITECTURES=70
84+ cmake --build build -j "$(nproc)"
5185 cmake --install build
5286
87+ - name : ccache stats (after build)
88+ if : always()
89+ run : ccache -s
90+
91+ - name : Pack ccache
92+ if : always()
93+ run : tar -I 'zstd -T0' -cf /tmp/ccache.tar.zst -C /github/home .ccache
94+
95+ - name : Save ccache
96+ if : always()
97+ uses : actions/cache/save@v4
98+ with :
99+ path : /tmp/ccache.tar.zst
100+ key : ccache-cuda-${{ github.sha }}
101+
102+ - name : Module_LCAO CUDA Unittests
103+ env :
104+ GTEST_COLOR : ' yes'
105+ OMP_NUM_THREADS : ' 2'
106+ run : |
107+ ctest --test-dir build -V --timeout 1700 -R '^(MODULE_LCAO_tddft_radial_interpolation_cuda_test|MODULE_LCAO_tddft_snap_psibeta_half_test)$'
108+
53109 - name : Test 11_PW_GPU
54110 run : |
55111 cd tests/11_PW_GPU
@@ -74,3 +130,15 @@ jobs:
74130 run : |
75131 cd tests/16_SDFT_GPU
76132 bash ../integrate/Autotest.sh -n 2 -f CASES_GPU.txt
133+
134+ - name : Test 01_PW on GPU
135+ run : |
136+ cd tests/01_PW
137+ find . -name INPUT | while read f; do
138+ if grep -q "^device" "$f"; then
139+ sed -i 's/^device.*/device gpu/' "$f"
140+ else
141+ echo "device gpu" >> "$f"
142+ fi
143+ done
144+ bash ../integrate/Autotest.sh -n 1 -a abacus -f CASES_GPU.txt
0 commit comments