forked from mindspore-Ecosystem/mindspore
add te version check warning countdown
Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
This commit is contained in:
parent
6137a449ed
commit
3a7a4d9a98
|
@ -1,8 +1,12 @@
|
||||||
cmake_minimum_required(VERSION 3.14.0)
|
cmake_minimum_required(VERSION 3.14.0)
|
||||||
project(MindSpore)
|
project(MindSpore)
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3.0)
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
message(FATAL_ERROR "GCC version ${CMAKE_CXX_COMPILER_VERSION} must not be less than 7.3.0")
|
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()
|
endif()
|
||||||
|
|
||||||
include(${CMAKE_SOURCE_DIR}/cmake/options.cmake)
|
include(${CMAKE_SOURCE_DIR}/cmake/options.cmake)
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
"""version and config check"""
|
"""version and config check"""
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from abc import abstractmethod, ABCMeta
|
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)
|
process = subprocess.run(call_cmd, timeout=3, text=True, capture_output=True, check=False)
|
||||||
if process.stdout.strip() != "":
|
if process.stdout.strip() != "":
|
||||||
logger.warning(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:
|
except subprocess.TimeoutExpired:
|
||||||
logger.info("Package te, topi, hccl version check timed out, skip.")
|
logger.info("Package te, topi, hccl version check timed out, skip.")
|
||||||
|
|
||||||
|
@ -382,6 +387,9 @@ class AscendEnvChecker(EnvChecker):
|
||||||
|
|
||||||
def check_version_and_env_config():
|
def check_version_and_env_config():
|
||||||
"""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":
|
if __package_name__.lower() == "mindspore-ascend":
|
||||||
env_checker = AscendEnvChecker()
|
env_checker = AscendEnvChecker()
|
||||||
elif __package_name__.lower() == "mindspore-gpu":
|
elif __package_name__.lower() == "mindspore-gpu":
|
||||||
|
|
Loading…
Reference in New Issue