#!/bin/bash set -ex MINDSPORE_VERSION=${MINDSPORE_VERSION:-1.5.0} PYTHON_VERSION=${PYTHON_VERSION:-3.7.5} MINDSPORE_VERSION=${MINDSPORE_VERSION:-1.5.0} CUDA_VERSION=${CUDA_VERSION:-11.1.1-1} LIB_CUDA_VERSION=${LIB_CUDA_VERSION:-8.0.5.39-1+cuda11.1} DISTRIBUTED=${DISTRIBUTED:-false} CUDATOOLKIT_VERSION=${CUDATOOLKIT_VERSION:-11.1} CUDNN_VERSION=${CUDNN_VERSION:-8.0.5} cd /tmp curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh bash Miniconda3-py37_4.10.3-Linux-x86_64.sh # add conda to PATH echo -e 'export PATH=~/miniconda3/bin/:$PATH' >> ~/.bash_profile echo -e '. ~/miniconda3/etc/profile.d/conda.sh' >> ~/.bash_profile source ~/.bash_profile conda init bash # setting up conda mirror cat >~/.condarc <> ~/.bash_profile # install mindspore-gpu with conda conda install mindspore-gpu=${MINDSPORE_VERSION} cudatoolkit=${CUDATOOLKIT_VERSION} -c mindspore -c conda-forge -y # check if it is the right mindspore version python -c "import mindspore;mindspore.run_check()" # check if it can be run with GPU cat > example.py <