-
Notifications
You must be signed in to change notification settings - Fork 254
Expand file tree
/
Copy pathtest_cpp.sh
More file actions
executable file
·64 lines (50 loc) · 1.9 KB
/
Copy pathtest_cpp.sh
File metadata and controls
executable file
·64 lines (50 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
# Support invoking test_cpp.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../
. /opt/conda/etc/profile.d/conda.sh
rapids-logger "Configuring conda strict channel priority"
conda config --set channel_priority strict
CPP_CHANNEL=$(rapids-download-conda-from-github cpp)
RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"
rapids-logger "Generate C++ testing dependencies"
rapids-dependency-file-generator \
--output conda \
--file-key test_cpp \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch)" \
--prepend-channel "${CPP_CHANNEL}" \
| tee env.yaml
rapids-mamba-retry env create --yes -f env.yaml -n test
# Temporarily allow unbound variables for conda activation.
set +u
conda activate test
set -u
rapids-print-env
rapids-logger "Check system info"
uname -a
nvidia-smi
# Run librmm gtests from librmm-tests package
rapids-logger "Run gtests"
export GTEST_OUTPUT=xml:${RAPIDS_TESTS_DIR}/
CTEST_TIMEOUT=15m
if grep -qi microsoft /proc/version 2>/dev/null; then
CTEST_TIMEOUT=30m # WSL is slow for large device memory allocations
fi
timeout "${CTEST_TIMEOUT}" ./ci/run_ctests.sh -j20 && EXITCODE=$? || EXITCODE=$?;
# Run all examples from librmm-example package
for example in "${CONDA_PREFIX}"/bin/examples/librmm/*; do
if [ -x "$example" ]; then
rapids-logger "Running example: $(basename "$example")"
timeout 15m "$example" && EXAMPLE_EXITCODE=$? || EXAMPLE_EXITCODE=$?;
if [ "$EXAMPLE_EXITCODE" -ne 0 ]; then
rapids-logger "Example $(basename "$example") failed with exit code: $EXAMPLE_EXITCODE"
EXITCODE=$EXAMPLE_EXITCODE
break
fi
fi
done
rapids-logger "Test script exiting with value: $EXITCODE"
exit "${EXITCODE}"