Skip to content

Commit

Permalink
Merge pull request #8190 from cupy/admin/add-cuda-import-ci
Browse files Browse the repository at this point in the history
Add CI to test `cupy.show_config()` pass without CUDA installed
  • Loading branch information
takagi committed Feb 19, 2024
2 parents 64387fa + 3aa6efb commit dcd325a
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 9 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/pretest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,6 @@ jobs:
run: |
python -c 'import cupy, cupyx'
# Test lazy-imported CUDA Toolkit library.
rm cupy/cuda/cufft.*.so
rm cupy/random/_generator_api.*.so
rm cupy_backends/cuda/libs/cusolver.*.so
rm cupy_backends/cuda/libs/cusparse.*.so
rm cupy_backends/cuda/libs/curand.*.so
rm cupy_backends/cuda/libs/cublas.*.so
python -c 'import cupy, cupyx'
build-rocm:
runs-on: ubuntu-22.04

Expand Down
17 changes: 17 additions & 0 deletions .pfnci/config.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,23 @@ configs {
}
}
# CUDA Build & Import without CUDA
configs {
key: "cupy.linux.cuda-build"
value {
requirement {
cpu: 8
memory: 50
disk: 20
}
time_limit: {
seconds: 3600
}
environment_variables { key: "GPU" value: "0" }
command: ".pfnci/linux/main-flexci.sh cuda-build"
}
}
# BENCHMARK
configs {
key: "cupy.linux.benchmark.head"
Expand Down
5 changes: 5 additions & 0 deletions .pfnci/config.tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@
"full",
"rapids"
],
"cupy.linux.cuda-build": [
"@push",
"full",
"mini"
],
"cupy.linux.array-api": [
"array-api"
],
Expand Down
2 changes: 2 additions & 0 deletions .pfnci/linux/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ main() {
fi
if [[ "${TARGET}" == *rocm* ]]; then
docker_args+=(--device=/dev/kfd --device=/dev/dri)
elif [[ "${TARGET}" == cuda-build ]]; then
docker_args+=()
else
docker_args+=(--runtime=nvidia)
fi
Expand Down
1 change: 1 addition & 0 deletions .pfnci/linux/tests/cuda-build.Dockerfile
25 changes: 25 additions & 0 deletions .pfnci/linux/tests/cuda-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Based on cuda122.sh

set -uex

ACTIONS="$(dirname $0)/actions"
. "$ACTIONS/_environment.sh"

export NVCC="ccache nvcc"

export CUPY_ACCELERATORS="cutensor,cub"

# Make the build faster.
export CUPY_NVCC_GENERATE_CODE="arch=compute_70,code=sm_70"

"$ACTIONS/build.sh"

# Make sure that CuPy can be imported without CUDA Toolkit installed.
rm -rf /usr/local/cuda*
pushd /
python3 -c 'import cupy, cupyx; cupy.show_config(_full=True)'
popd

"$ACTIONS/cleanup.sh"
6 changes: 6 additions & 0 deletions .pfnci/matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,12 @@
tags: ["@push", "full", "rapids"]
system: "linux"

- project: "cupy.linux.cuda-build"
_extern: true
target: "cuda-build"
tags: ["@push", "full", "mini"]
system: "linux"

- project: "cupy.linux.array-api"
_extern: true
target: "array-api"
Expand Down

0 comments on commit dcd325a

Please sign in to comment.