From 0703b9d13417dd9c3f7bc8da58dbbf1ce8007dcd Mon Sep 17 00:00:00 2001 From: xulei Date: Wed, 6 Apr 2022 17:44:33 +0800 Subject: [PATCH] use conda-forge channel in conda create --- scripts/install/euleros-ascend-conda.sh | 6 ++++- scripts/install/euleros-ascend-pip.sh | 2 +- scripts/install/euleros-ascend-source.sh | 6 ++++- scripts/install/euleros-ascend310-pip.sh | 28 ++++++++++++++---------- scripts/install/ubuntu-cpu-conda.sh | 2 +- scripts/install/ubuntu-gpu-conda.sh | 2 +- 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/scripts/install/euleros-ascend-conda.sh b/scripts/install/euleros-ascend-conda.sh index 0d79efdf889..e2ea7351e9c 100644 --- a/scripts/install/euleros-ascend-conda.sh +++ b/scripts/install/euleros-ascend-conda.sh @@ -110,8 +110,12 @@ set -e # set up conda env env_name=mindspore_py3${PYTHON_VERSION##*.} -conda create -n $env_name python=${PYTHON_VERSION} -y +conda create -n $env_name python=${PYTHON_VERSION} -c conda-forge -y conda activate $env_name +# downgrade openssl when py3.9+310 +if [[ "$PYTHON_VERSION" == "3.9" ]]; then + conda install openssl=1.1.1 -y +fi pip install sympy pip install ${LOCAL_ASCEND}/ascend-toolkit/latest/fwkacllib/lib64/topi-*-py3-none-any.whl diff --git a/scripts/install/euleros-ascend-pip.sh b/scripts/install/euleros-ascend-pip.sh index ac56babbb7b..765e36a9429 100644 --- a/scripts/install/euleros-ascend-pip.sh +++ b/scripts/install/euleros-ascend-pip.sh @@ -110,7 +110,7 @@ set -e # set up conda env env_name=mindspore_py3${PYTHON_VERSION##*.} -conda create -n $env_name python=${PYTHON_VERSION} -y +conda create -n $env_name python=${PYTHON_VERSION} -c conda-forge -y conda activate $env_name pip install sympy diff --git a/scripts/install/euleros-ascend-source.sh b/scripts/install/euleros-ascend-source.sh index 231d9f0bc7a..e9c571c9df5 100644 --- a/scripts/install/euleros-ascend-source.sh +++ b/scripts/install/euleros-ascend-source.sh @@ -98,8 +98,12 @@ set -e # set up conda env env_name=mindspore_py3${PYTHON_VERSION##*.} -conda create -n $env_name python=${PYTHON_VERSION} -y +conda create -n $env_name python=${PYTHON_VERSION} -c conda-forge -y conda activate $env_name +# downgrade openssl when py3.9+310 +if [[ "$PYTHON_VERSION" == "3.9" ]]; then + conda install openssl=1.1.1 -y +fi pip install wheel pip install -U setuptools diff --git a/scripts/install/euleros-ascend310-pip.sh b/scripts/install/euleros-ascend310-pip.sh index 2ffa2b57dfb..0da85b03d94 100644 --- a/scripts/install/euleros-ascend310-pip.sh +++ b/scripts/install/euleros-ascend310-pip.sh @@ -71,6 +71,17 @@ add_env() { sudo yum install gcc gmp-devel -y +# cmake +cd /tmp +cmake_file_name="cmake-3.19.8-Linux-$(arch).sh" +curl -O "https://cmake.org/files/v3.19/${cmake_file_name}" +sudo mkdir $HOME/cmake-3.19.8 +sudo bash cmake-3.19.8-Linux-*.sh --prefix=$HOME/cmake-3.19.8 --exclude-subdir +add_env PATH $HOME/cmake-3.19.8/bin +set +e && source ~/.bashrc +set -e +cd - + install_conda() { conda_file_name="Miniconda3-py3${PYTHON_VERSION##*.}_4.10.3-Linux-$(arch).sh" cd /tmp @@ -109,24 +120,17 @@ set -e # set up conda env env_name=mindspore_py3${PYTHON_VERSION##*.} -conda create -n $env_name python=${PYTHON_VERSION} -y +conda create -n $env_name python=${PYTHON_VERSION} -c conda-forge -y conda activate $env_name +# downgrade openssl when py3.9+310 +if [[ "$PYTHON_VERSION" == "3.9" ]]; then + conda install openssl=1.1.1 -y +fi pip install sympy pip install ${LOCAL_ASCEND}/ascend-toolkit/latest/fwkacllib/lib64/topi-*-py3-none-any.whl pip install ${LOCAL_ASCEND}/ascend-toolkit/latest/fwkacllib/lib64/te-*-py3-none-any.whl pip install ${LOCAL_ASCEND}/ascend-toolkit/latest/fwkacllib/lib64/hccl-*-py3-none-any.whl -# cmake -cd /tmp -cmake_file_name="cmake-3.19.8-Linux-$(arch).sh" -curl -O "https://cmake.org/files/v3.19/${cmake_file_name}" -sudo mkdir $HOME/cmake-3.19.8 -sudo bash cmake-3.19.8-Linux-*.sh --prefix=$HOME/cmake-3.19.8 --exclude-subdir -add_env PATH $HOME/cmake-3.19.8/bin -set +e && source ~/.bashrc -set -e -cd - - ARCH=`uname -m` pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/${MINDSPORE_VERSION}/MindSpore/ascend/${ARCH}/mindspore_ascend-${version_map["$PYTHON_VERSION"]}-linux_${ARCH}.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple diff --git a/scripts/install/ubuntu-cpu-conda.sh b/scripts/install/ubuntu-cpu-conda.sh index 3ca7440cf0e..997e4ed3521 100644 --- a/scripts/install/ubuntu-cpu-conda.sh +++ b/scripts/install/ubuntu-cpu-conda.sh @@ -100,7 +100,7 @@ set -e # set up conda env and install mindspore-cpu env_name=mindspore_py3${PYTHON_VERSION##*.} -conda create -n $env_name python=${PYTHON_VERSION} -y +conda create -n $env_name python=${PYTHON_VERSION} -c conda-forge -y conda activate $env_name install_name="mindspore-cpu" if [[ $MINDSPORE_VERSION != "EMPTY" ]]; then diff --git a/scripts/install/ubuntu-gpu-conda.sh b/scripts/install/ubuntu-gpu-conda.sh index 5926deee465..ffa970be5f2 100644 --- a/scripts/install/ubuntu-gpu-conda.sh +++ b/scripts/install/ubuntu-gpu-conda.sh @@ -164,7 +164,7 @@ env_name=mindspore_py3${PYTHON_VERSION##*.} declare -A cudnn_version_map=() cudnn_version_map["10.1"]="7.6.5" cudnn_version_map["11.1"]="8.1.0" -conda create -n $env_name python=${PYTHON_VERSION} -y +conda create -n $env_name python=${PYTHON_VERSION} -c conda-forge -y conda activate $env_name install_name="mindspore-gpu" if [[ $MINDSPORE_VERSION != "EMPTY" ]]; then