mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-16 05:20:22 +08:00
* test(e2e): add GPU workload image artifacts Closes #1476 Define local GPU workload image sources for smoke-pass, smoke-fail, and cuda-basic validation, plus a mise build task that tags images with the source revision and records the latest local image refs. Signed-off-by: Evan Lezar <elezar@nvidia.com> * test(e2e): add workload manifest build flow Signed-off-by: Evan Lezar <elezar@nvidia.com> * test(e2e): fix gpu workload README lint Signed-off-by: Evan Lezar <elezar@nvidia.com> * test(e2e): address gpu workload review feedback Signed-off-by: Evan Lezar <elezar@nvidia.com> --------- Signed-off-by: Evan Lezar <elezar@nvidia.com>
41 lines
1013 B
Bash
41 lines
1013 B
Bash
#!/usr/bin/env bash
|
|
|
|
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
set -euo pipefail
|
|
|
|
readonly SUCCESS_MARKER="OPENSHELL_GPU_WORKLOAD_SUCCESS"
|
|
readonly FAILURE_MARKER="OPENSHELL_GPU_WORKLOAD_FAILURE"
|
|
readonly WORKLOAD_DIR="/usr/local/lib/openshell-gpu-workload"
|
|
|
|
run_sample() {
|
|
local name=$1
|
|
local expected=$2
|
|
local binary="${WORKLOAD_DIR}/${name}"
|
|
local output
|
|
|
|
output="$(mktemp)"
|
|
echo "running CUDA sample: ${name}"
|
|
if ! "${binary}" >"${output}" 2>&1; then
|
|
cat "${output}"
|
|
echo "${FAILURE_MARKER} ${name} exited non-zero" >&2
|
|
rm -f "${output}"
|
|
exit 1
|
|
fi
|
|
|
|
cat "${output}"
|
|
if ! grep -Fq "${expected}" "${output}"; then
|
|
echo "${FAILURE_MARKER} ${name} did not print expected output: ${expected}" >&2
|
|
rm -f "${output}"
|
|
exit 1
|
|
fi
|
|
|
|
rm -f "${output}"
|
|
}
|
|
|
|
run_sample "deviceQuery" "Result = PASS"
|
|
run_sample "vectorAdd" "Test PASSED"
|
|
|
|
echo "${SUCCESS_MARKER} cuda-basic"
|