Skip to content

Commit c0461cd

Browse files
committed
Public CI Graphics GLMark2 Shell Scripts.
Implemented shell scripts for public CI for Graphics GLMark2. Added Graphics GLMark2 script Added readme document for Graphics validation Signed-off-by: maheswa <[email protected]>
1 parent ec8d3f1 commit c0461cd

File tree

3 files changed

+190
-28
lines changed

3 files changed

+190
-28
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2+
# SPDX-License-Identifier: BSD-3-Clause-Clear
3+
4+
# GLmark2-es2-wayland GraphicsTest Scripts for RB3 Gen2 (Yocto)
5+
# Overview
6+
7+
Graphics scripts automates the validation of Graphics gles2 capabilities on the Qualcomm RB3 Gen2 platform running a Yocto-based Linux system. It utilizes GLmark2-es2-wayland test app which is publicly available at https://github.com/glmark2/glmark2
8+
9+
## Features
10+
11+
- OpenGL ES 2.0 API level test
12+
- Various standard features, such as vertex arrays, vertex buffer objects (VBOs), texturing, and shaders
13+
- Provides detailed performance metrics, including frame rates and scores
14+
- Supports offscreen rendering, allowing you to benchmark without displaying the output on the screen
15+
- Specifically designed to run as a Wayland client, making it suitable for modern Linux desktop environments
16+
- Compatible with Yocto-based root filesystem
17+
18+
## Prerequisites
19+
20+
Ensure the following components are present in the target Yocto build:
21+
22+
- `glmark2-es2-wayland` (Binary Available in /usr/bin) - this test app can be compiled from https://github.com/glmark2/glmark2
23+
- `glmark2` (resouces Available in /usr/bin) - this data path can be taken from https://github.com/glmark2/glmark2
24+
- Write access to root filesystem (for environment setup)
25+
26+
## Directory Structure
27+
28+
```bash
29+
Runner/
30+
├── suites/
31+
│ ├── Multimedia/
32+
│ │ ├── Graphics/
33+
│ │ │ ├── GLmark2/
34+
│ │ │ │ ├── run.sh
35+
36+
37+
## Usage
38+
39+
1. Copy repo to Target Device: Use scp to transfer the scripts from the host to the target device. The scripts should be copied to the /var directory on the target device.
40+
41+
2. Verify Transfer: Ensure that the repo have been successfully copied to the /var directory on the target device.
42+
43+
3. Run Scripts: Navigate to the /var directory on the target device and execute the scripts as needed.
44+
45+
Run a Graphics GLMark2 test using:
46+
---
47+
Quick Example
48+
```
49+
git clone <this-repo>
50+
cd <this-repo>
51+
scp -r common Runner user@target_device_ip:/var
52+
ssh user@target_device_ip
53+
cd /var/Runner && ./run-test.sh GLMark2
54+
```
55+
Sample output:
56+
sh-5.2# sh-5.2# cd /var/Runner && ./run-test.sh GLMark2
57+
[Executing test case: /var/Runner/suites/Multimedia/Graphics/GLMark2] 2025-01-10 01:12:55 -
58+
[INFO] 2025-01-10 01:12:55 - -----------------------------------------------------------------------------------------
59+
[INFO] 2025-01-10 01:12:55 - -------------------Starting GLMark2_Validation Testcase----------------------------
60+
Running onscreen_default...
61+
...
62+
=======================================================
63+
glmark2 Score: 378
64+
=======================================================
65+
66+
EGL updater thread exited
67+
68+
GEM Handle for BO=1 closed
69+
GEM Handle for BO=2 closed
70+
GEM Handle for BO=3 closed
71+
GEM Handle for BO=4 closed
72+
GEM Handle for BO=5 closed
73+
[PASS] onscreen_default score detected.
74+
Running offscreen_default...
75+
.....
76+
=======================================================
77+
glmark2 Score: 381
78+
=======================================================
79+
80+
EGL updater thread exited
81+
82+
[PASS] offscreen_default score detected.
83+
[INFO] 2025-01-10 01:23:21 -
84+
[INFO] 2025-01-10 01:23:21 - === Overall GLMark2 Validation Result ===
85+
[OVERALL PASS] GLMark2 rendering validated.
86+
[PASS] 2025-01-10 01:23:21 - GLMark2_Validation : Test Passed
87+
88+
89+
4. Results will be available in the `/var/Runner/suites/Multimedia/Graphics/GLmark2/results` directory for both onscreen and offscreen tests.
90+
91+
## Notes
92+
93+
- The script takes input like offscreen & onscreen.
94+
- It validates the graphics gles2 functionalities.
95+
- If any critical tool is missing, the script exits with an error message.
96+
- Syslog_log.txt & dmesg_log.txt are useful to debug driver related issue
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2+
# SPDX-License-Identifier: BSD-3-Clause-Clear
3+
4+
#!/bin/sh
5+
6+
# GLMark2 Validator Script (Yocto-Compatible)
7+
# No arguments expected. This script auto-detects and validates onscreen/offscreen rendering
8+
9+
. $(pwd)/init_env
10+
TESTNAME="GLMark2"
11+
12+
# Import test functions
13+
. $TOOLS/functestlib.sh
14+
15+
test_path=$(find_test_case_by_name "$TESTNAME")
16+
log_info "-----------------------------------------------------------------------------------------"
17+
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
18+
19+
# Color codes
20+
GREEN="\e[32m"
21+
RED="\e[31m"
22+
YELLOW="\e[33m"
23+
BLUE="\e[34m"
24+
NC="\e[0m" # No Color
25+
26+
# Validate if glmark2 binary is available
27+
if ! command -v /usr/bin/glmark2-es2-wayland &> /dev/null; then
28+
echo -e "${RED}[ERROR]${NC} glmark2-es2-wayland not found in system path."
29+
log_fail "$TESTNAME : glmark2-es2-wayland binary not found"
30+
echo "$TESTNAME SKIP " > "$test_path/$TESTNAME.res"
31+
exit 1
32+
fi
33+
34+
# Prepare environment
35+
. /etc/profile
36+
export XDG_RUNTIME_DIR=/dev/socket/weston
37+
mkdir -p "$XDG_RUNTIME_DIR"
38+
chmod 0700 "$XDG_RUNTIME_DIR"
39+
export WAYLAND_DISPLAY=wayland-1
40+
41+
mkdir -p results/glmark2
42+
chmod -R 755 results/glmark2
43+
44+
# Start logs
45+
dmesg -C
46+
tail -f /var/log/syslog > results/glmark2/syslog_log.txt &
47+
SYSLOG_PID=$!
48+
dmesg -w > results/glmark2/dmesg_log.txt &
49+
DMESG_PID=$!
50+
51+
overall_pass=true
52+
run_glmark2_test() {
53+
local mode="$1"
54+
local result_file="results/glmark2/${mode}.txt"
55+
56+
echo -e "${YELLOW}Running $mode...${NC}"
57+
if [[ "$mode" == "onscreen" ]]; then
58+
/usr/bin/glmark2-es2-wayland --data-path /usr/bin/glmark2 2>&1 | tee "$result_file"
59+
else
60+
/usr/bin/glmark2-es2-wayland --off-screen --data-path /usr/bin/glmark2 2>&1 | tee "$result_file"
61+
fi
62+
63+
if grep -q 'glmark2 Score' "$result_file"; then
64+
echo -e "${GREEN}[PASS]${NC} $mode score detected."
65+
else
66+
echo -e "${RED}[FAIL]${NC} $mode did not produce a score."
67+
overall_pass=false
68+
fi
69+
}
70+
71+
# Execute all variants
72+
run_glmark2_test "onscreen" "onscreen_default"
73+
run_glmark2_test "offscreen" "offscreen_default"
74+
75+
# Cleanup
76+
kill $DMESG_PID
77+
kill $SYSLOG_PID
78+
79+
# Final status
80+
log_info ""
81+
log_info "=== Overall GLMark2 Validation Result ==="
82+
if $overall_pass; then
83+
echo -e "${GREEN}[OVERALL PASS]${NC} GLMark2 rendering validated."
84+
log_pass "$TESTNAME PASS"
85+
echo "$TESTNAME PASS" > "$test_path/$TESTNAME.res"
86+
exit 0
87+
else
88+
echo -e "${RED}[OVERALL FAIL]${NC} One or more GLMark2 tests failed."
89+
log_fail "$TESTNAME FAIL"
90+
echo "$TESTNAME FAIL" > "$test_path/$TESTNAME.res"
91+
exit 1
92+
fi
93+
94+
log_info "-------------------Completed $TESTNAME Testcase----------------------------"

Runner/suites/Multimedia/Graphics/run.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)