From 3a7a4d9a98bf7d23915201322f805847eb99d076 Mon Sep 17 00:00:00 2001 From: zhoufeng Date: Tue, 22 Jun 2021 17:14:46 +0800 Subject: [PATCH] add te version check warning countdown Signed-off-by: zhoufeng --- CMakeLists.txt | 8 ++++++-- mindspore/run_check/_check_version.py | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa945645d11..d341c39c848 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,12 @@ cmake_minimum_required(VERSION 3.14.0) project(MindSpore) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3.0) - message(FATAL_ERROR "GCC version ${CMAKE_CXX_COMPILER_VERSION} must not be less than 7.3.0") +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3.0) + message(FATAL_ERROR "GCC version ${CMAKE_CXX_COMPILER_VERSION} must not be less than 7.3.0") + elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.3.0) + message(WARNING "GCC version ${CMAKE_CXX_COMPILER_VERSION} is greater than 7.3.0, may cause unknown problems.") + endif() endif() include(${CMAKE_SOURCE_DIR}/cmake/options.cmake) diff --git a/mindspore/run_check/_check_version.py b/mindspore/run_check/_check_version.py index 72e1a1ac44a..f1eb67b52c7 100644 --- a/mindspore/run_check/_check_version.py +++ b/mindspore/run_check/_check_version.py @@ -15,6 +15,7 @@ """version and config check""" import os import sys +import time import subprocess from pathlib import Path from abc import abstractmethod, ABCMeta @@ -290,6 +291,10 @@ class AscendEnvChecker(EnvChecker): process = subprocess.run(call_cmd, timeout=3, text=True, capture_output=True, check=False) if process.stdout.strip() != "": logger.warning(process.stdout.strip()) + warning_countdown = 3 + for i in range(warning_countdown, 0, -1): + logger.warning(f"Please pay attention to the above warning, countdown: {i}") + time.sleep(1) except subprocess.TimeoutExpired: logger.info("Package te, topi, hccl version check timed out, skip.") @@ -382,6 +387,9 @@ class AscendEnvChecker(EnvChecker): def check_version_and_env_config(): """check version and env config""" + if os.getenv("MS_CLOSE_VERSION_CHECK") == "ON": + return + os.environ["MS_CLOSE_VERSION_CHECK"] = "ON" if __package_name__.lower() == "mindspore-ascend": env_checker = AscendEnvChecker() elif __package_name__.lower() == "mindspore-gpu":