WIP Fix GitHub CI CUDA errors #736
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
name: PerfFlowAspect CI | |
on: [ push, pull_request ] | |
jobs: | |
build-c: | |
name: check c bindings | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
config: [boilerplate] | |
include: | |
- config: boilerplate | |
PERFFLOWASPECT_WITH_CUDA: ON | |
PERFFLOWASPECT_WITH_MPI: ON | |
PERFFLOWASPECT_WITH_MULTITHREADS: ON | |
CMAKE_BUILD_TYPE: Debug | |
steps: | |
# Checkout PerfFlowAspect repository under $GITHUB_WORKSPACE | |
- uses: actions/checkout@v2 | |
- name: Setup Build Env | |
run: | | |
sudo apt-get update | |
sudo apt install gcc clang llvm-dev libjansson-dev libssl-dev bison flex make cmake mpich | |
gcc --version | |
# install cuda 12.2 | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin | |
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 | |
wget https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda-repo-ubuntu2004-12-2-local_12.2.0-535.54.03-1_amd64.deb | |
sudo dpkg -i cuda-repo-ubuntu2004-12-2-local_12.2.0-535.54.03-1_amd64.deb | |
sudo cp /var/cuda-repo-ubuntu2004-12-2-local/cuda-*-keyring.gpg /usr/share/keyrings/ | |
sudo apt-get update | |
sudo apt-get -y install cuda | |
which nvcc | |
export PATH=/usr/local/cuda-12.2/bin:$PATH | |
clang++ --version | |
nvcc --version | |
- name: Compile check | |
run: | | |
export PATH=/usr/local/cuda-12.1/bin:$PATH | |
cd src/c | |
mkdir build install | |
cd build | |
export CMAKE_OPTS="-DCMAKE_CXX_COMPILER=clang++ -DLLVM_DIR=/usr/lib/llvm-10/cmake -DCMAKE_INSTALL_PREFIX=../install" | |
export CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_BUILD_TYPE=${{matrix.CMAKE_BUILD_TYPE}}" | |
export CMAKE_OPTS="${CMAKE_OPTS} -DPERFFLOWASPECT_WITH_CUDA=${{matrix.PERFFLOWASPECT_WITH_CUDA}}" | |
export CMAKE_OPTS="${CMAKE_OPTS} -DPERFFLOWASPECT_WITH_MPI=${{matrix.PERFFLOWASPECT_WITH_MPI}}" | |
export CMAKE_OPTS="${CMAKE_OPTS} -DPERFFLOWASPECT_WITH_MULTITHREADS=${{matrix.PERFFLOWASPECT_WITH_MULTITHREADS}}" | |
echo -e ${CMAKE_OPTS} | |
cmake ${CMAKE_OPTS} .. | |
# build | |
make VERBOSE=1 | |
# install | |
make install | |
- name: Run C Smoke Tests | |
run: | | |
cd src/c/install/test | |
./t0001-cbinding-basic.t | |
build-python: | |
name: check python bindings | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: [3.8] | |
steps: | |
# Checkout PerfFlowAspect repository under $GITHUB_WORKSPACE | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip pytest setuptools | |
cd src/python | |
python -m pip install -r requirements.txt | |
python -m pip list | |
- name: Run Python Smoke Tests | |
run: | | |
cd src/python/test | |
./t0001-pybinding-basic.t | |
check-code-format: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout PerfFlowAspect repository under $GITHUB_WORKSPACE | |
- uses: actions/checkout@v2 | |
- name: Style check c/cpp/h files | |
run: | | |
sudo apt-get update | |
sudo apt-get install astyle | |
astyle --version | |
cd ${GITHUB_WORKSPACE} | |
./scripts/.ci-check-c-code-format.sh | |
err=$? | |
if [ $err -eq 0 ]; then exit 0; else echo -e "Formatting issue found in C/C++ files. Please run ./scripts/check-c-code-format.sh"; exit 1; fi | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip flake8 rstfmt | |
- name: Update black and flake8 | |
run: | | |
python -m pip install --upgrade black flake8 | |
- name: Format check with flake8 and black | |
run: | | |
cd src/python | |
black --diff --check . | |
flake8 | |
- name: Format check with rstfmt | |
run: | | |
cd ${GITHUB_WORKSPACE} | |
./scripts/.ci-check-rst-format.sh |