-
Notifications
You must be signed in to change notification settings - Fork 917
/
test_cpp.sh
executable file
·88 lines (71 loc) · 2.92 KB
/
test_cpp.sh
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
set -euo pipefail
. /opt/conda/etc/profile.d/conda.sh
rapids-logger "Generate C++ testing dependencies"
rapids-dependency-file-generator \
--output conda \
--file_key test_cpp \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch)" | tee env.yaml
rapids-mamba-retry env create --force -f env.yaml -n test
# Temporarily allow unbound variables for conda activation.
set +u
conda activate test
set -u
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"
SUITEERROR=0
rapids-print-env
rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
libcudf libcudf_kafka libcudf-tests
rapids-logger "Check GPU usage"
nvidia-smi
set +e
# TODO: Disabling stream identification for now.
# Set up library for finding incorrect default stream usage.
#pushd "cpp/tests/utilities/identify_stream_usage/"
#mkdir build && cd build && cmake .. -GNinja && ninja && ninja test
#STREAM_IDENTIFY_LIB="$(realpath build/libidentify_stream_usage.so)"
#echo "STREAM_IDENTIFY_LIB=${STREAM_IDENTIFY_LIB}"
#popd
# Run libcudf and libcudf_kafka gtests from libcudf-tests package
rapids-logger "Run gtests"
# TODO: exit code handling is too verbose. Find a cleaner solution.
for gt in "$CONDA_PREFIX"/bin/gtests/{libcudf,libcudf_kafka}/* ; do
test_name=$(basename ${gt})
echo "Running gtest $test_name"
${gt} --gtest_output=xml:${RAPIDS_TESTS_DIR}
# TODO: Disabling stream identification for now.
#if [[ ${test_name} == "SPAN_TEST" ]]; then
# # This one test is specifically designed to test using a thrust device
# # vector, so we expect and allow it to include default stream usage.
# gtest_filter="SpanTest.CanConstructFromDeviceContainers"
# GTEST_CUDF_STREAM_MODE="custom" LD_PRELOAD=${STREAM_IDENTIFY_LIB} ${gt} --gtest_output=xml:${RAPIDS_TESTS_DIR} --gtest_filter="-${gtest_filter}" && \
# ${gt} --gtest_output=xml:${RAPIDS_TESTS_DIR} --gtest_filter="${gtest_filter}"
#else
# GTEST_CUDF_STREAM_MODE="custom" LD_PRELOAD=${STREAM_IDENTIFY_LIB} ${gt} --gtest_output=xml:${RAPIDS_TESTS_DIR}
#fi
exitcode=$?
if (( ${exitcode} != 0 )); then
SUITEERROR=${exitcode}
echo "FAILED: GTest ${gt}"
fi
done
if [[ "${RAPIDS_BUILD_TYPE}" == "nightly" ]]; then
rapids-logger "Memcheck gtests with rmm_mode=cuda"
export GTEST_CUDF_RMM_MODE=cuda
COMPUTE_SANITIZER_CMD="compute-sanitizer --tool memcheck"
for gt in "$CONDA_PREFIX"/bin/gtests/{libcudf,libcudf_kafka}/* ; do
test_name=$(basename ${gt})
if [[ "$test_name" == "ERROR_TEST" ]]; then
continue
fi
echo "Running gtest $test_name"
${COMPUTE_SANITIZER_CMD} ${gt} | tee "${RAPIDS_TESTS_DIR}${test_name}.cs.log"
done
unset GTEST_CUDF_RMM_MODE
# TODO: test-results/*.cs.log are processed in gpuci
fi
exit ${SUITEERROR}