run Test CUDA in container #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
# manually trigger | |
workflow_dispatch: | |
pull_request: | |
types: | |
- "labeled" | |
name: Test CUDA | |
jobs: | |
test_cuda: | |
name: Test Python and C++ on CUDA | |
runs-on: nvidia | |
# https://github.com/deepmodeling/deepmd-kit/pull/2884#issuecomment-1744216845 | |
container: | |
image: nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 | |
options: --gpus all | |
if: github.repository_owner == 'deepmodeling' && github.event.label.name == 'Test CUDA' || github.event_name == 'workflow_dispatch' | |
steps: | |
- name: Make sudo work | |
run: apt-get update && apt-get install -y sudo | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
# cache: 'pip' | |
- name: Setup MPI | |
uses: mpi4py/setup-mpi@v1 | |
with: | |
mpi: mpich | |
- uses: lukka/get-cmake@latest | |
- run: | | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \ | |
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \ | |
&& sudo apt-get update \ | |
&& sudo apt-get -y install cuda-11-8 libcudnn8=8.9.5.*-1+cuda11.8 | |
if: false # skip as we use nvidia image | |
- name: Set PyPI mirror for Aliyun cloud machine | |
run: python -m pip config --user set global.index-url http://mirrors.cloud.aliyuncs.com/pypi/simple/ | |
- run: python -m pip install -U "pip>=21.3.1,!=23.0.0" | |
- run: pip install -v -e .[gpu,test,lmp,cu11] "ase @ https://github.com/rosswhitfield/ase/archive/edd03571aff6944b77b4a4b055239f3c3e4eeb66.zip" | |
env: | |
DP_BUILD_TESTING: 1 | |
DP_VARIANT: cuda | |
CUDA_PATH: /usr/local/cuda-11.8 | |
- run: dp --version | |
- run: pytest -s --cov=deepmd --cov=deepmd_cli source/tests --durations=0 | |
- run: source/install/test_cc_local.sh | |
env: | |
OMP_NUM_THREADS: 1 | |
TF_INTRA_OP_PARALLELISM_THREADS: 1 | |
TF_INTER_OP_PARALLELISM_THREADS: 1 | |
LMP_CXX11_ABI_0: 1 | |
CMAKE_GENERATOR: Ninja | |
DP_VARIANT: cuda | |
DP_USE_MPICH2: 1 | |
CUDA_PATH: /usr/local/cuda-11.8 | |
- run: | | |
export LD_LIBRARY_PATH=${{ github.workspace }}/dp_test/lib:$CUDA_PATH/lib64:$LD_LIBRARY_PATH | |
export PATH=${{ github.workspace }}/dp_test/bin:$PATH | |
pytest -s --cov=deepmd source/lmp/tests | |
pytest -s --cov=deepmd source/ipi/tests | |
env: | |
OMP_NUM_THREADS: 1 | |
TF_INTRA_OP_PARALLELISM_THREADS: 1 | |
TF_INTER_OP_PARALLELISM_THREADS: 1 | |
LAMMPS_PLUGIN_PATH: ${{ github.workspace }}/dp_test/lib/deepmd_lmp | |
CUDA_PATH: /usr/local/cuda-11.8 | |
- uses: codecov/codecov-action@v3 | |
with: | |
gcov: true |