From 11a90631ddc41ea117bee301b75e3ab1ebeb0732 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Thu, 26 Dec 2024 14:42:09 -0500 Subject: [PATCH 1/9] enable Cython tests for cuda.bindings --- .github/workflows/gh-build-and-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/gh-build-and-test.yml b/.github/workflows/gh-build-and-test.yml index 51f4bd87b4..919098e8f9 100644 --- a/.github/workflows/gh-build-and-test.yml +++ b/.github/workflows/gh-build-and-test.yml @@ -293,8 +293,7 @@ jobs: pushd ./cuda_bindings pip install -r requirements.txt pytest -rxXs tests/ - # TODO: enable cython tests - #pytest tests/cython + pytest -rxXs tests/cython popd - name: Run cuda.core tests From 636bd1936edf7269a81bd3a6e1db478f944d8bd6 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Thu, 26 Dec 2024 15:02:32 -0500 Subject: [PATCH 2/9] build Cython test modules --- .github/workflows/gh-build-and-test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/gh-build-and-test.yml b/.github/workflows/gh-build-and-test.yml index 919098e8f9..707472900c 100644 --- a/.github/workflows/gh-build-and-test.yml +++ b/.github/workflows/gh-build-and-test.yml @@ -293,6 +293,11 @@ jobs: pushd ./cuda_bindings pip install -r requirements.txt pytest -rxXs tests/ + if [[ "${{ matrix.host-platform }}" == linux* ]]; then + bash tests/cython/build_tests.sh + elif [[ "${{ matrix.host-platform }}" == win* ]]; then + # TODO: enable this once win-64 runners are up + fi pytest -rxXs tests/cython popd From d208f3e975d1671210d233a8dd99ec695fb0ba8e Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Thu, 26 Dec 2024 17:34:29 -0500 Subject: [PATCH 3/9] Update gh-build-and-test.yml --- .github/workflows/gh-build-and-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gh-build-and-test.yml b/.github/workflows/gh-build-and-test.yml index 707472900c..813f6963fb 100644 --- a/.github/workflows/gh-build-and-test.yml +++ b/.github/workflows/gh-build-and-test.yml @@ -297,6 +297,7 @@ jobs: bash tests/cython/build_tests.sh elif [[ "${{ matrix.host-platform }}" == win* ]]; then # TODO: enable this once win-64 runners are up + exit 1 fi pytest -rxXs tests/cython popd From e0c729c343df473bd79b4f17bab54122d6fcb817 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Thu, 26 Dec 2024 18:57:27 -0500 Subject: [PATCH 4/9] Install system gcc --- .github/workflows/gh-build-and-test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/gh-build-and-test.yml b/.github/workflows/gh-build-and-test.yml index 813f6963fb..b5e1d9fee0 100644 --- a/.github/workflows/gh-build-and-test.yml +++ b/.github/workflows/gh-build-and-test.yml @@ -280,6 +280,11 @@ jobs: host-platform: ${{ matrix.host-platform }} cuda-version: ${{ matrix.cuda-version }} + - name: Install dependencies + shell: bash --noprofile --norc -xeuo pipefail {0} + run: | + sudo apt install -y build-essential + - name: Run cuda.bindings tests if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} shell: bash --noprofile --norc -xeuo pipefail {0} From 2fbac68ad24af948f34ed4e0de9ee0c55a163d37 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Thu, 26 Dec 2024 19:14:57 -0500 Subject: [PATCH 5/9] No sudo --- .github/workflows/gh-build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-build-and-test.yml b/.github/workflows/gh-build-and-test.yml index b5e1d9fee0..fa781d24e9 100644 --- a/.github/workflows/gh-build-and-test.yml +++ b/.github/workflows/gh-build-and-test.yml @@ -283,7 +283,7 @@ jobs: - name: Install dependencies shell: bash --noprofile --norc -xeuo pipefail {0} run: | - sudo apt install -y build-essential + apt install -y build-essential - name: Run cuda.bindings tests if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} From 371b3186451cb9e79039d7048e7a7be15d3f3521 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Thu, 26 Dec 2024 19:50:11 -0500 Subject: [PATCH 6/9] also set CUDA_HOME --- .github/actions/fetch_ctk/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/fetch_ctk/action.yml b/.github/actions/fetch_ctk/action.yml index 05076f730e..7b8674abe8 100644 --- a/.github/actions/fetch_ctk/action.yml +++ b/.github/actions/fetch_ctk/action.yml @@ -145,5 +145,6 @@ runs: run: | CUDA_PATH=$(realpath "./cuda_toolkit") echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV + echo "CUDA_HOME=${CUDA_PATH}" >> $GITHUB_ENV echo "${CUDA_PATH}/bin" >> $GITHUB_PATH echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:${CUDA_PATH}/lib" >> $GITHUB_ENV From 7c5f9b9ffadda970c7ee6e9f7a3329c39512cd81 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Thu, 26 Dec 2024 20:47:54 -0500 Subject: [PATCH 7/9] Try to find Python include --- .github/workflows/gh-build-and-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/gh-build-and-test.yml b/.github/workflows/gh-build-and-test.yml index fa781d24e9..f5f5d968ce 100644 --- a/.github/workflows/gh-build-and-test.yml +++ b/.github/workflows/gh-build-and-test.yml @@ -272,6 +272,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + env: + AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache" - name: Set up mini CTK uses: ./.github/actions/fetch_ctk From 4e05ef2303b655e6c8b0437a96b47300658da2fd Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Thu, 26 Dec 2024 21:32:50 -0500 Subject: [PATCH 8/9] nit: add a skip condition and comments --- .github/workflows/gh-build-and-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/gh-build-and-test.yml b/.github/workflows/gh-build-and-test.yml index f5f5d968ce..e932c20d63 100644 --- a/.github/workflows/gh-build-and-test.yml +++ b/.github/workflows/gh-build-and-test.yml @@ -273,6 +273,7 @@ jobs: with: python-version: ${{ matrix.python-version }} env: + # we use self-hosted runners on which setup-python behaves weirdly... AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache" - name: Set up mini CTK @@ -283,8 +284,10 @@ jobs: cuda-version: ${{ matrix.cuda-version }} - name: Install dependencies + if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} shell: bash --noprofile --norc -xeuo pipefail {0} run: | + # cython tests require gcc apt install -y build-essential - name: Run cuda.bindings tests From a7f46ca6935bfcfb9906a2a995f492bad5447b0f Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 3 Jan 2025 03:11:19 +0000 Subject: [PATCH 9/9] simplify --- .github/workflows/build-and-test.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ebea31ec4b..bd7363c83c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -296,13 +296,6 @@ jobs: host-platform: ${{ matrix.host-platform }} cuda-version: ${{ matrix.cuda-version }} - - name: Install dependencies - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} - shell: bash --noprofile --norc -xeuo pipefail {0} - run: | - # cython tests require gcc - apt install -y build-essential - - name: Run cuda.bindings tests if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} shell: bash --noprofile --norc -xeuo pipefail {0} @@ -317,6 +310,8 @@ jobs: pip install -r requirements.txt pytest -rxXs tests/ if [[ "${{ matrix.host-platform }}" == linux* ]]; then + # cython tests require gcc + apt install -y build-essential bash tests/cython/build_tests.sh elif [[ "${{ matrix.host-platform }}" == win* ]]; then # TODO: enable this once win-64 runners are up