diff --git a/README.md b/README.md index 1637b4f52bfa260c1635b1959707bc650ae80a7e..9258d613fc8976d3bf7023cb9a9a2de1455fbb29 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,7 @@ oec-hardware-1.1.1 版本将不再进行更新维护,请获取最新版本的 | | https://github.com/NVIDIA/cuda-samples/archive/refs/heads/master.zip | `/opt` | | VGPU | NVIDIA vgpu client驱动软件包 | /root | | | 下载对应版本和架构的虚拟机镜像文件,此处以openEuler 22.03LTS、x86_64为例:https://repo.openeuler.org/openEuler-22.03-LTS/virtual_machine_img/x86_64/openEuler-22.03-LTS-x86_64.qcow2.xz | `/opt` | + | aiacc | Corerain X3A 驱动软件包:https://gitee.com/qren/cr_aiacc/archive/refs/tags/v1.zip | `/opt` | # 工具安装 @@ -454,6 +455,12 @@ oec-hardware-1.1.1 版本将不再进行更新维护,请获取最新版本的 客户端使用发包模式(Tx-only mode)作为数据包源,服务端使用收包模式(Rx-only mode) 作为数据包接收器, 测试端口传输速率功能。 +23. **aiacc** + + - 测试 Corerain X3A aiacc 服务端基本功能。 + - 部署 Corerain X3A aiacc 客户端虚拟机,测试驱动安装,测试客户端 aiacc 功能。 + - aiacc 服务端监控客户端的运行。 + # 社区开发者参与介绍 ## 环境部署 diff --git a/docs/design_docs/dev_design.md b/docs/design_docs/dev_design.md index 57c7456953596a8b5a4eaa6563606830058df543..b08f6cc052e4a6c459ba3d4b142fde6d49c5208c 100644 --- a/docs/design_docs/dev_design.md +++ b/docs/design_docs/dev_design.md @@ -91,6 +91,10 @@ | system | policycoreutils | system 测试 | | spdk | spdk | spdk 测试 | | dpdk | dpdk-testpmd | dpdk 测试 | +| aiacc | gcc | aiacc 测试 | +| | g++ | | +| | make | | +| | cmake | | ### 1.3 License diff --git a/hwcompatible/compatibility.py b/hwcompatible/compatibility.py old mode 100755 new mode 100644 index dbcacf34ebdc439b00f0be2de06a8a1395ed36ce..2d7e61e2107c2153deb606ddd62143d463238f7d --- a/hwcompatible/compatibility.py +++ b/hwcompatible/compatibility.py @@ -318,6 +318,13 @@ class EulerCertification(): else: sort_devices["fc"] = [device] continue + # Corerain aiacc device + if device.get_property("PCI_ID") == "1C8C:2432": + if "aiacc" in sort_devices.keys(): + sort_devices["aiacc"].extend([device]) + else: + sort_devices["aiacc"] = [device] + continue driver = device.get_property("DRIVER") if any([d in driver for d in GPU_DRIVER]): if "gpu" in sort_devices.keys(): diff --git a/hwcompatible/constants.py b/hwcompatible/constants.py index 43c37f406cf8160431161ce004d269ac4c966e14..f65b0ae720a44a917ccd19dac319a6cbb050633f 100644 --- a/hwcompatible/constants.py +++ b/hwcompatible/constants.py @@ -34,7 +34,7 @@ KEYCARD_VENDORS = ('Xilinx', 'Renesas', 'Texas', 'PLX') IB = "infiniband" DEVICE_INFO = ('color', 'status', 'num', 'run', 'name', 'device', 'driver', 'version', 'chip', 'board') -NO_CONFIG_DEVICES = ("gpu", "vgpu", "nvme", "dpdk", "cdrom", "keycard", "spdk") +NO_CONFIG_DEVICES = ("gpu", "vgpu", "nvme", "dpdk", "cdrom", "keycard", "spdk", "aiacc") # File access control FILE_FLAGS = os.O_WRONLY | os.O_CREAT | os.O_TRUNC @@ -48,4 +48,4 @@ SHELL_ENV = { # Log rotate settings MAX_BYTES = 31457280 -MAX_COUNT = 30 \ No newline at end of file +MAX_COUNT = 30 diff --git a/hwcompatible/device.py b/hwcompatible/device.py index 2f265c66f533c01267238040dce119179151e00c..104302e30e92a506b5fbb5b44640c0256f17d8a1 100755 --- a/hwcompatible/device.py +++ b/hwcompatible/device.py @@ -145,6 +145,9 @@ class Device: # 8088 indicate Netswift if self.quad[0] == "8088": self.get_nic_netswift() + # 1c8c indicate Corerain + if self.quad[0] == "1c8c": + self.get_nic_netswift() except Exception: self.logger.error( "Get board information failed, please check %s!" % CertEnv.pcifile, terminal_print=False) @@ -297,10 +300,10 @@ class Device: elif flag == 1: if re.match("\t" + self.quad[1], ln): flag += 1 - self.chip = self._search_info(r'(RP\S*)', ln) + self.chip = self._search_info(r'((Corerain|RP)\S*)', ln) else: if re.match("\t\t" + self.quad[2] + " " + self.quad[3], ln): - self.board = self._search_info(r'(RP\S*)', ln) + self.board = self._search_info(r'((Corerain|RP)\S*)', ln) break def get_broadcom_card(self): diff --git a/tests/aiacc/Makefile b/tests/aiacc/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..fca58607cd9b34e321fe1322baafa45b16e924db --- /dev/null +++ b/tests/aiacc/Makefile @@ -0,0 +1,23 @@ +# Copyright (c) 2022 Huawei Technologies Co., Ltd. +# oec-hardware is licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +# PURPOSE. +# See the Mulan PSL v2 for more details. +# Create: 2023-01-10 + +.PHONY: install clean + +all: ; + +install: + mkdir -p $(DEST) + cp -a *.py $(DEST) + cp -a *.sh $(DEST) + chmod a+x $(DEST)/*.py + +clean: + rm -rf $(DEST) diff --git a/tests/aiacc/aiacc.py b/tests/aiacc/aiacc.py new file mode 100644 index 0000000000000000000000000000000000000000..959d920e8dd4f3d857962ab9cc68d73f98881148 --- /dev/null +++ b/tests/aiacc/aiacc.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +# Copyright (c) 2020-2023 Huawei Technologies Co., Ltd. +# oec-hardware is licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +# PURPOSE. +# See the Mulan PSL v2 for more details. +# Author: @quanren +# Create: 2023-01-10 +# Desc: aiacc test, support Corerain series aiacc + +import argparse +from hwcompatible.command import Command +from hwcompatible.test import Test +from cr_aiacc import CRAIaccTest + + +class aiaccTest(Test): + def __init__(self): + Test.__init__(self) + self.requirements = ["gcc-c++", "make", "git"] + self.device = None + + def setup(self, args=None): + """ + Initialization before test + """ + super().setup(args) + self.device = getattr(args, 'device', None) + + def test(self): + """ + Test case + Returns: + bool: Execution result + """ + result = False + driver = self.device.get_driver() + if driver == "Corerain DMA": + cr_test = CRAIaccTest(self.device, self.logger, self.command) + cr_test.get_driver_info() + result = cr_test.test_cr_aiacc_sample() + return result + else: + self.logger.info("No driver named Corerain DMA was found ! ", terminal_print=True) + return result + + diff --git a/tests/aiacc/cr_aiacc.py b/tests/aiacc/cr_aiacc.py new file mode 100644 index 0000000000000000000000000000000000000000..5d85719597fef909aac16a2fb398b0758464f59a --- /dev/null +++ b/tests/aiacc/cr_aiacc.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +# Copyright (c) 2020-2023 Huawei Technologies Co., Ltd. +# oec-hardware is licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +# PURPOSE. +# See the Mulan PSL v2 for more details. +# Author: @quanren +# Create: 2023-01-10 +# Desc: Corerain aiacc test. + +import os + +class CRAIaccTest(): + def __init__(self, device, logger, command): + self.device = device + self.logger = logger + self.command = command + self.cr_aiacc_driver_log = os.path.join(self.logger.logdir, 'cr_aiacc_driver.log') + self.cr_aiacc_DM_log = os.path.join(self.logger.logdir, 'cr_aiacc_DM.log') + self.cr_aiacc_sample_log = os.path.join(self.logger.logdir, 'cr_aiacc_sample.log') + self.screen_info_log = os.path.join(self.logger.logdir, 'screen_info.log') + + def get_driver_info(self): + """ + Get driver info, includings name, version + """ + self.logger.info("Vendor Info:", terminal_print=True) + self.command.run_cmd('lspci -vs %s' % self.device.pci) + + self.logger.info("Driver Info:", terminal_print=True) + driver = self.device.driver + self.logger.info("Driver Name: %s" % driver) + + driver_version = self.device.get_driver_version() + if driver_version: + self.logger.info("Driver Version: %s" % driver_version) + else: + self.logger.warning( + "The driver version information cannot be obtained. Please view it manually.") + + def test_cr_aiacc_sample(self): + """ + Test screen information for corerain x3a + Returns: + bool: + """ + os.chdir("/opt/cr_aiacc/") + cmd = self.command.run_cmd( + "./run > %s " % self.cr_aiacc_sample_log) + if cmd[2] == 0: + self.logger.info("Test corerain aiacc screen information succeed.") + else: + self.logger.error("Test corerain aiacc screen information failed.") + return False + + return True