|
| 1 | +on: |
| 2 | + # manually trigger |
| 3 | + workflow_dispatch: |
| 4 | + pull_request: |
| 5 | + types: |
| 6 | + - "labeled" |
| 7 | +name: Test CUDA |
| 8 | +jobs: |
| 9 | + test_cuda: |
| 10 | + name: Test Python and C++ on CUDA |
| 11 | + runs-on: nvidia |
| 12 | + if: github.repository_owner == 'deepmodeling' && github.event.label.name == 'Test CUDA' || github.event_name == 'workflow_dispatch' |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + - uses: actions/setup-python@v4 |
| 16 | + with: |
| 17 | + python-version: '3.11' |
| 18 | + cache: 'pip' |
| 19 | + - name: Setup MPI |
| 20 | + uses: mpi4py/setup-mpi@v1 |
| 21 | + with: |
| 22 | + mpi: mpich |
| 23 | + - uses: lukka/get-cmake@latest |
| 24 | + - run: | |
| 25 | + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \ |
| 26 | + && sudo dpkg -i cuda-keyring_1.0-1_all.deb \ |
| 27 | + && sudo apt-get update \ |
| 28 | + && sudo apt-get -y install cuda-11-8 libcudnn8=8.9.5.*-1+cuda11.8 |
| 29 | + - 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" |
| 31 | + env: |
| 32 | + DP_BUILD_TESTING: 1 |
| 33 | + DP_VARIANT: cuda |
| 34 | + CUDA_PATH: /usr/local/cuda-11.8 |
| 35 | + - run: dp --version |
| 36 | + - run: pytest -s --cov=deepmd --cov=deepmd_cli source/tests --durations=0 |
| 37 | + - run: source/install/test_cc_local.sh |
| 38 | + env: |
| 39 | + OMP_NUM_THREADS: 1 |
| 40 | + TF_INTRA_OP_PARALLELISM_THREADS: 1 |
| 41 | + TF_INTER_OP_PARALLELISM_THREADS: 1 |
| 42 | + LMP_CXX11_ABI_0: 1 |
| 43 | + CMAKE_GENERATOR: Ninja |
| 44 | + DP_VARIANT: cuda |
| 45 | + DP_USE_MPICH2: 1 |
| 46 | + CUDA_PATH: /usr/local/cuda-11.8 |
| 47 | + - 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 |
| 52 | + env: |
| 53 | + OMP_NUM_THREADS: 1 |
| 54 | + TF_INTRA_OP_PARALLELISM_THREADS: 1 |
| 55 | + TF_INTER_OP_PARALLELISM_THREADS: 1 |
| 56 | + LAMMPS_PLUGIN_PATH: ${{ github.workspace }}/dp_test/lib/deepmd_lmp |
| 57 | + CUDA_PATH: /usr/local/cuda-11.8 |
| 58 | + - uses: codecov/codecov-action@v3 |
| 59 | + with: |
| 60 | + gcov: true |
0 commit comments