99 test_cuda :
1010 name : Test Python and C++ on CUDA
1111 runs-on : nvidia
12+ # https://github.com/deepmodeling/deepmd-kit/pull/2884#issuecomment-1744216845
13+ container :
14+ image : nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
15+ options : --gpus all
1216 if : github.repository_owner == 'deepmodeling' && github.event.label.name == 'Test CUDA' || github.event_name == 'workflow_dispatch'
1317 steps :
18+ - name : Make sudo and git work
19+ run : apt-get update && apt-get install -y sudo git
1420 - uses : actions/checkout@v4
1521 - uses : actions/setup-python@v4
1622 with :
1723 python-version : ' 3.11'
18- cache : ' pip'
24+ # cache: 'pip'
1925 - name : Setup MPI
2026 uses : mpi4py/setup-mpi@v1
2127 with :
@@ -26,14 +32,17 @@ jobs:
2632 && sudo dpkg -i cuda-keyring_1.0-1_all.deb \
2733 && sudo apt-get update \
2834 && sudo apt-get -y install cuda-11-8 libcudnn8=8.9.5.*-1+cuda11.8
35+ if: false # skip as we use nvidia image
36+ - name : Set PyPI mirror for Aliyun cloud machine
37+ run : python -m pip config --user set global.index-url https://mirrors.aliyun.com/pypi/simple/
2938 - run : python -m pip install -U "pip>=21.3.1,!=23.0.0"
30- - run : pip install -v -e .[gpu,test,lmp,cu11] "ase @ https://github.com/rosswhitfield/ase/archive/edd03571aff6944b77b4a4b055239f3c3e4eeb66.zip"
39+ - run : python -m pip install -v -e .[gpu,test,lmp,cu11] "ase @ https://github.com/rosswhitfield/ase/archive/edd03571aff6944b77b4a4b055239f3c3e4eeb66.zip"
3140 env :
3241 DP_BUILD_TESTING : 1
3342 DP_VARIANT : cuda
3443 CUDA_PATH : /usr/local/cuda-11.8
3544 - run : dp --version
36- - run : pytest -s --cov=deepmd --cov=deepmd_cli source/tests --durations=0
45+ - run : python -m pytest -s --cov=deepmd --cov=deepmd_cli source/tests --durations=0
3746 - run : source/install/test_cc_local.sh
3847 env :
3948 OMP_NUM_THREADS : 1
@@ -45,10 +54,10 @@ jobs:
4554 DP_USE_MPICH2 : 1
4655 CUDA_PATH : /usr/local/cuda-11.8
4756 - run : |
48- export LD_LIBRARY_PATH=${{ github.workspace }} /dp_test/lib:$CUDA_PATH/lib64:$LD_LIBRARY_PATH
49- export PATH=${{ github.workspace }} /dp_test/bin:$PATH
50- pytest -s --cov=deepmd source/lmp/tests
51- pytest -s --cov=deepmd source/ipi/tests
57+ export LD_LIBRARY_PATH=$GITHUB_WORKSPACE /dp_test/lib:$CUDA_PATH/lib64:$LD_LIBRARY_PATH
58+ export PATH=$GITHUB_WORKSPACE /dp_test/bin:$PATH
59+ python -m pytest -s --cov=deepmd source/lmp/tests
60+ python -m pytest -s --cov=deepmd source/ipi/tests
5261 env:
5362 OMP_NUM_THREADS: 1
5463 TF_INTRA_OP_PARALLELISM_THREADS: 1
0 commit comments