James round seconds (#129)

this is a ford of jd/harness-fixes that is currently live on the
benches, the ONLY thing i changed is im rounding the timestamps to the
nearest second

please approve

---------

Co-authored-by: J-Doiron <139803019+J-Doiron@users.noreply.github.com>
This commit is contained in:
j-lin-lmg
2025-04-09 14:34:19 -07:00
committed by GitHub
parent 0cff2aae7c
commit 36c542be4a
74 changed files with 2115 additions and 257 deletions

View File

@@ -1,21 +1,24 @@
# 3DMark
# UL Procyon AI Computer Vision
Runs one of the 3DMark benchmark scenes and reads the Performance Graphics Score result from the output.
Runs the UL Procyon AI Computer Vision benchmark using a specified engine and reads the Performance Score result from the output.
## Prerequisites
- Python 3.10+
- 3DMark Professional Edition installed in default location and activated.
- Desired benchmarks are downloaded,.
- UL Procyon installed in default location and activated with at least the AI tests
- AI Computer Vision Benchmark DLC installed
## Options
- `--benchmark` Specifies the benchmark to run.
- `--engine` Specifies the hardware to benchmark.
## Output
report.json
- `test`: The name of the selected benchmark
- `score`: 3DMark gpu score
- `start_time`: number representing a timestamp of the test's start time in milliseconds
- `end_time`: number representing a timestamp of the test's end time in milliseconds
- `end_time`: number representing a timestamp of the test's end time in milliseconds
- `test`: The name of the selected benchmark
- `test_version`: The version of the benchmark
- `device_name`: The name of the device tested
- `procyon_version`: The version of Procyon used
- `score`: The text generation scores

View File

@@ -1,4 +1,4 @@
"""3DMark test script"""
"""UL Procyon Computer Vision test script"""
from argparse import ArgumentParser
import logging
from pathlib import Path
@@ -10,6 +10,9 @@ from utils import (
find_score_in_xml,
is_process_running,
get_install_path,
find_procyon_version,
find_test_version
)
PARENT_DIR = str(Path(sys.path[0], ".."))
@@ -198,12 +201,14 @@ try:
logging.info("Score was %s", score)
report = {
"test": BENCHMARK_CONFIG[args.engine]["test_name"],
"device_name": BENCHMARK_CONFIG[args.engine]["device_name"],
"unit": "score",
"score": score,
"start_time": seconds_to_milliseconds(start_time),
"end_time": seconds_to_milliseconds(end_time)
"end_time": seconds_to_milliseconds(end_time),
"test": BENCHMARK_CONFIG[args.engine]["test_name"],
"test_version": find_test_version(),
"device_name": BENCHMARK_CONFIG[args.engine]["device_name"],
"procyon_version": find_procyon_version(),
"unit": "score",
"score": score
}
write_report_json(LOG_DIR, "report.json", report)

View File

@@ -1,8 +1,13 @@
"""3dmark test utils"""
"""UL Procyon Computer Vision test utils"""
from pathlib import Path
import psutil
import winreg
import re
import os
import win32api
import sys
from argparse import ArgumentParser
import logging
SCRIPT_DIR = Path(__file__).resolve().parent
LOG_DIR = SCRIPT_DIR / "run"
@@ -28,8 +33,119 @@ def find_score_in_xml():
return score_value
def get_install_path() -> str:
"""Gets the path to the Steam installation directory from the SteamPath registry key"""
"""Gets the path to the Procyon installation directory from the Procyon registry key"""
reg_path = r"Software\UL\Procyon"
reg_key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, reg_path, 0, winreg.KEY_READ)
value, _ = winreg.QueryValueEx(reg_key, "InstallDir")
return value
def find_procyon_version() -> str:
"""Gets the version of an executable located in the install path."""
install_path = get_install_path()
if not install_path:
logging.info("Installation path not found.")
return None
exe_path = os.path.join(install_path, "ProcyonCmd.exe")
if not os.path.exists(exe_path):
logging.info(f"Executable not found at {exe_path}")
return None
try:
# Get all file version info
info = win32api.GetFileVersionInfo(exe_path, "\\")
# Extract FileVersionMS and FileVersionLS
ms = info.get("FileVersionMS")
ls = info.get("FileVersionLS")
if ms is None or ls is None:
logging.info("No FileVersionMS or FileVersionLS found.")
return None
# Convert to human-readable version: major.minor.build.revision
major = ms >> 16
minor = ms & 0xFFFF
build = ls >> 16
revision = ls & 0xFFFF
version = f"{major}.{minor}.{build}.{revision}"
return version
except Exception as e:
logging.info(f"Error retrieving version info from {exe_path}: {e}")
return None # Return None if version info retrieval fails
def find_test_version() -> str:
"""Gets the version of an executable located in the chops path."""
parser = ArgumentParser()
parser.add_argument(
"--engine", dest="engine", help="The engine used to run the AI CV", required=True
)
args = parser.parse_args()
apps = [
"AMD_CPU",
"AMD_GPU0",
"AMD_GPU1",
"Intel_CPU",
"Intel_GPU0",
"Intel_GPU1",
"Intel_NPU",
"NVIDIA_GPU",
"Qualcomm_HTP"
]
if args.engine is None or args.engine not in apps:
logging.info("unrecognized option for program")
sys.exit(1)
if args.engine == "AMD_CPU":
folder = "aibenchmark-winml-test"
exe = "WinML.exe"
if args.engine == "AMD_GPU0":
folder = "aibenchmark-winml-test"
exe = "WinML.exe"
if args.engine == "AMD_GPU1":
folder = "aibenchmark-winml-test"
exe = "WinML.exe"
if args.engine == "Intel_CPU":
folder = "aibenchmark-openvino-test"
exe = "OpenVino.exe"
if args.engine == "Intel_GPU0":
folder = "aibenchmark-openvino-test"
exe = "OpenVino.exe"
if args.engine == "Intel_GPU1":
folder = "aibenchmark-openvino-test"
exe = "OpenVino.exe"
if args.engine == "Intel_NPU":
folder = "aibenchmark-openvino-test"
exe = "OpenVino.exe"
if args.engine == "NVIDIA_GPU":
folder = "aibenchmark-tensorrt-test"
exe = "TensorRT.exe"
if args.engine == "Qualcomm_HTP":
folder = "aibenchmark-snpe-test"
exe = "SNPE.exe"
chops_path = f"C:\\ProgramData\\UL\\Procyon\\chops\\dlc\\{folder}\\x64"
if not chops_path:
logging.info("Installation path not found.")
return None
exe_path = os.path.join(chops_path, exe)
if not os.path.exists(exe_path):
logging.info(f"Executable {exe} not found at {exe_path}")
return None
try:
lang, codepage = win32api.GetFileVersionInfo(exe_path, "\\VarFileInfo\\Translation")[0]
str_info_path = f"\\StringFileInfo\\{lang:04X}{codepage:04X}\\ProductVersion"
return win32api.GetFileVersionInfo(exe_path, str_info_path)
except Exception as e:
logging.info(f"Error retrieving version info from {exe_path}: {e}")
return None # Return None if version info retrieval fails