!8913 Fix bug of env-setting while no LD_LIBRARY_PATH

From: @zhoufeng54
Reviewed-by: @kisnwang,@jjfeing
Signed-off-by: @jjfeing
This commit is contained in:
mindspore-ci-bot 2020-11-23 20:24:17 +08:00 committed by Gitee
commit dd86f0234d
1 changed files with 4 additions and 1 deletions

View File

@ -210,7 +210,10 @@ class AscendEnvChecker(EnvChecker):
import te
except RuntimeError:
if Path(self.tbe_path).is_dir():
os.environ['LD_LIBRARY_PATH'] = self.tbe_path + ":" + os.environ['LD_LIBRARY_PATH']
if os.getenv('LD_LIBRARY_PATH'):
os.environ['LD_LIBRARY_PATH'] = self.tbe_path + ":" + os.environ['LD_LIBRARY_PATH']
else:
os.environ['LD_LIBRARY_PATH'] = self.tbe_path
else:
raise EnvironmentError(
f"No such directory: {self.tbe_path}, Please check if Ascend 910 AI software package is "