近日,我部门拿到了一台国产CPU(龙芯3C5000)的服务器,具体型号为联志26040R;该主机配有2颗16核的龙芯3C5000处理器,2条32G的DDR4内存,1块960GB的SSD盘+1块4T的SATA盘,外加4个板载千兆网卡。在安装具体应用之前,我们决定对该机进行一次全面测试。

测试之前,先安装好了基本的操作系统:Kylin Linux Advanced Server release V10 (Lance)。

SPEC CPU-2017为大部分平台提供了预编译二进制文件,文件在$SPEC/tools/bin/目录下,在有预编译工具的平台上就可以直接运行 install.sh 或 install.bat 进行安装。

按照SEPC官网上的说明:“有时可能需要重建工具,例如,如果操作系统的变化使预编二进制无法操作,或者如果您是第一个为新架构添加支持的人。”那么,当测试工具的预编译二进制在某些系统上不能运行时,或者当缺少某个架构的预编译二进制时,就应该自己编译测试工具。

由于我们这次测试主机的CPU龙芯3C5000的架构loongarch64不在支持的架构之列,所以我们需要先自行编译测试工具。

1.1. 将源码解压到工作目录

先将cpu2017-1.0.5.iso上传到临时目录(如:/root);然后顺序执行:

# mount -t iso9660 cpu2017-1.0.5.iso /mnt

# cd /mnt

# mkdir /root/speccpu2017

# cp -R * /root/speccpu2017/

# cd /root/speccpu2017/install_archives

# tar xJf cpu2017.tar.xz -C /home/wyb

# rm -rf /root/speccpu2017

1.2. 解决编译脚本识别不了loongarch64架构的问题

# cd $SPEC/tools/src

# find . -name config.sub

编辑上一步找到的这7个config.sub文件,

找到:# Some are omitted here because they have special meanings below.

把下一行:1750a | 580 \

修改为:1750a | 580 | loongarch64 \

---------------------------------

找到:# Recognize the basic CPU types with company name.

把下一行:580-* \

修改为:580-* | loongarch64-* \

然后执行以下命令:

# CONFIGFLAGS='--build=loongarch64-linux-gnu' ./buildtools

1.3. 解决出现"__alloca"未定义的错误

在上一步执行中,最后出现"__alloca"未定义的错误:

# cd $SPEC/tools/src

# vi ./make-4.2.1/glob/glob.c

找到#if !defined __alloca && !defined __GNU_LIBRARY__和配对的#endif,把这两行前面加注释符号“//”,屏蔽掉这两行。

然后继续执行以下命令:

# CONFIGFLAGS='--build=loongarch64-linux-gnu' ./buildtools

1.4. 解决执行PERL代码run_make_tests.pl出现的错误

上一步执行中,出现找不到包含文件的错误:

# cd $SPEC/tools/src

# vi ./make-4.2.1/tests/run_make_tests.pl

定位到61行,修改61,62行

require "test_driver.pl";

require "config-flags.pm";

为:

require "./test_driver.pl";

require "./config-flags.pm";

然后继续执行以下命令:

# CONFIGFLAGS='--build=loongarch64-linux-gnu' ./buildtools

1.5. 解决出现mknod can create fifo without root privileges的错误

上一步执行中,出现mknod can create fifo without root privileges的错误:

解决方法:设置环境变量FORCE_UNSAFE_CONFIGURE=1

继续执行以下命令:

# FORCE_UNSAFE_CONFIGURE=1 CONFIGFLAGS='--build=loongarch64-linux-gnu' ./buildtools

1.6. 解决getdate.t所有子测试项目均失败的错误

上一步执行中,出现” t/getdate.t .. Failed 146/146 subtests”的错误:

解决方法:

# cd $SPEC/tools/src

# vi ./TimeDate-2.30/t/getdate.t

找到“$time_expect += $offset;”这一行,删除掉或加注释符号屏蔽掉它

然后继续执行以下命令:

# FORCE_UNSAFE_CONFIGURE=1 CONFIGFLAGS='--build=loongarch64-linux-gnu' ./buildtools

.

.

.

Tools built successfully.  Go to the top of the tree and

source the shrc file.  Then you should be ready.

至此,buildtools执行圆满成功。

1.7. 执行packagetools,生成校验码

# cd $SPEC

# . ./shrc

# bin/packagetools loongxin64

1.8. 编辑SpecCPU-2017测试配置文件

# cd $SPEC/config

# cp Example-gcc-linux-aarch64.cfg bcu-linux-loongarch64.cfg

# vi bcu-linux-loongarch64.cfg

(略)

1.9. 跑分测试

# ulimit -s unlimited

# cd $SPEC

# . ./shrc

# bin/runcpu -c bcu-liunx-loongarch64 intrate

(实测得分:30.4)

# bin/runcpu -c bcu-liunx-loongarch64 intspeed

(实测得分:3.21)

# bin/runcpu -c bcu-liunx-loongarch64 fprate

(实测得分:22.4)

# bin/runcpu -c bcu-liunx-loongarch64 fpspeed

(实测得分:11.6)

参考文献:

0. SPEC CPU2017 Config Files

https://www.spec.org/cpu2017/Docs/config.html

1.在龙芯3A5000上测试SPEC CPU 2006

https://zhuanlan.zhihu.com/p/393600027

2.speccpu测试工具介绍和使用说明

https://blog.csdn.net/weixin_38607058/article/details/125187568

3.SPECCPU 2017测试指导

https://blog.csdn.net/kobe24fgy/article/details/112046820

4.SpecCPU2017 测试cpu性能

https://www.cnblogs.com/xiaoqi-home/p/15981359.html

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐