!18704 add te version check warning countdown

Merge pull request !18704 from zhoufeng/dx-te-gcc
This commit is contained in:
i-robot 2021-06-23 01:29:59 +00:00 committed by Gitee
commit e3dbf76223
2 changed files with 14 additions and 2 deletions

View File

@ -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)

View File

@ -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":