Poc测试中CPUBench遇到System time is earlier than the release time of CPUBench-1.2.0, It will cause some workload failed to build, Please update system time.报错问题处理
![图片[1]|POC测试中CPUBench时间报错处理|安可通用设备资源站](https://ak.cueany.cn/wp-content/uploads/2025/09/9b1331c7292c603abcda464c18fb93fe-1024x428.png)
在arm架构服务器poc测试中,有可能会遇到System time is earlier than the release time of CPUBench-1.2.0, It will cause some workload failed to build, Please update system time.报错,翻译:系统时间早于CPUBench-1.2.0的发布时间,这将导致部分工作负载构建失败,请更新系统时间。
然而,系统时间已经最新
![图片[2]|POC测试中CPUBench时间报错处理|安可通用设备资源站](https://ak.cueany.cn/wp-content/uploads/2025/09/d3bb147b71db8c1946278916c4ef1680.png)
我们在 framework/cpubench.py
脚本中找到了 initial_cpubench_env()
函数
version_package_time = os.stat(version_txt).st_mtime # 获取 version.txt 文件的最后修改时间
now = time.time() # 获取当前系统时间
if now < version_package_time: # 如果当前系统时间早于文件的修改时间
log.error("System time is earlier than the release time of CPUBench-{}, It will cause some workload failed to build, Please update system time.".format(GlobalVar.version))
return ErrorCode.INITENV_FAIL
这里定义了以version.txt 文件的最后修改时间来作为最后版本时间,我们可以尝试:
- 备份原始文件(可选,但是好习惯):
cp /home/CPUBench/version.txt /home/CPUBench/version.txt.bak
- 使用
touch
命令修改文件时间戳:
# 将 version.txt 的修改时间设置为一个未来的时间,例如 2025年1月1日
touch -t 202501010000 /home/CPUBench/version.txt
•-t
参数后面跟的时间格式是 [[CC]YY]MMDDhhmm[.ss]
(年月日时分.秒)
- 验证时间是否修改成功:
ls -l /home/CPUBench/version.txt # 查看新的修改时间
- 重新运行 CPUBench:
./cpubench.sh -c config-test.ini
![图片[3]|POC测试中CPUBench时间报错处理|安可通用设备资源站](https://ak.cueany.cn/wp-content/uploads/2025/09/image-1024x501.png)
成功!
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容