From efd8a5c8c8aeb74a09a838425ad973399515461c Mon Sep 17 00:00:00 2001 From: yanghaoran Date: Mon, 11 Aug 2025 21:11:24 +0800 Subject: [PATCH] update version 2.7.0 --- install/mindspore_ascend_install_docker.md | 6 +- install/mindspore_ascend_install_docker_en.md | 2 +- install/mindspore_ascend_install_pip.md | 4 +- install/mindspore_ascend_install_pip_en.md | 4 +- install/mindspore_cpu_install_docker.md | 126 ------- install/mindspore_cpu_install_docker_en.md | 126 ------- install/mindspore_cpu_install_nightly.md | 147 -------- install/mindspore_cpu_install_nightly_en.md | 147 -------- install/mindspore_cpu_install_pip.md | 4 +- install/mindspore_cpu_install_pip_en.md | 4 +- install/mindspore_cpu_mac_install_nightly.md | 90 ----- .../mindspore_cpu_mac_install_nightly_en.md | 90 ----- install/mindspore_cpu_mac_install_pip.md | 4 +- install/mindspore_cpu_mac_install_pip_en.md | 4 +- install/mindspore_cpu_win_install_nightly.md | 64 ---- .../mindspore_cpu_win_install_nightly_en.md | 64 ---- install/mindspore_cpu_win_install_pip.md | 4 +- install/mindspore_cpu_win_install_pip_en.md | 4 +- install/mindspore_gpu_install_conda.md | 250 ------------- install/mindspore_gpu_install_conda_en.md | 250 ------------- install/mindspore_gpu_install_nightly.md | 270 -------------- install/mindspore_gpu_install_nightly_en.md | 270 -------------- install/mindspore_gpu_install_pip.md | 277 --------------- install/mindspore_gpu_install_pip_en.md | 277 --------------- install/mindspore_gpu_install_source.md | 334 ------------------ install/mindspore_gpu_install_source_en.md | 334 ------------------ resource/release/release_list_en.md | 25 ++ resource/release/release_list_zh_cn.md | 27 ++ 28 files changed, 72 insertions(+), 3136 deletions(-) delete mode 100644 install/mindspore_cpu_install_docker.md delete mode 100644 install/mindspore_cpu_install_docker_en.md delete mode 100644 install/mindspore_cpu_install_nightly.md delete mode 100644 install/mindspore_cpu_install_nightly_en.md delete mode 100644 install/mindspore_cpu_mac_install_nightly.md delete mode 100644 install/mindspore_cpu_mac_install_nightly_en.md delete mode 100644 install/mindspore_cpu_win_install_nightly.md delete mode 100644 install/mindspore_cpu_win_install_nightly_en.md delete mode 100644 install/mindspore_gpu_install_conda.md delete mode 100644 install/mindspore_gpu_install_conda_en.md delete mode 100644 install/mindspore_gpu_install_nightly.md delete mode 100644 install/mindspore_gpu_install_nightly_en.md delete mode 100644 install/mindspore_gpu_install_pip.md delete mode 100644 install/mindspore_gpu_install_pip_en.md delete mode 100644 install/mindspore_gpu_install_source.md delete mode 100644 install/mindspore_gpu_install_source_en.md diff --git a/install/mindspore_ascend_install_docker.md b/install/mindspore_ascend_install_docker.md index bb811dc4ee..48bb996963 100644 --- a/install/mindspore_ascend_install_docker.md +++ b/install/mindspore_ascend_install_docker.md @@ -28,7 +28,7 @@ MindSpore的Docker镜像托管在[Huawei SWR](https://support.huaweicloud.com/sw | Atlas 训练系列 | `mindspore` | `mindspore-ascend-a1` | `x.y.z` | 已经预安装Ascend Data Center Solution 与对应的MindSpore Ascend x.y.z版本的生产环境。 | | Atlas A2 训练系列 | `mindspore` | `mindspore-ascend-a2` | `x.y.z` | 已经预安装Ascend Data Center Solution 与对应的MindSpore Ascend x.y.z版本的生产环境。 | -> `x.y.z`对应MindSpore版本号,例如安装2.7.0rc1版本MindSpore时,`x.y.z`应写为2.7.0rc1。 +> `x.y.z`对应MindSpore版本号,例如安装2.7.0版本MindSpore时,`x.y.z`应写为2.7.0。 ## 确认系统环境信息 @@ -60,7 +60,7 @@ docker pull swr.cn-south-1.myhuaweicloud.com/mindspore/{image_name}:{tag} 其中: -- `{tag}`对应上述表格中的标签,如2.7.0rc1。 +- `{tag}`对应上述表格中的标签,如2.7.0。 - `{image_name}` 对应上述表格中的docker镜像名称,使用 Atlas 训练系列产品请下载 `mindspore-ascend-a1` 镜像;Atlas A2 训练系列产品请下载 `mindspore-ascend-a2` 镜像。 ## 运行MindSpore镜像 @@ -92,7 +92,7 @@ docker run -it --ipc=host \ 其中: -- `{tag}`对应上述表格中的标签,如2.7.0rc1。 +- `{tag}`对应上述表格中的标签,如2.7.0。 ## 验证是否安装成功 diff --git a/install/mindspore_ascend_install_docker_en.md b/install/mindspore_ascend_install_docker_en.md index 2db40540f2..0569f90408 100644 --- a/install/mindspore_ascend_install_docker_en.md +++ b/install/mindspore_ascend_install_docker_en.md @@ -28,7 +28,7 @@ The current support for containerized build options is as follows: | Atlas Training Series‌| `mindspore` | `mindspore-ascend-a1` | `x.y.z` | The production environment of MindSpore Ascend x.y.z together with the corresponding version of Ascend Data Center Solution. | | Atlas A2 Training Series‌| `mindspore` | `mindspore-ascend-a2` | `x.y.z` | The production environment of MindSpore Ascend x.y.z together with the corresponding version of Ascend Data Center Solution. | -> `x.y.z` corresponds to the MindSpore version number. For example, when MindSpore version 2.7.0rc1 is installed, `x.y.z` should be written as 2.7.0rc1. +> `x.y.z` corresponds to the MindSpore version number. For example, when MindSpore version 2.7.0 is installed, `x.y.z` should be written as 2.7.0. ## System Environment Information Confirmation diff --git a/install/mindspore_ascend_install_pip.md b/install/mindspore_ascend_install_pip.md index 98c3f9a9e0..ca71d93745 100644 --- a/install/mindspore_ascend_install_pip.md +++ b/install/mindspore_ascend_install_pip.md @@ -120,10 +120,10 @@ pip install /usr/local/Ascend/ascend-toolkit/latest/lib64/hccl-*-py3-none-any.wh ### 安装MindSpore -首先参考[版本列表](https://www.mindspore.cn/versions),选择想要安装的MindSpore版本,并进行SHA-256完整性校验。以2.7.0rc1版本为例,执行以下命令。 +首先参考[版本列表](https://www.mindspore.cn/versions),选择想要安装的MindSpore版本,并进行SHA-256完整性校验。以2.7.0版本为例,执行以下命令。 ```bash -export MS_VERSION=2.7.0rc1 +export MS_VERSION=2.7.0 ``` 然后根据系统架构及Python版本,执行以下命令安装MindSpore。 diff --git a/install/mindspore_ascend_install_pip_en.md b/install/mindspore_ascend_install_pip_en.md index ae48840b38..ad12a356fe 100644 --- a/install/mindspore_ascend_install_pip_en.md +++ b/install/mindspore_ascend_install_pip_en.md @@ -120,10 +120,10 @@ pip install /usr/local/Ascend/ascend-toolkit/latest/lib64/hccl-*-py3-none-any.wh ### Installing MindSpore -First, refer to [Version List](https://www.mindspore.cn/versions) to select the version of MindSpore you want to install, and perform SHA-256 integrity check. Taking version 2.7.0rc1 as an example, execute the following commands. +First, refer to [Version List](https://www.mindspore.cn/versions) to select the version of MindSpore you want to install, and perform SHA-256 integrity check. Taking version 2.7.0 as an example, execute the following commands. ```bash -export MS_VERSION=2.7.0rc1 +export MS_VERSION=2.7.0 ``` Then run the following commands to install MindSpore according to the system architecture and Python version. diff --git a/install/mindspore_cpu_install_docker.md b/install/mindspore_cpu_install_docker.md deleted file mode 100644 index ca3ecd8a80..0000000000 --- a/install/mindspore_cpu_install_docker.md +++ /dev/null @@ -1,126 +0,0 @@ -# Docker方式安装MindSpore CPU版本 - - - -- [Docker方式安装MindSpore CPU版本](#docker方式安装mindspore-cpu版本) - - [确认系统环境信息](#确认系统环境信息) - - [获取MindSpore镜像](#获取mindspore镜像) - - [运行MindSpore镜像](#运行mindspore镜像) - - [验证是否安装成功](#验证是否安装成功) - - - -[![查看源文件](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_cpu_install_docker.md) - -[Docker](https://docs.docker.com/get-docker/)是一个开源的应用容器引擎,支持将开发者的应用和依赖包打包到一个轻量级、可移植的容器中。通过使用Docker,可以实现MindSpore的快速部署,并与系统环境隔离。 - -本文档介绍如何在CPU环境的Linux系统上,使用Docker方式快速安装MindSpore。 - -MindSpore的Docker镜像托管在[Huawei SWR](https://support.huaweicloud.com/swr/index.html)上。 - -目前容器化构建选项支持情况如下: - -| 硬件平台 | Docker镜像仓库 | 标签 | 说明 | -| :----- | :------------------------ | :----------------------- | :--------------------------------------- | -| CPU | `mindspore/mindspore-cpu` | `x.y.z` | 已经预安装MindSpore `x.y.z` CPU版本的生产环境。 | -| | | `devel` | 提供开发环境从源头构建MindSpore(`CPU`后端)。安装详情请参考。 | -| | | `runtime` | 提供运行时环境,未安装MindSpore二进制包(`CPU`后端)。 | - -> `x.y.z`对应MindSpore版本号,例如安装1.1.0版本MindSpore时,`x.y.z`应写为1.1.0。 - -## 确认系统环境信息 - -- 确认安装基于x86架构的64位Linux操作系统,其中Ubuntu 18.04是经过验证的。 -- 确认安装[Docker 18.03或者更高版本](https://docs.docker.com/get-docker/)。 - -## 获取MindSpore镜像 - -对于`CPU`后端,可以直接使用以下命令获取最新的稳定镜像: - -```bash -docker pull swr.cn-south-1.myhuaweicloud.com/mindspore/mindspore-cpu:{tag} -``` - -其中: - -- `{tag}`对应上述表格中的标签。 - -## 运行MindSpore镜像 - -执行以下命令启动Docker容器实例: - -```bash -docker run -it swr.cn-south-1.myhuaweicloud.com/mindspore/mindspore-cpu:{tag} /bin/bash -``` - -其中: - -- `{tag}`对应上述表格中的标签。 - -## 验证是否安装成功 - -- 如果你安装的是指定版本`x.y.z`的容器。 - - 按照上述步骤进入MindSpore容器后,测试Docker是否正常工作,请执行下面的Python代码,并检查输出: - - **方法一:** - - 执行以下命令: - - ```bash - python -c "import mindspore;mindspore.set_device(device_target='CPU');mindspore.run_check()" - ``` - - 如果输出: - - ```text - MindSpore version: 版本号 - The result of multiplication calculation is correct, MindSpore has been installed on platform [CPU] successfully! - ``` - - 至此,你已经成功通过Docker方式安装了MindSpore CPU版本。 - - **方法二:** - - 执行以下代码: - - ```python - import numpy as np - import mindspore as ms - import mindspore.ops as ops - - ms.set_context(mode=ms.PYNATIVE_MODE) - ms.set_device(device_target="CPU") - - x = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) - y = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) - print(ops.add(x, y)) - ``` - - 代码成功执行时会输出: - - ```text - [[[[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]]]] - ``` - - 至此,你已经成功通过Docker方式安装了MindSpore CPU版本。 - -- 如果你安装的是`runtime`标签的容器,需要自行安装MindSpore。 - - 进入[MindSpore安装指南页面](https://www.mindspore.cn/install),选择CPU硬件平台、Linux-x86_64操作系统和pip的安装方式,获得安装指南。运行容器后参考安装指南,通过pip方式安装MindSpore CPU版本,并进行验证。 - -- 如果你安装的是`devel`标签的容器,需要自行编译并安装MindSpore。 - - 进入[MindSpore安装指南页面](https://www.mindspore.cn/install),选择CPU硬件平台、Linux-x86_64操作系统和Source的安装方式,获得安装指南。运行容器后,下载MindSpore代码仓,并参考安装指南,通过源码编译方式安装MindSpore CPU版本,并进行验证。 - -如果您想了解更多关于MindSpore Docker镜像的构建过程,请查看[docker repo](https://gitee.com/mindspore/mindspore/blob/v2.7.0/scripts/docker/README.md#)了解详细信息。 diff --git a/install/mindspore_cpu_install_docker_en.md b/install/mindspore_cpu_install_docker_en.md deleted file mode 100644 index 13f7fda33a..0000000000 --- a/install/mindspore_cpu_install_docker_en.md +++ /dev/null @@ -1,126 +0,0 @@ -# Installing MindSpore in CPU by Docker - - - -- [Installing MindSpore in CPU by Docker](#installing-mindSpore-in-cpu-by-docker) - - [System Environment Information Confirmation](#system-environment-information-confirmation) - - [Obtaining MindSpore Image](#obtaining-mindspore-image) - - [Running MindSpore Image](#running-mindspore-image) - - [Installation Verification](#installation-verification) - - - -[![View Source On Gitee](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source_en.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_cpu_install_docker_en.md) - -[Docker](https://docs.docker.com/get-docker/) is an open source application container engine, and supports packaging developers' applications and dependency packages into a lightweight, portable container. By using Docker, MindSpore can be rapidly deployed and separated from the system environment. - -This document describes how to install MindSpore by Docker on Linux in a CPU environment. - -The Docker image of MindSpore is hosted on [Huawei SWR](https://support.huaweicloud.com/swr/index.html). - -The current support for the containerization build option is as follows: - -| Hardware | Docker Image Hub | Label | Note | -| :----- | :------------------------ | :----------------------- | :--------------------------------------- | -| CPU | `mindspore/mindspore-cpu` | `x.y.z` | A production environment with the MindSpore `x.y.z` CPU version pre-installed. | -| | | `devel` | Provide a development environment to build MindSpore from the source (`CPU` backend). For installation details, please refer to . | -| | | `runtime` | Provide runtime environment, MindSpore binary package (`CPU` backend) is not installed. | - -> `x.y.z` corresponds to the MindSpore version number. For example, when MindSpore version 1.1.0 is installed, `x.y.z` should be written as 1.1.0. - -## System Environment Information Confirmation - -- Ensure that a 64-bit Linux operating system with the x86 architecture is installed, where Ubuntu 18.04 is verified. -- Ensure that [Docker 18.03 or later versioin](https://docs.docker.com/get-docker/) is installed. - -## Obtaining MindSpore Image - -For the `CPU` backend, you can directly use the following command to obtain the latest stable image: - -```bash -docker pull swr.cn-south-1.myhuaweicloud.com/mindspore/mindspore-cpu:{tag} -``` - -of which, - -- `{tag}` corresponds to the label in the above table. - -## Running MindSpore Image - -Execute the following command to start the Docker container instance: - -```bash -docker run -it swr.cn-south-1.myhuaweicloud.com/mindspore/mindspore-cpu:{tag} /bin/bash -``` - -of which, - -- `{tag}` corresponds to the label in the above table. - -## Installation Verification - -- If you are installing the container of the specified version `x.y.z`. - - After entering the MindSpore container according to the above steps, to test whether the Docker is working properly, please run the following Python code and check the output: - - **Method 1:** - - Execute the following command: - - ```bash - python -c "import mindspore;mindspore.set_device(device_target='CPU');mindspore.run_check()" - ``` - - - The outputs should be the same as: - - ```text - MindSpore version: __version__ - The result of multiplication calculation is correct, MindSpore has been installed on platform [CPU] successfully! - ``` - - So far, it means MindSpore CPU has been installed by Docker successfully. - - **Method 2:** - - Execute the following command: - - ```python - import numpy as np - import mindspore as ms - import mindspore.ops as ops - - ms.set_context(mode=ms.PYNATIVE_MODE) - ms.set_device(device_target="CPU") - - x = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) - y = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) - print(ops.add(x, y)) - ``` - - When the code is successfully run, the outputs should be the same as: - - ```text - [[[[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]]]] - ``` - - So far, it means MindSpore CPU has been installed by Docker successfully. - -- If you install a container with the label of `runtime`, you need to install MindSpore yourself. - - Go to [MindSpore Installation Guide Page](https://www.mindspore.cn/install/en), choose the CPU hardware platform, Linux-x86_64 operating system and pip installation method to get the installation guide. Refer to the installation guide after running the container and install the MindSpore CPU version by pip, and verify it. - -- If you install a container with the label of `devel`, you need to compile and install MindSpore yourself. - - Go to [MindSpore Installation Guide Page](https://www.mindspore.cn/install/en), and choose the CPU hardware platform, Linux-x86_64 operating system and pip installation method to get the installation guide. After running the container, download the MindSpore code repository and refer to the installation guide, install the MindSpore CPU version through source code compilation, and verify it. - -If you want to know more about the MindSpore Docker image building process, please check [docker repo](https://gitee.com/mindspore/mindspore/blob/v2.7.0/scripts/docker/README.md#) for details. diff --git a/install/mindspore_cpu_install_nightly.md b/install/mindspore_cpu_install_nightly.md deleted file mode 100644 index 0c36650a0b..0000000000 --- a/install/mindspore_cpu_install_nightly.md +++ /dev/null @@ -1,147 +0,0 @@ -# pip方式安装MindSpore CPU Nightly版本 - - - -- [pip方式安装MindSpore CPU Nightly版本](#pip方式安装mindspore-cpu-nightly版本) - - [安装MindSpore与依赖软件](#安装mindspore与依赖软件) - - [安装Python](#安装python) - - [安装GCC](#安装gcc) - - [下载安装MindSpore](#下载安装mindspore) - - [验证是否成功安装](#验证是否成功安装) - - [升级MindSpore版本](#升级mindspore版本) - - - -[![查看源文件](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_cpu_install_nightly.md) - -MindSpore Nightly是包含当前最新功能与bugfix的预览版本,但是可能未经完整的测试与验证,希望体验最新功能或者问题修复的用户可以使用该版本。 - -本文档介绍如何在CPU环境的Linux系统上,使用pip方式快速安装MindSpore Nightly。 - -在确认系统环境信息的过程中,如需了解如何安装第三方依赖软件,可以参考社区提供的实践——[在Ubuntu(CPU)上进行源码编译安装MindSpore](https://www.mindspore.cn/news/newschildren?id=365)中的第三方依赖软件安装相关部分,在此感谢社区成员[damon0626](https://gitee.com/damon0626)的分享。 - -## 安装MindSpore与依赖软件 - -下表列出了安装MindSpore所需的系统环境和第三方依赖。 - -| 软件名称 | 版本 | 作用 | -| --------------------- | ---------------- | ----------------------------- | -| Ubuntu | 18.04 | 运行MindSpore的操作系统 | -| [Python](#安装python) | 3.9-3.11 | MindSpore的使用依赖Python环境 | -| [GCC](#安装gcc) | 7.3.0-9.4.0 | 用于编译MindSpore的C++编译器 | - -下面给出第三方依赖的安装方法。 - -### 安装Python - -[Python](https://www.python.org/)可通过多种方式进行安装。 - -- 通过Conda安装Python - - 安装Miniconda: - - ```bash - cd /tmp - curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-$(arch).sh - bash Miniconda3-py37_4.10.3-Linux-$(arch).sh -b - cd - - . ~/miniconda3/etc/profile.d/conda.sh - conda init bash - ``` - - 安装完成后,可以为Conda设置清华源加速下载,参考[此处](https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/)。 - - 创建虚拟环境,以Python 3.9.11为例: - - ```bash - conda create -n mindspore_py39 python=3.9.11 -y - conda activate mindspore_py9 - ``` - -- 通过APT安装Python,命令如下。 - - ```bash - sudo apt-get update - sudo apt-get install software-properties-common -y - sudo add-apt-repository ppa:deadsnakes/ppa -y - sudo apt-get install python3.9 python3.9-dev python3.9-distutils python3-pip -y - # 将新安装的Python设为默认 - sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 100 - # 安装pip - python -m pip install pip -i https://repo.huaweicloud.com/repository/pypi/simple - sudo update-alternatives --install /usr/bin/pip pip ~/.local/bin/pip3.9 100 - pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple - ``` - - 若要安装其他Python版本,只需更改命令中的`3.9`。 - -可以通过以下命令查看Python版本。 - -```bash -python --version -``` - -### 安装GCC - -可以通过以下命令安装GCC。 - -```bash -sudo apt-get install gcc-7 -y -``` - -如果要安装更高版本的GCC,使用以下命令安装GCC 8。 - -```bash -sudo apt-get install gcc-8 -y -``` - -或者安装GCC 9。 - -```bash -sudo apt-get install software-properties-common -y -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -sudo apt-get update -sudo apt-get install gcc-9 -y -``` - -## 下载安装MindSpore - -执行以下命令安装MindSpore: - -```bash -pip install mindspore-dev -i https://repo.huaweicloud.com/repository/pypi/simple/ -``` - -其中: - -- 在联网状态下,安装whl包时会自动下载mindspore安装包的依赖项(依赖项详情参见[setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)中的required_package),其余情况需自行安装依赖。 -- pip会自动安装当前最新版本的MindSpore Nightly版本,如果需要安装指定版本,请参照下方升级MindSpore版本相关指导,在下载时手动指定版本。 - -## 验证是否成功安装 - -执行以下命令: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='CPU');mindspore.run_check()" -``` - -如果输出: - -```text -MindSpore version: 版本号 -The result of multiplication calculation is correct, MindSpore has been installed on platform [CPU] successfully! -``` - -说明MindSpore安装成功了。 - -## 升级MindSpore版本 - -当需要升级MindSpore版本时,可执行如下命令: - -```bash -pip install --upgrade mindspore-dev=={version} -``` - -其中: - -- 升级到rc版本时,需要手动指定`{version}`为rc版本号,例如1.6.0rc1.dev20211125;如果希望自动升级到最新版本,`=={version}`字段可以缺省。 diff --git a/install/mindspore_cpu_install_nightly_en.md b/install/mindspore_cpu_install_nightly_en.md deleted file mode 100644 index 43505c09a3..0000000000 --- a/install/mindspore_cpu_install_nightly_en.md +++ /dev/null @@ -1,147 +0,0 @@ -# Installing MindSpore CPU Nightly by pip - - - -- [Installing MindSpore CPU Nightly by pip](#installing-mindspore-cpu-nightly-by-pip) - - [Installing MindSpore and dependencies](#installing-mindspore-and-dependencies) - - [Installing Python](#installing-python) - - [Installing GCC](#installing-gcc) - - [Downloading and Installing MindSpore](#downloading-and-installing-mindspore) - - [Installation Verification](#installation-verification) - - [Version Update](#version-update) - - - -[![View Source On Gitee](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source_en.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_cpu_install_nightly_en.md) - -MindSpore Nightly is a preview version which includes latest features and bugfixes, not fully supported and tested. Install MindSpore Nightly version if you wish to try out the latest features or bug fixes can use this version. - -This document describes how to install MindSpore Nightly by pip on Linux in a CPU environment. - -In the process of confirming the system environment information, if you need to know how to install third-party dependent software, you can refer to the practice provided by the community - [Source code compilation and installation on Ubuntu (CPU) MindSpore](https://www.mindspore.cn/news/newschildren?id=365) in the third-party dependent software installation related section, hereby thank the community members [damon0626]( https://gitee.com/damon0626) sharing. - -## Installing MindSpore and dependencies - -The following table lists the system environment and third-party dependencies required to install MindSpore. - -| software | version | description | -| ------------------------------ | ----------- | ------------------------------------------------------- | -| Ubuntu | 18.04 | OS for running MindSpore | -| [Python](#installing-python) | 3.9-3.11 | Python environment that MindSpore depends | -| [GCC](#installing-gcc) | 7.3.0-9.4.0 | C++ compiler for compiling MindSpore | - -The following describes how to install the third-party dependencies. - -### Installing Python - -[Python](https://www.python.org/) can be installed in multiple ways. - -- Install Python with Conda. - - Install Miniconda: - - ```bash - cd /tmp - curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-$(arch).sh - bash Miniconda3-py37_4.10.3-Linux-$(arch).sh -b - cd - - . ~/miniconda3/etc/profile.d/conda.sh - conda init bash - ``` - - After the installation is complete, you can set up Tsinghua source acceleration download for Conda, and see [here](https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/). - - Create a virtual environment, taking Python 3.9.11 as an example: - - ```bash - conda create -n mindspore_py39 python=3.9.11 -y - conda activate mindspore_py39 - ``` - -- Or install Python via APT with the following command. - - ```bash - sudo apt-get update - sudo apt-get install software-properties-common -y - sudo add-apt-repository ppa:deadsnakes/ppa -y - sudo apt-get install python3.9 python3.9-dev python3.9-distutils python3-pip -y - # set new installed Python as default - sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 100 - # install pip - python -m pip install pip -i https://repo.huaweicloud.com/repository/pypi/simple - sudo update-alternatives --install /usr/bin/pip pip ~/.local/bin/pip3.9 100 - pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple - ``` - - To install other Python versions, just change `3.9` in the command. - -Run the following command to check the Python version. - -```bash -python --version -``` - -### Installing GCC - -Run the following commands to install GCC. - -```bash -sudo apt-get install gcc-7 -y -``` - -To install a later version of GCC, run the following command to install GCC 8. - -```bash -sudo apt-get install gcc-8 -y -``` - -Or install GCC 9. - -```bash -sudo apt-get install software-properties-common -y -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -sudo apt-get update -sudo apt-get install gcc-9 -y -``` - -## Downloading and Installing MindSpore - -Execute the following command to install MindSpore: - -```bash -pip install mindspore-dev -i https://repo.huaweicloud.com/repository/pypi/simple/ -``` - -Of which, - -- When the network is connected, dependencies are automatically downloaded during .whl package installation. (For details about the dependencies, see required_package in [setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)). In other cases, you need to install dependencies by yourself. -- pip will be installing the latest version of MindSpore Nightly automatically. If you wish to specify the version to be installed, please refer to the instruction below regarding to version update, and specify version manually. - -## Installation Verification - -Execute the following command: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='CPU');mindspore.run_check()" -``` - -The outputs should be the same as: - -```text -MindSpore version: __version__ -The result of multiplication calculation is correct, MindSpore has been installed on platform [CPU] successfully! -``` - -It means MindSpore has been installed successfully. - -## Version Update - -Using the following command if you need to update the MindSpore version: - -```bash -pip install --upgrade mindspore-dev=={version} -``` - -Of which, - -- When updating to a release candidate (RC) version, set `{version}` to the RC version number, for example, 2.0.0.rc1. When updating to a stable release, you can remove `=={version}`. diff --git a/install/mindspore_cpu_install_pip.md b/install/mindspore_cpu_install_pip.md index b7bef7d870..73e480389f 100644 --- a/install/mindspore_cpu_install_pip.md +++ b/install/mindspore_cpu_install_pip.md @@ -83,10 +83,10 @@ sudo apt-get install gcc-9 -y ### 安装MindSpore -首先参考[版本列表](https://www.mindspore.cn/versions),选择想要安装的MindSpore版本,并进行SHA-256完整性校验。以2.7.0rc1版本为例,执行以下命令。 +首先参考[版本列表](https://www.mindspore.cn/versions),选择想要安装的MindSpore版本,并进行SHA-256完整性校验。以2.7.0版本为例,执行以下命令。 ```bash -export MS_VERSION=2.7.0rc1 +export MS_VERSION=2.7.0 ``` 然后根据系统架构及Python版本,执行以下命令安装MindSpore。 diff --git a/install/mindspore_cpu_install_pip_en.md b/install/mindspore_cpu_install_pip_en.md index 7d5483816b..635c500c6d 100644 --- a/install/mindspore_cpu_install_pip_en.md +++ b/install/mindspore_cpu_install_pip_en.md @@ -83,10 +83,10 @@ sudo apt-get install gcc-9 -y ### Installing MindSpore -First, refer to [Version List](https://www.mindspore.cn/versions) to select the version of MindSpore you want to install, and perform SHA-256 integrity check. Taking version 2.7.0rc1 as an example, execute the following commands. +First, refer to [Version List](https://www.mindspore.cn/versions) to select the version of MindSpore you want to install, and perform SHA-256 integrity check. Taking version 2.7.0 as an example, execute the following commands. ```bash -export MS_VERSION=2.7.0rc1 +export MS_VERSION=2.7.0 ``` Then run the following commands to install MindSpore according to the system architecture and Python version. diff --git a/install/mindspore_cpu_mac_install_nightly.md b/install/mindspore_cpu_mac_install_nightly.md deleted file mode 100644 index 921a44f552..0000000000 --- a/install/mindspore_cpu_mac_install_nightly.md +++ /dev/null @@ -1,90 +0,0 @@ -# pip方式安装MindSpore CPU Nightly版本-macOS - - - -- [pip方式安装MindSpore CPU Nightly版本-macOS](#pip方式安装mindspore-cpu-nightly版本-macos) - - [确认系统环境信息](#确认系统环境信息) - - [创建并进入Conda虚拟环境](#创建并进入conda虚拟环境) - - [下载安装MindSpore](#下载安装mindspore) - - [验证是否成功安装](#验证是否成功安装) - - [升级MindSpore版本](#升级mindspore版本) - - - -[![查看源文件](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_cpu_mac_install_pip.md) - -MindSpore Nightly是包含当前最新功能与bugfix的预览版本,但是可能未经完整的测试与验证,希望体验最新功能或者问题修复的用户可以使用该版本。 - -[Conda](https://docs.conda.io/en/latest/)是一个开源跨平台语言无关的包管理与环境管理系统,允许用户方便地安装不同版本的二进制软件包,以及该计算平台需要的所有库。推荐在MacOS上通过Conda使用MindSpore Nightly。 - -本文档介绍如何在macOS系统上的Conda环境中,使用pip方式快速安装MindSpore Nightly。 - -## 确认系统环境信息 - -- 根据下表中的系统及芯片情况,确定合适的Python与Conda版本,其中macOS版本及芯片信息可点击桌面左上角苹果标志->`关于本机`获悉: - - |芯片|计算架构|macOS版本|支持Python版本|支持Conda版本| - |-|-|-|-|-| - |M1|ARM|11.3|Python 3.9-3.11|Mambaforge 或 Miniforge| - |Intel|x86_64|10.15/11.3|Python 3.9-3.11|Anaconda 或 MiniConda| - -- 确认安装与当前系统及芯片型号兼容的Conda版本。 - - - 如果您喜欢Conda提供的完整能力,可以选择下载[Anaconda3](https://repo.anaconda.com/archive/)或[Mambaforge](https://github.com/conda-forge/miniforge)。 - - 如果您需要节省磁盘空间,或者喜欢自定义安装Conda软件包,可以选择下载[Miniconda3](https://repo.anaconda.com/miniconda/)或[Miniforge](https://github.com/conda-forge/miniforge)。 - -## 创建并进入Conda虚拟环境 - -根据您希望使用的Python版本,创建对应的Conda虚拟环境,并进入虚拟环境。 - -- 如果您希望使用Python3.9.11版本(适配64-bit macOS 10.15或11.3): - - ```bash - conda create -c conda-forge -n mindspore_py39 -c conda-forge python=3.9.11 - conda activate mindspore_py39 - ``` - -## 下载安装MindSpore - -执行以下命令安装MindSpore: - -```bash -# install prerequisites -conda install scipy -c conda-forge - -pip install mindspore-dev -i https://repo.huaweicloud.com/repository/pypi/simple/ -``` - -其中: - -- 在联网状态下,安装whl包时会自动下载mindspore安装包的依赖项(依赖项详情参见[setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)中的required_package),其余情况需自行安装依赖。 -- pip会自动安装当前最新版本的MindSpore Nightly,如果需要安装指定版本,请参照下方升级MindSpore版本相关指导,在下载时手动指定版本。 - -## 验证是否成功安装 - -执行以下命令: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='CPU');mindspore.run_check()" -``` - -如果输出: - -```text -MindSpore version: 版本号 -The result of multiplication calculation is correct, MindSpore has been installed on platform [CPU] successfully! -``` - -说明MindSpore安装成功了。 - -## 升级MindSpore版本 - -当需要升级MindSpore版本时,可执行以下命令: - -```bash -pip install --upgrade mindspore-dev=={version} -``` - -其中: - -- 升级到rc版本时,需要手动指定`{version}`为rc版本号,例如1.5.0rc1;如果升级到正式版本,`=={version}`字段可以缺省。 diff --git a/install/mindspore_cpu_mac_install_nightly_en.md b/install/mindspore_cpu_mac_install_nightly_en.md deleted file mode 100644 index b56076e1f7..0000000000 --- a/install/mindspore_cpu_mac_install_nightly_en.md +++ /dev/null @@ -1,90 +0,0 @@ -# Installing MindSpore CPU Nightly by pip-macOS - - - -- [Installing MindSpore CPU Nightly by pip-macOS](#installing-mindspore-cpu-nightly-by-pip-macos) - - [System Environment Information Confirmation](#system-environment-information-confirmation) - - [Creating and Accessing the Conda Virtual Environment](#creating-and-accessing-the-conda-virtual-environment) - - [Downloading and Installing MindSpore](#downloading-and-installing-mindspore) - - [Installation Verification](#installation-verification) - - [Version Update](#version-update) - - - -[![View Source On Gitee](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source_en.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_cpu_mac_install_pip_en.md) - -MindSpore Nightly is a preview version which includes latest features and bugfixes, not fully supported and tested. Install MindSpore Nightly version if you wish to try out the latest features or bug fixes can use this version. - -[Conda](https://docs.conda.io/en/latest/) is an open-source, cross-platform, language-agnostic package manager and environment management system. It allows users to easily install different versions of binary software packages and any required libraries appropriate for their computing platform. - -This document describes how to install MindSpore Nightly by pip in a macOS system with Conda installed. - -## System Environment Information Confirmation - -- According to the system and chip situation in the table below, determine the appropriate Python and Conda versions, and for the macOS version and chip information, click on the Apple logo in the upper left corner of the desktop - > `About this mac`: - - |Chip|Architecture|macOS Version|Supported Python Version|Supported Conda Version| - |-|-|-|-|-| - |M1|ARM|11.3|Python 3.9-3.11|Mambaforge or Miniforge| - |Intel|x86_64|10.15/11.3|Python 3.9-3.11|Anaconda or Miniconda| - -- Ensure that the Conda version is compatible with the current system and chip. - - - If you prefer the complete capabilities provided by Conda, you may download [Anaconda3](https://repo.anaconda.com/archive/) or [Mambaforge](https://github.com/conda-forge/miniforge). - - If you want to save disk space or prefer customizing Conda installation package, you may download [Miniconda3](https://repo.anaconda.com/miniconda/) or [Miniforge](https://github.com/conda-forge/miniforge). - -## Creating and Accessing the Conda Virtual Environment - -Create a Conda virtual environment based on the Python version you want to use and go to the virtual environment. - -- If you want to use Python 3.9.11 (for 64-bit macOS 10.15 and 11.3): - - ```bash - conda create -c conda-forge -n mindspore_py39 -c conda-forge python=3.9.11 - conda activate mindspore_py39 - ``` - -## Downloading and Installing MindSpore - -Execute the following command to install MindSpore: - -```bash -# install prerequisites -conda install scipy -c conda-forge - -pip install mindspore-dev -i https://repo.huaweicloud.com/repository/pypi/simple/ -``` - -Of which, - -- When the network is connected, dependencies are automatically downloaded during .whl package installation. (For details about the dependencies, see required_package in [setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)). In other cases, you need to install dependencies by yourself. -- pip will be installing the latest version of MindSpore Nightly automatically. If you wish to specify the version to be installed, please refer to the instruction below regarding to version update, and specify version manually. - -## Installation Verification - -Execute the following command: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='CPU');mindspore.run_check()" -``` - -The outputs should be the same as: - -```text -MindSpore version: __version__ -The result of multiplication calculation is correct, MindSpore has been installed on platform [CPU] successfully! -``` - -It means MindSpore has been installed successfully. - -## Version Update - -Use the following command if you need to update the MindSpore version: - -```bash -pip install --upgrade mindspore-dev=={version} -``` - -Of which, - -- When updating to a release candidate (RC) version, set `{version}` to the RC version number, for example, 2.0.0.rc1. When updating to a stable release, you can remove `=={version}`. diff --git a/install/mindspore_cpu_mac_install_pip.md b/install/mindspore_cpu_mac_install_pip.md index e9b9b0f71f..baa3b05113 100644 --- a/install/mindspore_cpu_mac_install_pip.md +++ b/install/mindspore_cpu_mac_install_pip.md @@ -44,10 +44,10 @@ ## 安装MindSpore -首先参考[版本列表](https://www.mindspore.cn/versions)选择想要安装的MindSpore版本,并进行SHA-256完整性校验。以2.7.0rc1版本为例,执行以下命令。 +首先参考[版本列表](https://www.mindspore.cn/versions)选择想要安装的MindSpore版本,并进行SHA-256完整性校验。以2.7.0版本为例,执行以下命令。 ```bash -export MS_VERSION=2.7.0rc1 +export MS_VERSION=2.7.0 ``` 然后根据系统架构及Python版本,执行以下命令安装MindSpore。 diff --git a/install/mindspore_cpu_mac_install_pip_en.md b/install/mindspore_cpu_mac_install_pip_en.md index 99cb8c074e..a4d55db224 100644 --- a/install/mindspore_cpu_mac_install_pip_en.md +++ b/install/mindspore_cpu_mac_install_pip_en.md @@ -44,10 +44,10 @@ Create a Conda virtual environment based on the Python version you want to use a ## Installing MindSpore -First, refer to [Version List](https://www.mindspore.cn/versions) to select the version of MindSpore you want to install, and perform SHA-256 integrity check. Taking version 2.7.0rc1 as an example, execute the following commands. +First, refer to [Version List](https://www.mindspore.cn/versions) to select the version of MindSpore you want to install, and perform SHA-256 integrity check. Taking version 2.7.0 as an example, execute the following commands. ```bash -export MS_VERSION=2.7.0rc1 +export MS_VERSION=2.7.0 ``` Then run the following commands to install MindSpore according to the system architecture and Python version. diff --git a/install/mindspore_cpu_win_install_nightly.md b/install/mindspore_cpu_win_install_nightly.md deleted file mode 100644 index 4b4a460e94..0000000000 --- a/install/mindspore_cpu_win_install_nightly.md +++ /dev/null @@ -1,64 +0,0 @@ -# pip方式安装MindSpore CPU Nightly版本-Windows - - - -- [pip方式安装MindSpore CPU Nightly版本-Windows](#pip方式安装mindspore-cpu-nightly版本-windows) - - [确认系统环境信息](#确认系统环境信息) - - [下载安装MindSpore](#下载安装mindspore) - - [验证是否成功安装](#验证是否成功安装) - - [升级MindSpore版本](#升级mindspore版本) - - - -[![查看源文件](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_cpu_win_install_nightly.md) - -MindSpore Nightly是包含当前最新功能与bugfix的预览版本,但是可能未经完整的测试与验证,希望体验最新功能或者问题修复的用户可以使用该版本。 - -本文档介绍如何在CPU环境的Windows系统上,使用pip方式快速安装MindSpore Nightly。 - -## 确认系统环境信息 - -- 确认安装Windows 10是x86架构64位操作系统。 -- 确认安装Python(>=3.9.0)。可以从[Python官网](https://www.python.org/downloads/windows/)或者[华为云](https://repo.huaweicloud.com/python/)选择合适的版本进行安装。 - -## 下载安装MindSpore - -执行以下命令安装MindSpore: - -```bash -pip install mindspore-dev -i https://repo.huaweicloud.com/repository/pypi/simple/ -``` - -其中: - -- 在联网状态下,安装whl包时会自动下载mindspore安装包的依赖项(依赖项详情参见[setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)中的required_package),其余情况需自行安装依赖。 -- pip会自动安装当前最新版本的MindSpore Nightly,如果需要安装指定版本,请参照下方升级MindSpore版本相关指导,在下载时手动指定版本。 - -## 验证是否成功安装 - -执行以下命令: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='CPU');mindspore.run_check()" -``` - -如果输出: - -```text -MindSpore version: 版本号 -The result of multiplication calculation is correct, MindSpore has been installed on platform [CPU] successfully! -``` - -说明MindSpore安装成功了。 - -## 升级MindSpore版本 - -当需要升级MindSpore版本时,可执行以下命令: - -```bash -pip install --upgrade mindspore-dev=={version} -``` - -其中: - -- 升级到rc版本时,需要手动指定`{version}`为rc版本号,例如1.6.0rc1.dev20211125;如果希望自动升级到最新版本,`=={version}`字段可以缺省。 diff --git a/install/mindspore_cpu_win_install_nightly_en.md b/install/mindspore_cpu_win_install_nightly_en.md deleted file mode 100644 index 8ddff4a38d..0000000000 --- a/install/mindspore_cpu_win_install_nightly_en.md +++ /dev/null @@ -1,64 +0,0 @@ -# Installing MindSpore CPU Nightly by pip-Windows - - - -- [Installing MindSpore CPU Nightly by pip-Windows](#installing-mindspore-cpu-nightly-by-pip-windows) - - [System Environment Information Confirmation](#system-environment-information-confirmation) - - [Installing MindSpore](#installing-mindspore) - - [Installation Verification](#installation-verification) - - [Version Update](#version-update) - - - -[![View Source On Gitee](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source_en.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_cpu_win_install_nightly_en.md) - -MindSpore Nightly is a preview version which includes latest features and bugfixes, not fully supported and tested. Install MindSpore Nightly version if you wish to try out the latest changes on MindSpore. - -This document describes how to install MindSpore Nightly by pip on Linux in a CPU environment. - -## System Environment Information Confirmation - -- Ensure that Windows 10 is installed with the x86 architecture 64-bit operating system. -- Ensure that you have Python(>=3.9.0) installed. If not installed, follow the links to [Python official website](https://www.python.org/downloads/windows/) or [Huawei Cloud](https://repo.huaweicloud.com/python/) to download and install Python. - -## Installing MindSpore - -Execute the following command to install MindSpore: - -```bash -pip install mindspore-dev -i https://repo.huaweicloud.com/repository/pypi/simple/ -``` - -Of which, - -- When the network is connected, dependency items are automatically downloaded during .whl package installation. (For details about the dependency, see required_package in [setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)). In other cases, you need to install dependency by yourself. -- pip will be installing the latest version of MindSpore Nightly automatically. If you wish to specify the version to be installed, please refer to the instruction below regarding to version update, and specify version manually. - -## Installation Verification - -Execute the following command: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='CPU');mindspore.run_check()" -``` - -The outputs should be the same as: - -```text -MindSpore version: __version__ -The result of multiplication calculation is correct, MindSpore has been installed on platform [CPU] successfully! -``` - -It means MindSpore has been installed successfully. - -## Version Update - -Use the following command if you need to update the MindSpore version: - -```bash -pip install --upgrade mindspore-dev=={version} -``` - -Of which, - -- When updating to a release candidate (RC) version, set `{version}` to the RC version number, for example, 2.0.0.rc1. When updating to a stable release, you can remove `=={version}`. diff --git a/install/mindspore_cpu_win_install_pip.md b/install/mindspore_cpu_win_install_pip.md index 45a7626853..7f66f3fb21 100644 --- a/install/mindspore_cpu_win_install_pip.md +++ b/install/mindspore_cpu_win_install_pip.md @@ -21,10 +21,10 @@ ## 安装MindSpore -首先参考[版本列表](https://www.mindspore.cn/versions)选择想要安装的MindSpore版本,并进行SHA-256完整性校验。以2.7.0rc1版本为例,执行以下命令。 +首先参考[版本列表](https://www.mindspore.cn/versions)选择想要安装的MindSpore版本,并进行SHA-256完整性校验。以2.7.0版本为例,执行以下命令。 ```bash -set MS_VERSION=2.7.0rc1 +set MS_VERSION=2.7.0 ``` 然后根据Python版本执行以下命令安装MindSpore。 diff --git a/install/mindspore_cpu_win_install_pip_en.md b/install/mindspore_cpu_win_install_pip_en.md index 848f6fdbdf..dfefed86ea 100644 --- a/install/mindspore_cpu_win_install_pip_en.md +++ b/install/mindspore_cpu_win_install_pip_en.md @@ -21,10 +21,10 @@ This document describes how to install MindSpore by pip on Windows in a CPU envi ## Installing MindSpore -First, refer to [Version List](https://www.mindspore.cn/versions) to select the version of MindSpore you want to install, and perform SHA-256 integrity check. Taking version 2.7.0rc1 as an example, execute the following commands. +First, refer to [Version List](https://www.mindspore.cn/versions) to select the version of MindSpore you want to install, and perform SHA-256 integrity check. Taking version 2.7.0 as an example, execute the following commands. ```bash -set MS_VERSION=2.7.0rc1 +set MS_VERSION=2.7.0 ``` Then run the following commands to install MindSpore according to Python version. diff --git a/install/mindspore_gpu_install_conda.md b/install/mindspore_gpu_install_conda.md deleted file mode 100644 index 4c884b13fc..0000000000 --- a/install/mindspore_gpu_install_conda.md +++ /dev/null @@ -1,250 +0,0 @@ -# Conda方式安装MindSpore GPU版本 - - - -- [Conda方式安装MindSpore GPU版本](#conda方式安装mindspore-gpu版本) - - [安装MindSpore与依赖软件](#安装mindspore与依赖软件) - - [安装CUDA](#安装cuda) - - [安装cuDNN](#安装cudnn) - - [安装Conda](#安装conda) - - [安装GCC](#安装gcc) - - [安装TensorRT-可选](#安装tensorrt-可选) - - [创建并进入Conda虚拟环境](#创建并进入conda虚拟环境) - - [安装MindSpore](#安装mindspore) - - [验证是否成功安装](#验证是否成功安装) - - [升级MindSpore版本](#升级mindspore版本) - - - -[![查看源文件](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_gpu_install_conda.md) - -[Conda](https://docs.conda.io/en/latest/)是一个开源跨平台语言无关的包管理与环境管理系统,允许用户方便地安装不同版本的二进制软件包,以及该计算平台需要的所有库。 - -本文档介绍如何在GPU环境的Linux系统上,使用Conda方式快速安装MindSpore。下面以Ubuntu 18.04为例说明MindSpore安装步骤。 - -## 安装MindSpore与依赖软件 - -下表列出了安装MindSpore所需的系统环境和第三方依赖。 - -|软件名称|版本|作用| -|-|-|-| -|Ubuntu|18.04|运行MindSpore的操作系统| -|[CUDA](#安装cuda)|11.1或11.6|MindSpore GPU使用的并行计算架构| -|[cuDNN](#安装cudnn)|7.6.x或8.0.x或8.5.x|MindSpore GPU使用的深度神经网络加速库| -|[Conda](#安装conda)|Anaconda3或Miniconda3|Python环境管理工具| -|[GCC](#安装gcc)|7.3.0-9.4.0|用于编译MindSpore的C++编译器| -|[TensorRT](#安装tensorrt-可选)|7.2.2或8.4|MindSpore使用的高性能深度学习推理SDK(可选,Serving推理需要)| - -下面给出第三方依赖的安装方法。 - -### 安装CUDA - -MindSpore GPU支持CUDA 11.1和CUDA11.6。NVIDIA官方给出了多种安装方式和安装指导,详情可查看[CUDA下载页面](https://developer.nvidia.com/cuda-toolkit-archive)和[CUDA安装指南](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html)。 -下面仅给出Linux系统使用runfile方式安装的指导。 - -在安装CUDA前需要先安装相关依赖,执行以下命令。 - -```bash -sudo apt-get install linux-headers-$(uname -r) gcc-7 -``` - -CUDA 11.1要求最低显卡驱动版本为450.80.02;CUDA 11.6要求最低显卡驱动为510.39.01。可以执行`nvidia-smi`命令确认显卡驱动版本。如果驱动版本不满足要求,CUDA安装过程中可以选择同时安装驱动,安装驱动后需要重启系统。 - -使用以下命令安装CUDA 11.6(推荐)。 - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run -sudo sh cuda_11.6.0_510.39.01_linux.run -echo -e "export PATH=/usr/local/cuda-11.6/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -或者使用以下命令安装CUDA 11.1。 - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run -sudo sh cuda_11.1.1_455.32.00_linux.run -echo -e "export PATH=/usr/local/cuda-11.1/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -当默认路径`/usr/local/cuda`存在安装包的时候,LD_LIBRARY_PATH环境变量不起作用;原因是MindSpore采用DT_RPATH方式支持无环境变量启动,减少用户设置;DT_RPATH优先级比LD_LIBRARY_PATH环境变量高。 - -### 安装cuDNN - -完成CUDA的安装后,在[cuDNN页面](https://developer.nvidia.com/cudnn)登录并下载对应的cuDNN安装包。如果之前安装了CUDA 11.1,下载配套CUDA 11.1的cuDNN v8.0.x;如果之前安装了CUDA 11.6,下载配套CUDA 11.6的cuDNN v8.5.x。注意下载后缀名为tgz的压缩包。假设下载的cuDNN包名为`cudnn.tgz`,安装的CUDA版本为11.6,执行以下命令安装cuDNN。 - -```bash -tar -zxvf cudnn.tgz -sudo cp cuda/include/cudnn*.h /usr/local/cuda-11.6/include -sudo cp cuda/lib64/libcudnn* /usr/local/cuda-11.6/lib64 -sudo chmod a+r /usr/local/cuda-11.6/include/cudnn*.h /usr/local/cuda-11.6/lib64/libcudnn* -``` - -如果之前安装了其他CUDA版本,或者CUDA安装路径不同,只需替换以上命令中的`/usr/local/cuda-11.6`为当前安装的CUDA路径。 - -### 安装Conda - -执行以下命令安装Miniconda。 - -```bash -cd /tmp -curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-$(arch).sh -bash Miniconda3-py37_4.10.3-Linux-$(arch).sh -b -cd - -. ~/miniconda3/etc/profile.d/conda.sh -conda init bash -``` - -安装完成后,可以为Conda设置清华源加速下载,参考[此处](https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/)。 - -### 安装GCC - -可以通过以下命令安装GCC。 - -```bash -sudo apt-get install gcc-7 -y -``` - -如果要安装更高版本的GCC,使用以下命令安装GCC 8。 - -```bash -sudo apt-get install gcc-8 -y -``` - -或者安装GCC 9。 - -```bash -sudo apt-get install software-properties-common -y -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -sudo apt-get update -sudo apt-get install gcc-9 -y -``` - -### 安装TensorRT-可选 - -完成CUDA和cuDNN的安装后,在[TensorRT下载页面](https://developer.nvidia.com/nvidia-tensorrt-8x-download)下载配套CUDA 11.6的TensorRT 8.4,注意选择下载TAR格式的安装包。假设下载的文件名为`TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz`。使用以下命令安装TensorRT。 - -```bash -tar xzf TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz -cd TensorRT-8.4.1.5 -echo -e "export TENSORRT_HOME=$PWD" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=\$TENSORRT_HOME/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -cd - -``` - -### 创建并进入Conda虚拟环境 - -根据您希望使用的Python版本,创建对应的Conda虚拟环境,并进入虚拟环境。 - -如果您希望使用Python3.9.11版本,执行以下命令: - -```bash -conda create -c conda-forge -n mindspore_py39 python=3.9.11 -y -conda activate mindspore_py39 -``` - -如果希望使用其他版本Python,只需更改以上命令中的Python版本。当前支持Python 3.9、Python 3.10和Python 3.11。 - -### 安装MindSpore - -确认您处于Conda虚拟环境中,并执行以下命令安装最新版本的MindSpore。如需安装其他版本,可参考[版本列表](https://www.mindspore.cn/versions)在`conda install mindspore=`后指定版本号。 - -CUDA 11.1版本: - -```bash -conda install mindspore -c mindspore -c conda-forge -``` - -CUDA 11.6版本: - -```bash -conda install mindspore -c mindspore -c conda-forge -``` - -在联网状态下,安装MindSpore时会自动下载MindSpore安装包的依赖项(依赖项详情参见[setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)中的required_package),其余情况需自行安装依赖。 - -## 验证是否成功安装 - -运行MindSpore GPU版本前,请确保nvcc的安装路径已经添加到`PATH`与`LD_LIBRARY_PATH`环境变量中,如果没有添加,以安装在默认路径的CUDA11为例,可以执行如下操作: - -```bash -export PATH=/usr/local/cuda-11.6/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:$LD_LIBRARY_PATH -export CUDA_HOME=/usr/local/cuda-11.6 -``` - -如果之前安装了其他CUDA版本,或者CUDA安装路径不同,只需替换以上命令中的`/usr/local/cuda-11.6`为当前安装的CUDA路径。 - -**方法一:** - -执行以下命令: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='GPU');mindspore.run_check()" -``` - -如果输出: - -```text -MindSpore version: 版本号 -The result of multiplication calculation is correct, MindSpore has been installed on platform [GPU] successfully! -``` - -说明MindSpore安装成功了。 - -**方法二:** - -执行以下代码: - -```python -import numpy as np -import mindspore as ms -import mindspore.ops as ops - -ms.set_device(device_target="GPU") -x = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -y = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -print(ops.add(x, y)) -``` - -如果输出: - -```text -[[[[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]]]] -``` - -说明MindSpore安装成功了。 - -## 升级MindSpore版本 - -从MindSpore 1.x升级到MindSpore 2.x版本时,需要先手动卸载旧版本: - -```bash -conda remove mindspore-gpu -``` - -然后安装新版本: - -```bash -conda install mindspore -c mindspore -c conda-forge -``` - -从MindSpore 2.x版本升级时,执行以下命令: - -```bash -conda update mindspore -c mindspore -c conda-forge -``` diff --git a/install/mindspore_gpu_install_conda_en.md b/install/mindspore_gpu_install_conda_en.md deleted file mode 100644 index a5adca9f4b..0000000000 --- a/install/mindspore_gpu_install_conda_en.md +++ /dev/null @@ -1,250 +0,0 @@ -# Installing MindSpore GPU by Conda - - - -- [Installing MindSpore GPU by Conda](#installing-mindspore-gpu-by-conda) - - [Installing MindSpore and dependencies](#installing-mindspore-and-dependencies) - - [Installing CUDA](#installing-cuda) - - [Installing cuDNN](#installing-cudnn) - - [Installing Conda](#installing-conda) - - [Installing GCC](#installing-gcc) - - [Installing TensorRT-optional](#installing-tensorrt-optional) - - [Creating and Accessing the Conda Virtual Environment](#creating-and-accessing-the-conda-virtual-environment) - - [Installing MindSpore](#installing-mindspore) - - [Installation Verification](#installation-verification) - - [Version Update](#version-update) - - - -[![View Source On Gitee](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source_en.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_gpu_install_conda_en.md) - -[Conda](https://docs.conda.io/en/latest/) is an open-source, cross-platform, language-agnostic package manager and environment management system. It allows users to easily install different versions of binary software packages and any required libraries appropriate for their computing platform. - -This document describes how to install MindSpore by Conda on Linux in a GPU environment. The following takes Ubuntu 18.04 as an example to describe how to install MindSpore. - -## Installing MindSpore and dependencies - -The following table lists the system environment and third-party dependencies required to install MindSpore. - -|Software|Version|Description| -|-|-|-| -|Ubuntu|18.04|OS for running MindSpore| -|[CUDA](#installing-cuda)|11.1 or 11.6|parallel computing architecture for MindSpore GPU| -|[cuDNN](#installing-cudnn)|7.6.x or 8.0.x or 8.5.x|deep neural network acceleration library used by MindSpore GPU| -|[Conda](#installing-conda)|Anaconda3 or Miniconda3|Python environment management tool| -|[GCC](#installing-gcc)|7.3.0-9.4.0|C++ compiler for compiling MindSpore| -|[TensorRT](#installing-tensorrt-optional)|7.2.2 or 8.4|high performance deep learning inference SDK used by MindSpore(optional, required for serving inference)| - -The following describes how to install the third-party dependencies. - -### Installing CUDA - -MindSpore GPU supports CUDA 11.1 and CUDA 11.6. NVIDIA officially shows a variety of installation methods. For details, please refer to [CUDA download page](https://developer.nvidia.com/cuda-toolkit-archive) and [CUDA installation guide](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html). -The following only shows instructions for installing by runfile on Linux systems. - -Before installing CUDA, you need to run the following commands to install related dependencies. - -```bash -sudo apt-get install linux-headers-$(uname -r) gcc-7 -``` - -The minimum required GPU driver version of CUDA 11.1 is 450.80.02. The minimum required GPU driver version of CUDA 11.6 is 510.39.01. You may run `nvidia-smi` command to confirm the GPU driver version. If the driver version does not meet the requirements, you should choose to install the driver during the CUDA installation. After installing the driver, you need to reboot your system. - -Run the following command to install CUDA 11.6 (recommended). - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run -sudo sh cuda_11.6.0_510.39.01_linux.run -echo -e "export PATH=/usr/local/cuda-11.6/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -Or install CUDA 11.1 with the following command. - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run -sudo sh cuda_11.1.1_455.32.00_linux.run -echo -e "export PATH=/usr/local/cuda-11.1/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -When the default path `/usr/local/cuda` has an installation package, the LD_LIBRARY_PATH environment variable does not work. The reason is that MindSpore uses DT_RPATH to support startup without environment variables, reducing user settings. DT_RPATH has a higher priority than the LD_LIBRARY_PATH environment variable. - -### Installing cuDNN - -After completing the installation of CUDA, Log in and download the corresponding cuDNN installation package from [cuDNN page](https://developer.nvidia.com/cudnn). If CUDA 11.1 was previously installed, download cuDNN v8.0.x for CUDA 11.1. If CUDA 11.6 was previously installed, download cuDNN v8.5.x for CUDA 11.6. Note that download the tgz compressed file. Assuming that the downloaded cuDNN package file is named `cudnn.tgz` and the installed CUDA version is 11.6, execute the following command to install cuDNN. - -```bash -tar -zxvf cudnn.tgz -sudo cp cuda/include/cudnn*.h /usr/local/cuda-11.6/include -sudo cp cuda/lib64/libcudnn* /usr/local/cuda-11.6/lib64 -sudo chmod a+r /usr/local/cuda-11.6/include/cudnn*.h /usr/local/cuda-11.6/lib64/libcudnn* -``` - -If a different version of CUDA have been installed or the CUDA installation path is different, just replace `/usr/local/cuda-11.6` in the above command with the CUDA path currently installed. - -### Installing Conda - -Run the following command to install Miniconda. - -```bash -cd /tmp -curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-$(arch).sh -bash Miniconda3-py37_4.10.3-Linux-$(arch).sh -b -cd - -. ~/miniconda3/etc/profile.d/conda.sh -conda init bash -``` - -After the installation is complete, you can set up Tsinghua source acceleration download for Conda, and see [here](https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/). - -### Installing GCC - -Run the following commands to install GCC. - -```bash -sudo apt-get install gcc-7 -y -``` - -To install a later version of GCC, run the following command to install GCC 8. - -```bash -sudo apt-get install gcc-8 -y -``` - -Or install GCC 9. - -```bash -sudo apt-get install software-properties-common -y -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -sudo apt-get update -sudo apt-get install gcc-9 -y -``` - -### Installing TensorRT-optional - -After completing the installation of CUDA and cuDNN, download TensorRT 8.4 for CUDA 11.6 from [TensorRT download page](https://developer.nvidia.com/nvidia-tensorrt-8x-download), and note to download installation package in TAR format. Suppose the downloaded file is named `TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz`, install TensorRT with the following command. - -```bash -tar xzf TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz -cd TensorRT-8.4.1.5 -echo -e "export TENSORRT_HOME=$PWD" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=\$TENSORRT_HOME/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -cd - -``` - -### Creating and Accessing the Conda Virtual Environment - -Create a Conda virtual environment based on the Python version you want to use and go to the virtual environment. - -If you want to use Python 3.9.11, execute the following command: - -```bash -conda create -c conda-forge -n mindspore_py39 python=3.9.11 -y -conda activate mindspore_py39 -``` - -If you wish to use another version of Python, just change the Python version in the above command. Python 3.9, Python 3.10 and Python 3.11 are currently supported. - -### Installing MindSpore - -Ensure that you are in the Conda virtual environment and run the following command to install the latest MindSpore. To install other versions, please refer to the specified version number of [Version List](https://www.mindspore.cn/versions) after `conda install mindspore=`. - -For CUDA 11.1: - -```bash -conda install mindspore -c mindspore -c conda-forge -``` - -For CUDA 11.6: - -```bash -conda install mindspore -c mindspore -c conda-forge -``` - -When the network is connected, dependency items are automatically downloaded during MindSpore installation. (For details about the dependency, see required_package in [setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)). In other cases, you need to install dependency by yourself. - -## Installation Verification - -Before running MindSpore GPU version, please make sure that installation path of nvcc has been added to `PATH` and `LD_LIBRARY_PATH` environment variabels. If you have not done so, please follow the example below, based on CUDA11 installed in default location: - -```bash -export PATH=/usr/local/cuda-11.6/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:$LD_LIBRARY_PATH -export CUDA_HOME=/usr/local/cuda-11.6 -``` - -If a different version of CUDA have been installed or the CUDA installation path is different, replace `/usr/local/cuda-11.6` in the above command with the currently installed CUDA path. - -**Method 1:** - -Execute the following command: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='GPU');mindspore.run_check()" -``` - -The outputs should be the same as: - -```text -MindSpore version: __version__ -The result of multiplication calculation is correct, MindSpore has been installed on platform [GPU] successfully! -``` - -It means MindSpore has been installed successfully. - -**Method 2:** - -Execute the following command: - -```python -import numpy as np -import mindspore as ms -import mindspore.ops as ops - -ms.set_device(device_target="GPU") -x = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -y = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -print(ops.add(x, y)) -``` - -The outputs should be the same as: - -```text -[[[[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]]]] -``` - -It means MindSpore has been installed successfully. - -## Version Update - -When upgrading from MindSpore 1.x to MindSpore 2.x, you need to manually uninstall the old version first: - -```bash -conda remove mindspore-gpu -``` - -Then install MindSpore 2.x: - -```bash -conda install mindspore -c mindspore -c conda-forge -``` - -When upgrading from MindSpore 2.x: - -```bash -conda update mindspore -c mindspore -c conda-forge -``` diff --git a/install/mindspore_gpu_install_nightly.md b/install/mindspore_gpu_install_nightly.md deleted file mode 100644 index d951520e7c..0000000000 --- a/install/mindspore_gpu_install_nightly.md +++ /dev/null @@ -1,270 +0,0 @@ -# pip方式安装MindSpore GPU Nightly版本 - - - -- [pip方式安装MindSpore GPU Nightly版本](#pip方式安装mindspore-gpu-nightly版本) - - [安装MindSpore与依赖软件](#安装mindspore与依赖软件) - - [安装CUDA](#安装cuda) - - [安装cuDNN](#安装cudnn) - - [安装Python](#安装python) - - [安装GCC](#安装gcc) - - [安装TensorRT-可选](#安装tensorrt-可选) - - [下载安装MindSpore](#下载安装mindspore) - - [验证是否成功安装](#验证是否成功安装) - - [升级MindSpore版本](#升级mindspore版本) - - - -[![查看源文件](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_gpu_install_pip.md) - -MindSpore Nightly是包含当前最新功能与bugfix的预览版本,但是可能未经完整的测试与验证,希望体验最新功能或者问题修复的用户可以使用该版本。 - -本文档介绍如何在GPU环境的Linux系统上,使用pip方式快速安装MindSpore Nightly。 - -在确认系统环境信息的过程中,如需了解如何安装第三方依赖软件,可以参考社区提供的实践——[在Linux上体验源码编译安装MindSpore GPU版本](https://www.mindspore.cn/news/newschildren?id=401)中的第三方依赖软件安装相关部分,在此感谢社区成员[飞翔的企鹅](https://gitee.com/zhang_yi2020)的分享。 - -## 安装MindSpore与依赖软件 - -下表列出了编译安装MindSpore GPU所需的系统环境和第三方依赖。 - -| 软件名称 | 版本 | 作用 | -| ----------------------------- | ---------------- | ------------------------------------------------------------ | -| Ubuntu | 18.04 | 编译和运行MindSpore的操作系统 | -| [CUDA](#安装cuda) | 11.1或11.6 | MindSpore GPU使用的并行计算架构 | -| [cuDNN](#安装cudnn) | 7.6.x或8.0.x或8.5.x| MindSpore GPU使用的深度神经网络加速库 | -| [Python](#安装python) | 3.9-3.11 | MindSpore的使用依赖Python环境 | -| [GCC](#安装gcc) | 7.3.0-9.4.0 | 用于编译MindSpore的C++编译器 | -| [TensorRT](#安装tensorrt-可选) | 7.2.2或8.4 | MindSpore使用的高性能深度学习推理SDK(可选,Serving推理需要) | - -下面给出第三方依赖的安装方法。 - -### 安装CUDA - -MindSpore GPU支持CUDA 11.1和CUDA 11.6。NVIDIA官方给出了多种安装方式和安装指导,详情可查看[CUDA下载页面](https://developer.nvidia.com/cuda-toolkit-archive)和[CUDA安装指南](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html)。 -下面仅给出Linux系统使用runfile方式安装的指导。 - -在安装CUDA前需要先安装相关依赖,执行以下命令。 - -```bash -sudo apt-get install linux-headers-$(uname -r) gcc-7 -``` - -CUDA 11.1要求最低显卡驱动版本为450.80.02;CUDA 11.6要求最低显卡驱动为510.39.01。可以执行`nvidia-smi`命令确认显卡驱动版本。如果驱动版本不满足要求,CUDA安装过程中可以选择同时安装驱动,安装驱动后需要重启系统。 - -使用以下命令安装CUDA 11.6(推荐)。 - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run -sudo sh cuda_11.6.0_510.39.01_linux.run -echo -e "export PATH=/usr/local/cuda-11.6/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -或者使用以下命令安装CUDA 11.1。 - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run -sudo sh cuda_11.1.1_455.32.00_linux.run -echo -e "export PATH=/usr/local/cuda-11.1/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -当默认路径`/usr/local/cuda`存在安装包的时候,LD_LIBRARY_PATH环境变量不起作用;原因是MindSpore采用DT_RPATH方式支持无环境变量启动,减少用户设置;DT_RPATH优先级比LD_LIBRARY_PATH环境变量高。 - -### 安装cuDNN - -完成CUDA的安装后,在[cuDNN页面](https://developer.nvidia.com/cudnn)登录并下载对应的cuDNN安装包。如果之前安装了CUDA 11.1,下载配套CUDA 11.1的cuDNN v8.0.x;如果之前安装了CUDA 11.6,下载配套CUDA 11.6的cuDNN v8.5.x。注意下载后缀名为tgz的压缩包。假设下载的cuDNN包名为`cudnn.tgz`,安装的CUDA版本为11.6,执行以下命令安装cuDNN。 - -```bash -tar -zxvf cudnn.tgz -sudo cp cuda/include/cudnn*.h /usr/local/cuda-11.6/include -sudo cp cuda/lib64/libcudnn* /usr/local/cuda-11.6/lib64 -sudo chmod a+r /usr/local/cuda-11.6/include/cudnn*.h /usr/local/cuda-11.6/lib64/libcudnn* -``` - -如果之前安装了其他CUDA版本,或者CUDA安装路径不同,只需替换以上命令中的`/usr/local/cuda-11.6`为当前安装的CUDA路径。 - -### 安装Python - -[Python](https://www.python.org/)可通过多种方式进行安装。 - -- 通过Conda安装Python。 - - 安装Miniconda: - - ```bash - cd /tmp - curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-$(arch).sh - bash Miniconda3-py37_4.10.3-Linux-$(arch).sh -b - cd - - . ~/miniconda3/etc/profile.d/conda.sh - conda init bash - ``` - - 安装完成后,可以为Conda设置清华源加速下载,参考[此处](https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/)。 - - 创建虚拟环境,以Python 3.9.11为例: - - ```bash - conda create -n mindspore_py39 python=3.9.11 -y - conda activate mindspore_py39 - ``` - -- 通过APT安装Python,命令如下。 - - ```bash - sudo apt-get update - sudo apt-get install software-properties-common -y - sudo add-apt-repository ppa:deadsnakes/ppa -y - sudo apt-get install python3.9 python3.9-dev python3.9-distutils python3-pip -y - # 将新安装的Python设为默认 - sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 100 - # 安装pip - python -m pip install pip -i https://repo.huaweicloud.com/repository/pypi/simple - sudo update-alternatives --install /usr/bin/pip pip ~/.local/bin/pip3.9 100 - pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple - ``` - - 若要安装其他Python版本,只需更改命令中的`3.9`。 - -可以通过以下命令查看Python版本。 - -```bash -python --version -``` - -### 安装GCC - -可以通过以下命令安装GCC。 - -```bash -sudo apt-get install gcc-7 -y -``` - -如果要安装更高版本的GCC,使用以下命令安装GCC 8。 - -```bash -sudo apt-get install gcc-8 -y -``` - -或者安装GCC 9。 - -```bash -sudo apt-get install software-properties-common -y -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -sudo apt-get update -sudo apt-get install gcc-9 -y -``` - -### 安装TensorRT-可选 - -完成CUDA和cuDNN的安装后,在[TensorRT下载页面](https://developer.nvidia.com/nvidia-tensorrt-8x-download)下载配套CUDA 11.6的TensorRT 8.4,注意选择下载TAR格式的安装包。假设下载的文件名为`TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz`。使用以下命令安装TensorRT。 - -```bash -tar xzf TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz -cd TensorRT-8.4.1.5 -echo -e "export TENSORRT_HOME=$PWD" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=\$TENSORRT_HOME/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -cd - -``` - -## 下载安装MindSpore - -```bash -pip install mindspore-dev -i https://repo.huaweicloud.com/repository/pypi/simple/ -``` - -其中: - -- MindSpore Nightly支持CUDA11.1、11.6的任意版本,启动时会根据当前环境中安装的CUDA版本自动适配。 -- 在联网状态下,安装whl包时会自动下载mindspore安装包的依赖项(依赖项详情参见[setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)中的required_package),其余情况需自行安装依赖。 -- pip会自动安装当前最新版本的MindSpore Nightly,如果需要安装指定版本,请参照下方升级MindSpore版本相关指导,在下载时手动指定版本。 - -## 验证是否成功安装 - -运行MindSpore GPU版本前,请确保nvcc的安装路径已经添加到`PATH`与`LD_LIBRARY_PATH`环境变量中,如果没有添加,以安装在默认路径的CUDA11为例,可以执行如下操作: - -```bash -export PATH=/usr/local/cuda-11.6/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:$LD_LIBRARY_PATH -export CUDA_HOME=/usr/local/cuda-11.6 -``` - -如果之前安装了其他CUDA版本,或者CUDA安装路径不同,只需替换以上命令中的`/usr/local/cuda-11.6`为当前安装的CUDA路径。 - -**方法一:** - -执行以下命令: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='GPU');mindspore.run_check()" -``` - -如果输出: - -```text -MindSpore version: 版本号 -The result of multiplication calculation is correct, MindSpore has been installed on platform [GPU] successfully! -``` - -说明MindSpore安装成功了。 - -**方法二:** - -执行以下代码: - -```python -import numpy as np -import mindspore as ms -import mindspore.ops as ops - -ms.set_device(device_target="GPU") -x = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -y = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -print(ops.add(x, y)) -``` - -如果输出: - -```text -[[[[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]]]] -``` - -说明MindSpore安装成功了。 - -## 升级MindSpore版本 - -从MindSpore 1.x升级到MindSpore 2.x版本时,需要先手动卸载旧版本: - -```bash -pip uninstall mindspore-gpu-dev -``` - -然后安装新版本: - -```bash -pip install mindspore-dev=={version} -``` - -从MindSpore 2.x版本升级时,执行以下命令: - -```bash -pip install --upgrade mindspore-dev=={version} -``` - -其中: - -- 升级到rc版本时,需要手动指定`{version}`为rc版本号,例如1.6.0rc1.dev20211125;如果希望自动升级到最新版本,`=={version}`字段可以缺省。 diff --git a/install/mindspore_gpu_install_nightly_en.md b/install/mindspore_gpu_install_nightly_en.md deleted file mode 100644 index 92f8ebf1a0..0000000000 --- a/install/mindspore_gpu_install_nightly_en.md +++ /dev/null @@ -1,270 +0,0 @@ -# Installing MindSpore GPU Nightly by pip - - - -- [Installing MindSpore GPU Nightly by pip](#installing-mindspore-gpu-nightly-by-pip) - - [Installing MindSpore and dependencies](#installing-mindspore-and-dependencies) - - [Installing CUDA](#installing-cuda) - - [Installing cuDNN](#installing-cudnn) - - [Installing Python](#installing-python) - - [Installing GCC](#installing-gcc) - - [Installing TensorRT-optional](#installing-tensorrt-optional) - - [Installing MindSpore](#installing-mindspore) - - [Installation Verification](#installation-verification) - - [Version Update](#version-update) - - - -[![View Source On Gitee](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source_en.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_gpu_install_pip_en.md) - -MindSpore Nightly is a preview version which includes latest features and bugfixes, not fully supported and tested. Install MindSpore Nightly version if you wish to try out the latest changes on MindSpore. - -This document describes how to install MindSpore Nightly by pip on Linux in a GPU environment. - -For details about how to install third-party dependency software when confirming the system environment information, see the third-party dependency software installation section in the [Experience source code compilation and install the MindSpore GPU version on Linux](https://www.mindspore.cn/news/newschildren?id=401) provided by the community. Thanks to the community member [Flying penguin](https://gitee.com/zhang_yi2020) for sharing. - -## Installing MindSpore and dependencies - -The following table lists the system environment and third-party dependencies required to install MindSpore. - -| software | version | description | -| ----------------------------------------- | -------------- | ------------------------------------------------------------ | -| Ubuntu | 18.04 | OS for compiling and running MindSpore | -| [CUDA](#installing-cuda) | 11.1 or 11.6 | parallel computing architecture for MindSpore GPU | -| [cuDNN](#installing-cudnn) | 7.6.x or 8.0.x or 8.5.x | deep neural network acceleration library used by MindSpore GPU | -| [Python](#installing-python) | 3.9-3.11 | Python environment that MindSpore depends on | -| [GCC](#installing-gcc) | 7.3.0-9.4.0 | C++ compiler for compiling MindSpore | -| [TensorRT](#installing-tensorrt-optional) | 7.2.2 or 8.4 | high performance deep learning inference SDK used by MindSpore (optional, required for serving inference) | - -The following describes how to install the third-party dependencies. - -### Installing CUDA - -MindSpore GPU supports CUDA 11.1 and CUDA 11.6. NVIDIA officially shows a variety of installation methods. For details, please refer to [CUDA download page](https://developer.nvidia.com/cuda-toolkit-archive) and [CUDA installation guide](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html). -The following only shows instructions for installing by runfile on Linux systems. - -Before installing CUDA, you need to run the following commands to install related dependencies. - -```bash -sudo apt-get install linux-headers-$(uname -r) gcc-7 -``` - -The minimum required GPU driver version of CUDA 11.1 is 450.80.02. The minimum required GPU driver version of CUDA 11.6 is 510.39.01. You may run `nvidia-smi` command to confirm the GPU driver version. If the driver version does not meet the requirements, you should choose to install the driver during the CUDA installation. After installing the driver, you need to reboot your system. - -Run the following command to install CUDA 11.6 (recommended). - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run -sudo sh cuda_11.6.0_510.39.01_linux.run -echo -e "export PATH=/usr/local/cuda-11.6/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -Or install CUDA 11.1 with the following command. - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run -sudo sh cuda_11.1.1_455.32.00_linux.run -echo -e "export PATH=/usr/local/cuda-11.1/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -When the default path `/usr/local/cuda` has an installation package, the LD_LIBRARY_PATH environment variable does not work. The reason is that MindSpore uses DT_RPATH to support startup without environment variables, reducing user settings. DT_RPATH has a higher priority than the LD_LIBRARY_PATH environment variable. - -### Installing cuDNN - -After completing the installation of CUDA, Log in and download the corresponding cuDNN installation package from [cuDNN page](https://developer.nvidia.com/cudnn). If CUDA 11.1 was previously installed, download cuDNN v8.0.x for CUDA 11.1. If CUDA 11.6 was previously installed, download cuDNN v8.5.x for CUDA 11.6. Note that download the tgz compressed file. Assuming that the downloaded cuDNN package file is named `cudnn.tgz` and the installed CUDA version is 11.6, execute the following command to install cuDNN. - -```bash -tar -zxvf cudnn.tgz -sudo cp cuda/include/cudnn*.h /usr/local/cuda-11.6/include -sudo cp cuda/lib64/libcudnn* /usr/local/cuda-11.6/lib64 -sudo chmod a+r /usr/local/cuda-11.6/include/cudnn*.h /usr/local/cuda-11.6/lib64/libcudnn* -``` - -If a different version of CUDA have been installed or the CUDA installation path is different, just replace `/usr/local/cuda-11.6` in the above command with the currently installed CUDA path. - -### Installing Python - -[Python](https://www.python.org/) can be installed in multiple ways. - -- Install Python with Conda. - - Install Miniconda: - - ```bash - cd /tmp - curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-$(arch).sh - bash Miniconda3-py37_4.10.3-Linux-$(arch).sh -b - cd - - . ~/miniconda3/etc/profile.d/conda.sh - conda init bash - ``` - - After the installation is complete, you can set up Tsinghua source acceleration download for Conda, and see [here](https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/). - - Create a virtual environment, taking Python 3.9.11 as an example: - - ```bash - conda create -n mindspore_py39 python=3.9.11 -y - conda activate mindspore_py39 - ``` - -- Or install Python via APT with the following command. - - ```bash - sudo apt-get update - sudo apt-get install software-properties-common -y - sudo add-apt-repository ppa:deadsnakes/ppa -y - sudo apt-get install python3.9 python3.9-dev python3.9-distutils python3-pip -y - # set new installed Python as default - sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 100 - # install pip - python -m pip install pip -i https://repo.huaweicloud.com/repository/pypi/simple - sudo update-alternatives --install /usr/bin/pip pip ~/.local/bin/pip3.9 100 - pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple - ``` - - To install other Python versions, just change `3.9` in the command. - -Run the following command to check the Python version. - -```bash -python --version -``` - -### Installing GCC - -Run the following commands to install GCC. - -```bash -sudo apt-get install gcc-7 -y -``` - -To install a later version of GCC, run the following command to install GCC 8. - -```bash -sudo apt-get install gcc-8 -y -``` - -Or install GCC 9. - -```bash -sudo apt-get install software-properties-common -y -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -sudo apt-get update -sudo apt-get install gcc-9 -y -``` - -### Installing TensorRT-optional - -After completing the installation of CUDA and cuDNN, download TensorRT 8.4 for CUDA 11.1 from [TensorRT download page](https://developer.nvidia.com/nvidia-tensorrt-7x-download), and note to download installation package in TAR format. Suppose the downloaded file is named `TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz`, install TensorRT with the following command. - -```bash -tar xzf TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.1.cudnn8.0.tar.gz -cd TensorRT-8.4.1.5 -echo -e "export TENSORRT_HOME=$PWD" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=\$TENSORRT_HOME/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -cd - -``` - -## Installing MindSpore - -```bash -pip install mindspore-dev -i https://repo.huaweicloud.com/repository/pypi/simple/ -``` - -Of which, - -- MindSpore Nightly supports CUDA 11.1 and 11.6, it will configure automatically according to the version of CUDA installed in your environment. -- When the network is connected, dependency items are automatically downloaded during .whl package installation. (For details about the dependency, see required_package in [setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)). In other cases, you need to install dependency by yourself. -- pip will be installing the latest version of MindSpore GPU Nightly automatically. If you wish to specify the version to be installed, please refer to the instruction below regarding to version update, and specify version manually. - -## Installation Verification - -Before running MindSpore GPU version, please make sure that installation path of nvcc has been added to `PATH` and `LD_LIBRARY_PATH` environment variabels. If you have not done so, please follow the example below, based on CUDA11 installed in default location: - -```bash -export PATH=/usr/local/cuda-11.6/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:$LD_LIBRARY_PATH -export CUDA_HOME=/usr/local/cuda-11.6 -``` - -If a different version of CUDA have been installed or the CUDA installation path is different, replace `/usr/local/cuda-11.6` in the above command with the currently installed CUDA path. - -**Method 1:** - -Execute the following command: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='GPU');mindspore.run_check()" -``` - -The outputs should be the same as: - -```text -MindSpore version: __version__ -The result of multiplication calculation is correct, MindSpore has been installed on platform [GPU] successfully! -``` - -It means MindSpore has been installed successfully. - -**Method 2:** - -Execute the following command: - -```python -import numpy as np -import mindspore as ms -import mindspore.ops as ops - -ms.set_device(device_target="GPU") -x = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -y = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -print(ops.add(x, y)) -``` - -- The outputs should be the same as: - -```text -[[[[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]]]] -``` - -It means MindSpore has been installed successfully. - -## Version Update - -When upgrading from MindSpore 1.x to MindSpore 2.x, you need to manually uninstall the old version first: - -```bash -pip uninstall mindspore-gpu-dev -``` - -Then install MindSpore 2.x: - -```bash -pip install mindspore-dev=={version} -``` - -When upgrading from MindSpore 2.x: - -```bash -pip install --upgrade mindspore-dev=={version} -``` - -Of which, - -- When updating to a release candidate (RC) version, set `{version}` to the RC version number, for example, 2.0.0.rc1. When updating to a stable release, you can remove `=={version}`. diff --git a/install/mindspore_gpu_install_pip.md b/install/mindspore_gpu_install_pip.md deleted file mode 100644 index b4ca6f52e9..0000000000 --- a/install/mindspore_gpu_install_pip.md +++ /dev/null @@ -1,277 +0,0 @@ -# pip方式安装MindSpore GPU版本 - - - -- [pip方式安装MindSpore GPU版本](#pip方式安装mindspore-gpu版本) - - [安装MindSpore与依赖软件](#安装mindspore与依赖软件) - - [安装CUDA](#安装cuda) - - [安装cuDNN](#安装cudnn) - - [安装Python](#安装python) - - [安装GCC](#安装gcc) - - [安装TensorRT-可选](#安装tensorrt-可选) - - [安装MindSpore](#安装mindspore) - - [验证是否成功安装](#验证是否成功安装) - - [升级MindSpore版本](#升级mindspore版本) - - - -[![查看源文件](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_gpu_install_pip.md) - -本文档介绍如何在GPU环境的Linux系统上,使用pip方式快速安装MindSpore。下面以Ubuntu 18.04为例说明MindSpore安装步骤。 - -## 安装MindSpore与依赖软件 - -下表列出了编译安装MindSpore GPU所需的系统环境和第三方依赖。 - -|软件名称|版本|作用| -|-|-|-| -|Ubuntu|18.04|编译和运行MindSpore的操作系统| -|[CUDA](#安装cuda)|11.1或11.6|MindSpore GPU使用的并行计算架构| -|[cuDNN](#安装cudnn)|7.6.x或8.0.x或8.5.x|MindSpore GPU使用的深度神经网络加速库| -|[Python](#安装python)|3.9-3.11|MindSpore的使用依赖Python环境| -|[GCC](#安装gcc)|7.3.0-9.4.0|用于编译MindSpore的C++编译器| -|[TensorRT](#安装tensorrt-可选)|7.2.2或8.4|MindSpore使用的高性能深度学习推理SDK(可选,Serving推理需要)| - -下面给出第三方依赖的安装方法。 - -### 安装CUDA - -MindSpore GPU支持CUDA 11.1和CUDA 11.6。NVIDIA官方给出了多种安装方式和安装指导,详情可查看[CUDA下载页面](https://developer.nvidia.com/cuda-toolkit-archive)和[CUDA安装指南](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html)。 -下面仅给出Linux系统使用runfile方式安装的指导。 - -在安装CUDA前需要先安装相关依赖,执行以下命令。 - -```bash -sudo apt-get install linux-headers-$(uname -r) gcc-7 -``` - -CUDA 11.1要求最低显卡驱动版本为450.80.02;CUDA 11.6要求最小的显卡驱动版本为510.39.01。可以执行`nvidia-smi`命令确认显卡驱动版本。如果驱动版本不满足要求,CUDA安装过程中可以选择同时安装驱动,安装驱动后需要重启系统。 - -使用以下命令安装CUDA 11.6(推荐)。 - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run -sudo sh cuda_11.6.0_510.39.01_linux.run -echo -e "export PATH=/usr/local/cuda-11.6/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -或者使用以下命令安装CUDA 11.1。 - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run -sudo sh cuda_11.1.1_455.32.00_linux.run -echo -e "export PATH=/usr/local/cuda-11.1/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -当默认路径`/usr/local/cuda`存在安装包的时候,LD_LIBRARY_PATH环境变量不起作用;原因是MindSpore采用DT_RPATH方式支持无环境变量启动,减少用户设置;DT_RPATH优先级比LD_LIBRARY_PATH环境变量高。 - -### 安装cuDNN - -完成CUDA的安装后,在[cuDNN页面](https://developer.nvidia.com/cudnn)登录并下载对应的cuDNN安装包。如果之前安装了CUDA 11.1,下载配套CUDA 11.1的cuDNN v8.0.x;如果之前安装了CUDA 11.6,下载配套CUDA 11.6的cuDNN v8.5.x。注意下载后缀名为tgz的压缩包。假设下载的cuDNN包名为`cudnn.tgz`,安装的CUDA版本为11.6,执行以下命令安装cuDNN。 - -```bash -tar -zxvf cudnn.tgz -sudo cp cuda/include/cudnn*.h /usr/local/cuda-11.6/include -sudo cp cuda/lib64/libcudnn* /usr/local/cuda-11.6/lib64 -sudo chmod a+r /usr/local/cuda-11.6/include/cudnn*.h /usr/local/cuda-11.6/lib64/libcudnn* -``` - -如果之前安装了其他CUDA版本或者CUDA安装路径不同,只需替换以上命令中的`/usr/local/cuda-11.6`为当前安装的CUDA路径。 - -### 安装Python - -[Python](https://www.python.org/)可通过多种方式进行安装。 - -- 通过Conda安装Python。 - - 安装Miniconda: - - ```bash - cd /tmp - curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-$(arch).sh - bash Miniconda3-py37_4.10.3-Linux-$(arch).sh -b - cd - - . ~/miniconda3/etc/profile.d/conda.sh - conda init bash - ``` - - 安装完成后,可以为Conda设置清华源加速下载,参考[此处](https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/)。 - - 创建虚拟环境,以Python 3.9.11为例: - - ```bash - conda create -n mindspore_py39 python=3.9.11 -y - conda activate mindspore_py39 - ``` - -- 通过APT安装Python,命令如下。 - - ```bash - sudo apt-get update - sudo apt-get install software-properties-common -y - sudo add-apt-repository ppa:deadsnakes/ppa -y - sudo apt-get install python3.9 python3.9-dev python3.9-distutils python3-pip -y - # 将新安装的Python设为默认 - sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 100 - # 安装pip - python -m pip install pip -i https://repo.huaweicloud.com/repository/pypi/simple - sudo update-alternatives --install /usr/bin/pip pip ~/.local/bin/pip3.9 100 - pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple - ``` - - 若要安装其他Python版本,只需更改命令中的`3.9`。 - -可以通过以下命令查看Python版本。 - -```bash -python --version -``` - -### 安装GCC - -可以通过以下命令安装GCC。 - -```bash -sudo apt-get install gcc-7 -y -``` - -如果要安装更高版本的GCC,使用以下命令安装GCC 8。 - -```bash -sudo apt-get install gcc-8 -y -``` - -或者安装GCC 9。 - -```bash -sudo apt-get install software-properties-common -y -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -sudo apt-get update -sudo apt-get install gcc-9 -y -``` - -### 安装TensorRT-可选 - -完成CUDA和cuDNN的安装后,在[TensorRT下载页面](https://developer.nvidia.com/nvidia-tensorrt-8x-download)下载配套CUDA 11.6的TensorRT 8.4,注意选择下载TAR格式的安装包。假设下载的文件名为`TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz`。使用以下命令安装TensorRT。 - -```bash -tar xzf TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz -cd TensorRT-7.2.2.3 -echo -e "export TENSORRT_HOME=$PWD" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=\$TENSORRT_HOME/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -cd - -``` - -### 安装MindSpore - -首先参考[版本列表](https://www.mindspore.cn/versions)选择想要安装的MindSpore版本,并进行SHA-256完整性校验。以2.7.0rc1版本为例,执行以下命令。 - -```bash -export MS_VERSION=2.7.0rc1 -``` - -然后根据CUDA版本及Python版本执行如下命令安装最新版本的MindSpore。 - -```bash -# Python3.9 -pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/${MS_VERSION}/MindSpore/unified/x86_64/mindspore-${MS_VERSION/-/}-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple/ -# Python3.10 -pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/${MS_VERSION}/MindSpore/unified/x86_64/mindspore-${MS_VERSION/-/}-cp310-cp310-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple/ -# Python3.11 -pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/${MS_VERSION}/MindSpore/unified/x86_64/mindspore-${MS_VERSION/-/}-cp311-cp311-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple/ -``` - -在联网状态下,安装MindSpore时会自动下载MindSpore安装包的依赖项(依赖项详情参见[setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)中的required_package),其余情况需自行安装依赖。 - -## 验证是否成功安装 - -运行MindSpore GPU版本前,请确保nvcc的安装路径已经添加到`PATH`与`LD_LIBRARY_PATH`环境变量中,如果没有添加,以安装在默认路径的CUDA11为例,可以执行如下操作: - -```bash -export PATH=/usr/local/cuda-11.6/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:$LD_LIBRARY_PATH -export CUDA_HOME=/usr/local/cuda-11.6 -``` - -如果之前安装了其他CUDA版本或者CUDA安装路径不同,只需替换以上命令中的`/usr/local/cuda-11.6`为当前安装的CUDA路径。 - -**方法一:** - -执行以下命令: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='GPU');mindspore.run_check()" -``` - -如果输出: - -```text -MindSpore version: 版本号 -The result of multiplication calculation is correct, MindSpore has been installed on platform [GPU] successfully! -``` - -说明MindSpore安装成功了。 - -**方法二:** - -执行以下代码: - -```python -import numpy as np -import mindspore as ms -import mindspore.ops as ops - -ms.set_device(device_target="GPU") -x = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -y = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -print(ops.add(x, y)) -``` - -如果输出: - -```text -[[[[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]]]] -``` - -说明MindSpore安装成功了。 - -## 升级MindSpore版本 - -从MindSpore 1.x升级到MindSpore 2.x版本时,需要先手动卸载旧版本: - -```bash -pip uninstall mindspore-gpu -``` - -然后安装新版本: - -```bash -pip install mindspore=={version} -``` - -从MindSpore 2.x版本升级时,执行以下命令: - -```bash -pip install --upgrade mindspore=={version} -``` - -其中: - -- 升级到rc版本时,需要手动指定`{version}`为rc版本号,例如1.6.0rc1;如果升级到正式版本,`=={version}`字段可以缺省。 - -注意:1.3.0及以上版本升级时,默认选择CUDA11版本,若仍希望使用CUDA10版本,请选择相应的完整wheel安装包。 diff --git a/install/mindspore_gpu_install_pip_en.md b/install/mindspore_gpu_install_pip_en.md deleted file mode 100644 index d702c869a3..0000000000 --- a/install/mindspore_gpu_install_pip_en.md +++ /dev/null @@ -1,277 +0,0 @@ -# Installing MindSpore in GPU by pip - - - -- [Installing MindSpore in GPU by pip](#installing-mindspore-in-gpu-by-pip) - - [Installing MindSpore and dependencies](#installing-mindspore-and-dependencies) - - [Installing CUDA](#installing-cuda) - - [Installing cuDNN](#installing-cudnn) - - [Installing Python](#installing-python) - - [Installing GCC](#installing-gcc) - - [Installing TensorRT-optional](#installing-tensorrt-optional) - - [Installing MindSpore](#installing-mindspore) - - [Installation Verification](#installation-verification) - - [Version Update](#version-update) - - - -[![View Source On Gitee](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source_en.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_gpu_install_pip_en.md) - -This document describes how to install MindSpore by pip on Linux in a GPU environment. The following takes Ubuntu 18.04 as an example to describe how to install MindSpore. - -## Installing MindSpore and dependencies - -The following table lists the system environment and third-party dependencies required to install MindSpore. - -|Software|Version|Description| -|-|-|-| -|Ubuntu|18.04|OS for compiling and running MindSpore| -|[CUDA](#installing-cuda)|11.1 or 11.6|parallel computing architecture for MindSpore GPU| -|[cuDNN](#installing-cudnn)|7.6.x or 8.0.x or 8.5.x|deep neural network acceleration library used by MindSpore GPU| -|[Python](#installing-python)|3.9-3.11|Python environment that MindSpore depends on| -|[GCC](#installing-gcc)|7.3.0-9.4.0|C++ compiler for compiling MindSpore| -|[TensorRT](#installing-tensorrt-optional)|7.2.2 or 8.4|high performance deep learning inference SDK used by MindSpore (optional, required for serving inference)| - -The following describes how to install the third-party dependencies. - -### Installing CUDA - -MindSpore GPU supports CUDA 11.1 and CUDA 11.6. NVIDIA officially shows a variety of installation methods. For details, please refer to [CUDA download page](https://developer.nvidia.com/cuda-toolkit-archive) and [CUDA installation guide](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html). -The following only shows instructions for installing by runfile on Linux systems. - -Before installing CUDA, you need to run the following commands to install related dependencies. - -```bash -sudo apt-get install linux-headers-$(uname -r) gcc-7 -``` - -The minimum required GPU driver version of CUDA 11.1 is 450.80.02. The minimum required GPU driver version of CUDA 11.6 is 510.39.01. You may run `nvidia-smi` command to confirm the GPU driver version. If the driver version does not meet the requirements, you should choose to install the driver during the CUDA installation. After installing the driver, you need to reboot your system. - -Run the following command to install CUDA 11.6 (recommended). - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run -sudo sh cuda_11.6.0_510.39.01_linux.run -echo -e "export PATH=/usr/local/cuda-11.6/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -Or install CUDA 11.1 with the following command. - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run -sudo sh cuda_11.1.1_455.32.00_linux.run -echo -e "export PATH=/usr/local/cuda-11.1/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -When the default path `/usr/local/cuda` has an installation package, the LD_LIBRARY_PATH environment variable does not work. The reason is that MindSpore uses DT_RPATH to support startup without environment variables, reducing user settings. DT_RPATH has a higher priority than the LD_LIBRARY_PATH environment variable. - -### Installing cuDNN - -After completing the installation of CUDA, Log in and download the corresponding cuDNN installation package from [cuDNN page](https://developer.nvidia.com/cudnn). If CUDA 11.1 was previously installed, download cuDNN v8.0.x for CUDA 11.1. If CUDA 11.6 was previously installed, download cuDNN v8.5.x for CUDA 11.6. Note that download the tgz compressed file. Assuming that the downloaded cuDNN package file is named `cudnn.tgz` and the installed CUDA version is 11.6, execute the following command to install cuDNN. - -```bash -tar -zxvf cudnn.tgz -sudo cp cuda/include/cudnn*.h /usr/local/cuda-11.6/include -sudo cp cuda/lib64/libcudnn* /usr/local/cuda-11.6/lib64 -sudo chmod a+r /usr/local/cuda-11.1/include/cudnn.h /usr/local/cuda-11.6/lib64/libcudnn* -``` - -If a different version of CUDA have been installed or the CUDA installation path is different, just replace `/usr/local/cuda-11.6` in the above command with the currently installed CUDA path. - -### Installing Python - -[Python](https://www.python.org/) can be installed in multiple ways. - -- Install Python with Conda. - - Install Miniconda: - - ```bash - cd /tmp - curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-$(arch).sh - bash Miniconda3-py37_4.10.3-Linux-$(arch).sh -b - cd - - . ~/miniconda3/etc/profile.d/conda.sh - conda init bash - ``` - - After the installation is complete, you can set up Tsinghua source acceleration download for Conda, and see [here](https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/). - - Create a virtual environment, taking Python 3.9.11 as an example: - - ```bash - conda create -n mindspore_py39 python=3.9.11 -y - conda activate mindspore_py39 - ``` - -- Or install Python via APT with the following command. - - ```bash - sudo apt-get update - sudo apt-get install software-properties-common -y - sudo add-apt-repository ppa:deadsnakes/ppa -y - sudo apt-get install python3.9 python3.9-dev python3.9-distutils python3-pip -y - # set new installed Python as default - sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 100 - # install pip - python -m pip install pip -i https://repo.huaweicloud.com/repository/pypi/simple - sudo update-alternatives --install /usr/bin/pip pip ~/.local/bin/pip3.9 100 - pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple - ``` - - To install other Python versions, just change `3.9` in the command. - -Run the following command to check the Python version. - -```bash -python --version -``` - -### Installing GCC - -Run the following commands to install GCC. - -```bash -sudo apt-get install gcc-7 -y -``` - -To install a later version of GCC, run the following command to install GCC 8. - -```bash -sudo apt-get install gcc-8 -y -``` - -Or install GCC 9. - -```bash -sudo apt-get install software-properties-common -y -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -sudo apt-get update -sudo apt-get install gcc-9 -y -``` - -### Installing TensorRT-optional - -After completing the installation of CUDA and cuDNN, download TensorRT 8.4 for CUDA 11.6 from [TensorRT download page](https://developer.nvidia.com/nvidia-tensorrt-8x-download), and note to download installation package in TAR format. Suppose the downloaded file is named `TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz`. Install TensorRT with the following command. - -```bash -tar xzf TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz -cd TensorRT-8.4.1.5 -echo -e "export TENSORRT_HOME=$PWD" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=\$TENSORRT_HOME/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -cd - -``` - -### Installing MindSpore - -First, refer to [Version List](https://www.mindspore.cn/versions) to select the version of MindSpore you want to install, and perform SHA-256 integrity check. Taking version 2.7.0rc1 as an example, execute the following commands. - -```bash -export MS_VERSION=2.7.0rc1 -``` - -Then install the latest version of MindSpore according to the CUDA version and Python version by following the following command. - -```bash -# Python3.9 -pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/${MS_VERSION}/MindSpore/unified/x86_64/mindspore-${MS_VERSION/-/}-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple/ -# Python3.10 -pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/${MS_VERSION}/MindSpore/unified/x86_64/mindspore-${MS_VERSION/-/}-cp310-cp310-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple/ -# Python3.11 -pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/${MS_VERSION}/MindSpore/unified/x86_64/mindspore-${MS_VERSION/-/}-cp311-cp311-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple/ -``` - -When the network is connected, dependency items are automatically downloaded during MindSpore installation. (For details about the dependency, see required_package in [setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)). In other cases, you need to install dependency by yourself. - -## Installation Verification - -Before running MindSpore GPU version, please make sure that installation path of nvcc has been added to `PATH` and `LD_LIBRARY_PATH` environment variabels. If you have not done so, please follow the example below, based on CUDA11 installed in default location: - -```bash -export PATH=/usr/local/cuda-11.6/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:$LD_LIBRARY_PATH -export CUDA_HOME=/usr/local/cuda-11.6 -``` - -If a different version of CUDA have been installed or the CUDA installation path is different, replace `/usr/local/cuda-11.6` in the above command with the currently installed CUDA path. - -**Method 1:** - -Execute the following command: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='GPU');mindspore.run_check()" -``` - -The outputs should be the same as: - -```text -MindSpore version: __version__ -The result of multiplication calculation is correct, MindSpore has been installed on platform [GPU] successfully! -``` - -It means MindSpore has been installed successfully. - -**Method 2:** - -Execute the following command: - -```python -import numpy as np -import mindspore as ms -import mindspore.ops as ops - -ms.set_device(device_target="GPU") -x = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -y = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -print(ops.add(x, y)) -``` - -The outputs should be the same as: - -```text -[[[[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]]]] -``` - -It means MindSpore has been installed successfully. - -## Version Update - -When upgrading from MindSpore 1.x to MindSpore 2.x, you need to manually uninstall the old version first: - -```bash -pip uninstall mindspore-gpu -``` - -Then install MindSpore 2.x: - -```bash -pip install mindspore=={version} -``` - -When upgrading from MindSpore 2.x: - -```bash -pip install --upgrade mindspore=={version} -``` - -Of which, - -- When updating to a release candidate (RC) version, set `{version}` to the RC version number, for example, 2.0.0.rc1. When updating to a stable release, you can remove `=={version}`. - -Note: CUDA11 version is selected by default when upgrading version 1.3.0 and above. If you still want to use CUDA10 version, please select the corresponding full wheel installation package. diff --git a/install/mindspore_gpu_install_source.md b/install/mindspore_gpu_install_source.md deleted file mode 100644 index 8768469e84..0000000000 --- a/install/mindspore_gpu_install_source.md +++ /dev/null @@ -1,334 +0,0 @@ -# 源码编译方式安装MindSpore GPU版本 - - - -- [源码编译方式安装MindSpore GPU版本](#源码编译方式安装mindspore-gpu版本) - - [安装依赖软件](#安装依赖软件) - - [安装CUDA](#安装cuda) - - [安装cuDNN](#安装cudnn) - - [安装Python](#安装python) - - [安装wheel setuptools PyYAML和Numpy](#安装wheel-setuptools-pyyaml和numpy) - - [安装GCC git等依赖](#安装gcc-git等依赖) - - [安装CMake](#安装cmake) - - [安装LLVM-可选](#安装llvm-可选) - - [安装TensorRT-可选](#安装tensorrt-可选) - - [从代码仓下载源码](#从代码仓下载源码) - - [编译MindSpore](#编译mindspore) - - [安装MindSpore](#安装mindspore) - - [验证是否成功安装](#验证是否成功安装) - - [升级MindSpore版本](#升级mindspore版本) - - - -[![查看源文件](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_gpu_install_source.md) - -本文档介绍如何在GPU环境的Linux系统上,使用源码编译方式快速安装MindSpore。下面以Ubuntu 18.04为例说明MindSpore编译安装步骤。 - -## 安装依赖软件 - -下表列出了编译安装MindSpore GPU所需的系统环境和第三方依赖。 - -|软件名称|版本|作用| -|-|-|-| -|Ubuntu|18.04|编译和运行MindSpore的操作系统| -|[CUDA](#安装cuda)|11.1或11.6|MindSpore GPU使用的并行计算架构| -|[cuDNN](#安装cudnn)|7.6.x或8.0.x或8.5.x|MindSpore GPU使用的深度神经网络加速库| -|[Python](#安装python)|3.9-3.11|MindSpore的使用依赖Python环境| -|[wheel](#安装wheel-setuptools-pyyaml和numpy)|0.32.0及以上|MindSpore使用的Python打包工具| -|[setuptools](#安装wheel-setuptools-pyyaml和numpy)|44.0及以上|MindSpore使用的Python包管理工具| -|[PyYAML](#安装wheel-setuptools-pyyaml和numpy)|6.0-6.0.2|MindSpore里的算子编译功能依赖PyYAML模块| -|[Numpy](#安装wheel-setuptools-pyyaml和numpy)|1.19.3-1.26.4|MindSpore里的Numpy相关功能依赖Numpy模块| -|[GCC](#安装gcc-git等依赖)|7.3.0-9.4.0|用于编译MindSpore的C++编译器| -|[git](#安装gcc-git等依赖)|-|MindSpore使用的源代码管理工具| -|[CMake](#安装cmake)|3.22.2及以上|编译构建MindSpore的工具| -|[Autoconf](#安装gcc-git等依赖)|2.69及以上|编译构建MindSpore的工具| -|[Libtool](#安装gcc-git等依赖)|2.4.6-29.fc30及以上|编译构建MindSpore的工具| -|[Automake](#安装gcc-git等依赖)|1.15.1及以上|编译构建MindSpore的工具| -|[Flex](#安装gcc-git等依赖)|2.5.35及以上|MindSpore使用的词法分析器| -|[tclsh](#安装gcc-git等依赖)|-|MindSpore sqlite编译依赖| -|[patch](#安装gcc-git等依赖)|2.5及以上|MindSpore使用的源代码补丁工具| -|[NUMA](#安装gcc-git等依赖)|2.0.11及以上|MindSpore使用的非一致性内存访问库| -|[LLVM](#安装llvm-可选)|12.0.1|MindSpore使用的编译器框架(可选,图算融合以及稀疏计算需要)| -|[TensorRT](#安装tensorrt-可选)|7.2.2或8.4|MindSpore使用的高性能深度学习推理SDK(可选,Serving推理需要)| - -下面给出第三方依赖的安装方法。 - -### 安装CUDA - -MindSpore GPU支持CUDA 11.1和CUDA 11.6。NVIDIA官方给出了多种安装方式和安装指导,详情可查看[CUDA下载页面](https://developer.nvidia.com/cuda-toolkit-archive)和[CUDA安装指南](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html)。 -下面仅给出Linux系统使用runfile方式安装的指导。 - -在安装CUDA前需要先安装相关依赖,执行以下命令。 - -```bash -sudo apt-get install linux-headers-$(uname -r) gcc-7 -``` - -CUDA 11.1要求最低显卡驱动版本为450.80.02;CUDA 11.6要求最低显卡驱动为510.39.01。可以执行`nvidia-smi`命令确认显卡驱动版本。如果驱动版本不满足要求,CUDA安装过程中可以选择同时安装驱动,安装驱动后需要重启系统。 - -使用以下命令安装CUDA 11.6(推荐)。 - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run -sudo sh cuda_11.6.0_510.39.01_linux.run -echo -e "export PATH=/usr/local/cuda-11.6/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -或者使用以下命令安装CUDA 11.1。 - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run -sudo sh cuda_11.1.1_455.32.00_linux.run -echo -e "export PATH=/usr/local/cuda-11.1/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -当默认路径`/usr/local/cuda`存在安装包的时候,LD_LIBRARY_PATH环境变量不起作用;原因是MindSpore采用DT_RPATH方式支持无环境变量启动,减少用户设置;DT_RPATH优先级比LD_LIBRARY_PATH环境变量高。 - -### 安装cuDNN - -完成CUDA的安装后,在[cuDNN页面](https://developer.nvidia.com/cudnn)登录并下载对应的cuDNN安装包。如果之前安装了CUDA 11.1,下载配套CUDA 11.1的cuDNN v8.0.x;如果之前安装了CUDA 11.6,下载配套CUDA 11.6的cuDNN v8.5.x。注意下载后缀名为tgz的压缩包。假设下载的cuDNN包名为`cudnn.tgz`,安装的CUDA版本为11.6,执行以下命令安装cuDNN。 - -```bash -tar -zxvf cudnn.tgz -sudo cp cuda/include/cudnn*.h /usr/local/cuda-11.6/include -sudo cp cuda/lib64/libcudnn* /usr/local/cuda-11.6/lib64 -sudo chmod a+r /usr/local/cuda-11.6/include/cudnn*.h /usr/local/cuda-11.6/lib64/libcudnn* -``` - -如果之前安装了其他CUDA版本或者CUDA安装路径不同,只需替换以上命令中的`/usr/local/cuda-11.6`为当前安装的CUDA路径。 - -### 安装Python - -[Python](https://www.python.org/)可通过多种方式进行安装。 - -- 通过Conda安装Python。 - - 安装Miniconda: - - ```bash - cd /tmp - curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-$(arch).sh - bash Miniconda3-py37_4.10.3-Linux-$(arch).sh -b - cd - - . ~/miniconda3/etc/profile.d/conda.sh - conda init bash - ``` - - 安装完成后,可以为Conda设置清华源加速下载,参考[此处](https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/)。 - - 创建虚拟环境,以Python 3.9.11为例: - - ```bash - conda create -n mindspore_py39 python=3.9.11 -y - conda activate mindspore_py39 - ``` - -- 通过APT安装Python,命令如下。 - - ```bash - sudo apt-get update - sudo apt-get install software-properties-common -y - sudo add-apt-repository ppa:deadsnakes/ppa -y - sudo apt-get install python3.9 python3.9-dev python3.9-distutils python3-pip -y - # 将新安装的Python设为默认 - sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 100 - # 安装pip - python -m pip install pip -i https://repo.huaweicloud.com/repository/pypi/simple - sudo update-alternatives --install /usr/bin/pip pip ~/.local/bin/pip3.9 100 - pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple - ``` - - 若要安装其他Python版本,只需更改命令中的`3.9`。 - -可以通过以下命令查看Python版本。 - -```bash -python --version -``` - -### 安装wheel setuptools PyYAML和Numpy - -在安装完成Python后,使用以下命令安装。 - -```bash -pip install wheel -pip install -U setuptools -pip install pyyaml -pip install "numpy>=1.19.3,<=1.26.4" -``` - -运行环境使用的Numpy版本需不小于编译环境的Numpy版本,以保证框架内Numpy相关能力的正常使用。 - -### 安装GCC git等依赖 - -可以通过以下命令安装GCC、git、Autoconf、Libtool、Automake、Flex、tclsh、patch和NUMA。 - -```bash -sudo apt-get install gcc-7 git automake autoconf libtool tcl patch libnuma-dev flex -y -``` - -如果要安装更高版本的GCC,使用以下命令安装GCC 8。 - -```bash -sudo apt-get install gcc-8 -y -``` - -或者安装GCC 9。 - -```bash -sudo apt-get install software-properties-common -y -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -sudo apt-get update -sudo apt-get install gcc-9 -y -``` - -### 安装CMake - -可以通过以下命令安装[CMake](https://cmake.org/)。 - -```bash -wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - -sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" -sudo apt-get install cmake -y -``` - -### 安装LLVM-可选 - -可以通过以下命令安装[LLVM](https://llvm.org/)。 - -```bash -wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - -sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main" -sudo apt-get update -sudo apt-get install llvm-12-dev -y -``` - -### 安装TensorRT-可选 - -完成CUDA和cuDNN的安装后,在[TensorRT下载页面](https://developer.nvidia.com/nvidia-tensorrt-8x-download)下载配套CUDA 11.6的TensorRT 8.4,注意选择下载TAR格式的安装包。假设下载的文件名为`TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz`。使用以下命令安装TensorRT。 - -```bash -tar xzf TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz -cd TensorRT-8.4.1.5 -echo -e "export TENSORRT_HOME=$PWD" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=\$TENSORRT_HOME/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -cd - -``` - -## 从代码仓下载源码 - -```bash -git clone -b v2.7.0 https://gitee.com/mindspore/mindspore.git -``` - -## 编译MindSpore - -执行编译前,请确保nvcc的安装路径已经添加到`PATH`与`LD_LIBRARY_PATH`环境变量中,如果没有添加,以安装在默认路径的CUDA11为例,可以执行如下操作: - -```bash -export PATH=/usr/local/cuda-11.6/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:$LD_LIBRARY_PATH -export CUDA_HOME=/usr/local/cuda-11.6 -``` - -如果之前安装了其他CUDA版本或者CUDA安装路径不同,只需替换以上命令中的`/usr/local/cuda-11.6`为当前安装的CUDA路径。 - -进入MindSpore根目录,然后执行编译脚本。 - -```bash -cd mindspore -bash build.sh -e gpu -S on -``` - -其中: - -- `build.sh`中默认的编译线程数为8,如果编译机性能较差可能会出现编译错误,可在执行中增加`-j{线程数}`来减少线程数量。如`bash build.sh -e gpu -j4`。 -- 默认从github下载依赖源码,当-S选项设置为`on`时,从对应的Gitee镜像下载。 -- 关于`build.sh`更多用法,请参看脚本头部的说明。 - -## 安装MindSpore - -```bash -pip install output/mindspore-*.whl -i https://repo.huaweicloud.com/repository/pypi/simple/ -``` - -在联网状态下,安装MindSpore时会自动下载MindSpore安装包的依赖项(依赖项详情参见[setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)中的required_package),其余情况需自行安装依赖。 - -## 验证是否成功安装 - -**方法一:** - -执行以下命令: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='GPU');mindspore.run_check()" -``` - -如果输出: - -```text -MindSpore version: 版本号 -The result of multiplication calculation is correct, MindSpore has been installed on platform [GPU] successfully! -``` - -说明MindSpore安装成功了。 - -**方法二:** - -执行以下代码: - -```python -import numpy as np -import mindspore as ms -import mindspore.ops as ops - -ms.set_device(device_target="GPU") -x = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -y = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -print(ops.add(x, y)) -``` - -如果输出: - -```text -[[[[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]]]] -``` - -说明MindSpore安装成功了。 - -## 升级MindSpore版本 - -在源码根目录下执行编译脚本`build.sh`成功后,在`output`目录下找到编译生成的whl安装包,然后执行以下命令进行升级。 - -从MindSpore 1.x升级到MindSpore 2.x版本时,需要先手动卸载旧版本: - -```bash -pip uninstall mindspore-gpu -``` - -然后安装新版本: - -```bash -pip install mindspore-*.whl -``` - -从MindSpore 2.x版本升级到最新版本时,执行以下命令: - - ```bash -pip install --upgrade mindspore-*.whl -``` diff --git a/install/mindspore_gpu_install_source_en.md b/install/mindspore_gpu_install_source_en.md deleted file mode 100644 index bf566b7f68..0000000000 --- a/install/mindspore_gpu_install_source_en.md +++ /dev/null @@ -1,334 +0,0 @@ -# Installing MindSpore in GPU by Source Code - - - -- [Installing MindSpore in GPU by Source Code](#installing-mindspore-in-gpu-by-source-code) - - [Installing dependencies](#installing-dependencies) - - [Installing CUDA](#installing-cuda) - - [Installing cuDNN](#installing-cudnn) - - [Installing Python](#installing-python) - - [Installing wheel setuptools PyYAML and Numpy](#installing-wheel-setuptools-pyyaml-and-numpy) - - [Installing GCC git and other dependencies](#installing-gcc-git-and-other-dependencies) - - [Installing CMake](#installing-cmake) - - [Installing LLVM-optional](#installing-llvm-optional) - - [Installing TensorRT-optional](#installing-tensorrt-optional) - - [Downloading the Source Code from the Code Repository](#downloading-the-source-code-from-the-code-repository) - - [Compiling MindSpore](#compiling-mindspore) - - [Installing MindSpore](#installing-mindspore) - - [Installation Verification](#installation-verification) - - [Version Update](#version-update) - - - -[![View Source On Gitee](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/r2.7.0/resource/_static/logo_source_en.svg)](https://gitee.com/mindspore/docs/blob/r2.7.0/install/mindspore_gpu_install_source_en.md) - -This document describes how to install MindSpore by compiling source code on Linux in a GPU environment. The following takes Ubuntu 18.04 as an example to describe how to install MindSpore. - -## Installing dependencies - -The following table lists the system environment and third-party dependencies required to compile and install MindSpore GPU. - -|Software|Version|Description| -|-|-|-| -|Ubuntu|18.04|OS for compiling and running MindSpore| -|[CUDA](#installing-cuda)|11.1 or 11.6|parallel computing architecture for MindSpore GPU| -|[cuDNN](#installing-cudnn)|7.6.x or 8.0.x or 8.5.x|deep neural network acceleration library used by MindSpore GPU| -|[Python](#installing-python)|3.9-3.11|Python environment that MindSpore depends on| -|[wheel](#installing-wheel-setuptools-pyyaml-and-numpy)|0.32.0 or later|Python packaging tool used by MindSpore| -|[setuptools](#installing-wheel-setuptools-pyyaml-and-numpy)|44.0 or later|Python package management tool used by MindSpore| -|[PyYAML](#installing-wheel-setuptools-pyyaml-and-numpy)|6.0-6.0.2|PyYAML module that operator compilation in MindSpore depends on| -|[Numpy](#installing-wheel-setuptools-pyyaml-and-numpy)|1.19.3-1.26.4|Numpy module that Numpy-related functions in MindSpore depends on| -|[GCC](#installing-gcc-git-and-other-dependencies)|7.3.0-9.4.0|C++ compiler for compiling MindSpore| -|[git](#installing-gcc-git-and-other-dependencies)|-|source code management tools used by MindSpore| -|[CMake](#installing-cmake)|3.22.2 or later|Compilation tool that builds MindSpore| -|[Autoconf](#installing-gcc-git-and-other-dependencies)|2.69 or later|Compilation tool that builds MindSpore| -|[Libtool](#installing-gcc-git-and-other-dependencies)|2.4.6-29.fc30 or later|Compilation tool that builds MindSpore| -|[Automake](#installing-gcc-git-and-other-dependencies)|1.15.1 or later|Compilation tool that builds MindSpore| -|[Flex](#installing-gcc-git-and-other-dependencies)|2.5.35 or later|lexical analyzer used by MindSpore| -|[tclsh](#installing-gcc-git-and-other-dependencies)|-|sqlite compilation dependencies for MindSpore| -|[patch](#installing-gcc-git-and-other-dependencies)|2.5 or later|source code patching tool used by MindSpore| -|[NUMA](#installing-gcc-git-and-other-dependencies)|2.0.11 or later|non-uniform memory access library used by MindSpore| -|[LLVM](#installing-llvm-optional)|12.0.1|compiler framework used by MindSpore (optional, required for graph kernel fusion and sparse computing)| -|[TensorRT](#installing-tensorrt-optional)|7.2.2 or 8.4|high performance deep learning inference SDK used by MindSpore(optional, required for serving inference)| - -The following describes how to install the third-party dependencies. - -### Installing CUDA - -MindSpore GPU supports CUDA 11.1 and CUDA 11.6. NVIDIA officially shows a variety of installation methods. For details, please refer to [CUDA download page](https://developer.nvidia.com/cuda-toolkit-archive) and [CUDA installation guide](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html). -The following only shows instructions for installing by runfile on Linux systems. - -Before installing CUDA, you need to run the following commands to install related dependencies. - -```bash -sudo apt-get install linux-headers-$(uname -r) gcc-7 -``` - -The minimum required GPU driver version of CUDA 11.1 is 450.80.02. The minimum required GPU driver version of CUDA 11.6 is 510.39.01. You may run `nvidia-smi` command to confirm the GPU driver version. If the driver version does not meet the requirements, you should choose to install the driver during the CUDA installation. After installing the driver, you need to reboot your system. - -Run the following command to install CUDA 11.6 (recommended). - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run -sudo sh cuda_11.6.0_510.39.01_linux.run -echo -e "export PATH=/usr/local/cuda-11.6/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -Or install CUDA 11.1 with the following command. - -```bash -wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run -sudo sh cuda_11.1.1_455.32.00_linux.run -echo -e "export PATH=/usr/local/cuda-11.1/bin:\$PATH" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -``` - -When the default path `/usr/local/cuda` has an installation package, the LD_LIBRARY_PATH environment variable does not work. The reason is that MindSpore uses DT_RPATH to support startup without environment variables, reducing user settings. DT_RPATH has a higher priority than the LD_LIBRARY_PATH environment variable. - -### Installing cuDNN - -After completing the installation of CUDA, Log in and download the corresponding cuDNN installation package from [cuDNN page](https://developer.nvidia.com/cudnn). If CUDA 11.1 was previously installed, download cuDNN v8.0.x for CUDA 11.1. If CUDA 11.6 was previously installed, download cuDNN v8.5.x for CUDA 11.6. Note that download the tgz compressed file. Assuming that the downloaded cuDNN package file is named `cudnn.tgz` and the installed CUDA version is 11.6, execute the following command to install cuDNN. - -```bash -tar -zxvf cudnn.tgz -sudo cp cuda/include/cudnn*.h /usr/local/cuda-11.6/include -sudo cp cuda/lib64/libcudnn* /usr/local/cuda-11.6/lib64 -sudo chmod a+r /usr/local/cuda-11.6/include/cudnn*.h /usr/local/cuda-11.6/lib64/libcudnn* -``` - -If a different version of CUDA have been installed or the CUDA installation path is different, just replace `/usr/local/cuda-11.6` in the above command with the currently installed CUDA path. - -### Installing Python - -[Python](https://www.python.org/) can be installed in several ways. - -- Install Python with Conda. - - Install Miniconda: - - ```bash - cd /tmp - curl -O https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py37_4.10.3-Linux-$(arch).sh - bash Miniconda3-py37_4.10.3-Linux-$(arch).sh -b - cd - - . ~/miniconda3/etc/profile.d/conda.sh - conda init bash - ``` - - After the installation is complete, you can set up Tsinghua source acceleration download for Conda, and see [here](https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/). - - Create a virtual environment, taking Python 3.9.11 as an example: - - ```bash - conda create -n mindspore_py39 python=3.9.11 -y - conda activate mindspore_py39 - ``` - -- Or install Python via APT with the following command. - - ```bash - sudo apt-get update - sudo apt-get install software-properties-common -y - sudo add-apt-repository ppa:deadsnakes/ppa -y - sudo apt-get install python3.9 python3.9-dev python3.9-distutils python3-pip -y - # set new installed Python as default - sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 100 - # install pip - python -m pip install pip -i https://repo.huaweicloud.com/repository/pypi/simple - sudo update-alternatives --install /usr/bin/pip pip ~/.local/bin/pip3.9 100 - pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple - ``` - - To install other Python versions, just change `3.9` in the command. - -Run the following command to check the Python version. - -```bash -python --version -``` - -### Installing wheel setuptools PyYAML and Numpy - -After installing Python, run the following command to install them. - -```bash -pip install wheel -pip install -U setuptools -pip install pyyaml -pip install "numpy>=1.19.3,<=1.26.4" -``` - -The Numpy version used in the runtime environment must be no less than the Numpy version in the compilation environment to ensure the normal use of Numpy related capabilities in the framework. - -### Installing GCC git and other dependencies - -Run the following commands to install GCC, git, Autoconf, Libtool, Automake, Flex, tclsh, patch and NUMA. - -```bash -sudo apt-get install gcc-7 git automake autoconf libtool tcl patch libnuma-dev flex -y -``` - -To install a later version of GCC, run the following command to install GCC 8. - -```bash -sudo apt-get install gcc-8 -y -``` - -Or install GCC 9. - -```bash -sudo apt-get install software-properties-common -y -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -sudo apt-get update -sudo apt-get install gcc-9 -y -``` - -### Installing CMake - -Run the following commands to install [CMake](https://cmake.org/). - -```bash -wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - -sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" -sudo apt-get install cmake -y -``` - -### Installing LLVM-optional - -Run the following commands to install [LLVM](https://llvm.org/). - -```bash -wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - -sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-12 main" -sudo apt-get update -sudo apt-get install llvm-12-dev -y -``` - -### Installing TensorRT-optional - -After completing the installation of CUDA and cuDNN, download TensorRT 8.4 for CUDA 11.6 from [TensorRT download page](https://developer.nvidia.com/nvidia-tensorrt-8x-download), and note to download installation package in TAR format. Suppose the downloaded file is named `TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz`. Install TensorRT with the following command. - -```bash -tar xzf TensorRT-8.4.1.5.Ubuntu-18.04.x86_64-gnu.cuda-11.6.cudnn8.4.tar.gz -cd TensorRT-8.4.1.5 -echo -e "export TENSORRT_HOME=$PWD" >> ~/.bashrc -echo -e "export LD_LIBRARY_PATH=\$TENSORRT_HOME/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc -source ~/.bashrc -cd - -``` - -## Downloading the Source Code from the Code Repository - -```bash -git clone -b v2.7.0 https://gitee.com/mindspore/mindspore.git -``` - -## Compiling MindSpore - -Before compiling, please make sure that installation path of nvcc has been added to `PATH` and `LD_LIBRARY_PATH` environment variabels. If you have not done so, please follow the example below, based on CUDA11 installed in default location: - -```bash -export PATH=/usr/local/cuda-11.6/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64:$LD_LIBRARY_PATH -export CUDA_HOME=/usr/local/cuda-11.6 -``` - -If a different version of CUDA have been installed or the CUDA installation path is different, replace `/usr/local/cuda-11.6` in the above command with the currently installed CUDA path. - -Go to the root directory of MindSpore, then run the build script. - -```bash -cd mindspore -bash build.sh -e gpu -S on -``` - -Where: - -- In the `build.sh` script, the default number of compilation threads is 8. If the compiler performance is poor, compilation errors may occur. You can add `-j{Number of threads}` in to script to reduce the number of threads. For example, `bash build.sh -e ascend -j4`. -- By default, the dependent source code is downloaded from github. You may set -S option to `on` to download from the corresponding Gitee image. -- For more usage of `build.sh`, please refer to the description at the head of the script. - -## Installing MindSpore - -```bash -pip install output/mindspore-*.whl -i https://repo.huaweicloud.com/repository/pypi/simple/ -``` - -When the network is connected, dependencies of MindSpore are automatically downloaded during the .whl package installation. (For details about the dependency, see required_package in [setup.py](https://gitee.com/mindspore/mindspore/blob/v2.7.0/setup.py)). In other cases, you need to install dependencies by yourself. - -## Installation Verification - -**Method 1:** - -Execute the following command: - -```bash -python -c "import mindspore;mindspore.set_device(device_target='GPU');mindspore.run_check()" -``` - -The output should be like: - -```text -MindSpore version: __version__ -The result of multiplication calculation is correct, MindSpore has been installed on platform [GPU] successfully! -``` - -It means MindSpore has been installed successfully. - -**Method 2:** - -Execute the following command: - -```python -import numpy as np -import mindspore as ms -import mindspore.ops as ops - -ms.set_device(device_target="GPU") -x = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -y = ms.Tensor(np.ones([1,3,3,4]).astype(np.float32)) -print(ops.add(x, y)) -``` - -The outputs should be the same as: - -```text -[[[[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]] - - [[2. 2. 2. 2.] - [2. 2. 2. 2.] - [2. 2. 2. 2.]]]] -``` - -It means MindSpore has been installed successfully. - -## Version Update - -After successfully executing the compile script `build.sh` in the root path of the source code, find the whl package in path `output`, and use the following command to update your version. - -When upgrading from MindSpore 1.x to MindSpore 2.x, you need to manually uninstall the old version first: - -```bash -pip uninstall mindspore-gpu -``` - -Then install MindSpore 2.x: - -```bash -pip install mindspore*.whl -``` - -When upgrading from MindSpore 2.x: - -```bash -pip install --upgrade mindspore*.whl -``` diff --git a/resource/release/release_list_en.md b/resource/release/release_list_en.md index 66701ae9d5..8df339bb2a 100644 --- a/resource/release/release_list_en.md +++ b/resource/release/release_list_en.md @@ -3,6 +3,7 @@ - [Release List](#release-list) + - [2.7.0](#270) - [2.7.0-rc1](#270-rc1) - [2.6.0](#260) - [2.6.0-rc1](#260-rc1) @@ -61,6 +62,30 @@ [![View source on Gitee](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source_en.svg)](https://gitee.com/mindspore/docs/blob/master/resource/release/release_list_en.md) +## 2.7.0 + +| Module Name | Hardware Platform | Operating System | Python Version | Download Links | SHA-256 | +|-----------|---------------|---------------|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------| +| MindSpore | Ascend
CPU | Linux-aarch64 | Python3.9 | [mindspore-2.7.0-cp39-cp39-linux_aarch64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/unified/aarch64/mindspore-2.7.0-cp39-cp39-linux_aarch64.whl) | 74020e04d8553d71c9b93b259b3d3af9a54e935ca4b4799c8c806d36be607635 | +| | | | Python3.10 | [mindspore-2.7.0-cp310-cp310-linux_aarch64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/unified/aarch64/mindspore-2.7.0-cp310-cp310-linux_aarch64.whl) | cf2cc43d73de86bc45878924c12f60865c0c06b43df76b28025ed6b27748ca0a | +| | | | Python3.11 | [mindspore-2.7.0-cp311-cp311-linux_aarch64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/unified/aarch64/mindspore-2.7.0-cp311-cp311-linux_aarch64.whl) | d4047ca0ff4bf1cce6fa6cc88044bdb598ce45f8b8fc9f51f9701dbc141aa8ff | +| | Ascend
CPU | Linux-x86_64 | Python3.9 | [mindspore-2.7.0-cp39-cp39-linux_x86_64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/unified/x86_64/mindspore-2.7.0-cp39-cp39-linux_x86_64.whl) | 281ebbcd5cfe0a5e4330f1029f067a4bce46d6a03c748d35dde9123994240a32 | +| | | | Python3.10 | [mindspore-2.7.0-cp310-cp310-linux_x86_64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/unified/x86_64/mindspore-2.7.0-cp310-cp310-linux_x86_64.whl) | 7b110af7a8321ebb331480d287b974490678be832c01d9f1036240d2099249c9 | +| | | | Python3.11 | [mindspore-2.7.0-cp311-cp311-linux_x86_64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/unified/x86_64/mindspore-2.7.0-cp311-cp311-linux_x86_64.whl) | 0051ecfc36b682df2e113b3e43c442f856509f567945d077c5728cd8e45b1f53 | +| | CPU | Windows-x64 | Python3.9 | [mindspore-2.7.0-cp39-cp39-win_amd64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/x86_64/mindspore-2.7.0-cp39-cp39-win_amd64.whl) | 64f2f42b127239d203cf4b93ef07202f02b0a185cce3f158a1ae214a4a9fb946 | +| | | | Python3.10 | [mindspore-2.7.0-cp310-cp310-win_amd64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/x86_64/mindspore-2.7.0-cp310-cp310-win_amd64.whl) | d598ce9efb88072c1ec7d3ec7c94398486c6d6f718eb607858e2345d65789669 | +| | | | Python3.11 | [mindspore-2.7.0-cp311-cp311-win_amd64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/x86_64/mindspore-2.7.0-cp311-cp311-win_amd64.whl) | de9779f037f21a1c0af544835d009d3b5c1d2cb446bde4b37388f6f027038c3b | +| | | MacOS-aarch64 | Python3.9 | [mindspore-2.7.0-cp39-cp39-macosx_11_0_arm64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/aarch64/mindspore-2.7.0-cp39-cp39-macosx_11_0_arm64.whl) | 2c187e2efd659f49afc87e6d42cc3c4ecf55c1fa4017480911a870e726bda8ba | +| | | | Python3.10 | [mindspore-2.7.0-cp310-cp310-macosx_11_0_arm64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/aarch64/mindspore-2.7.0-cp310-cp310-macosx_11_0_arm64.whl) | 1d0084245aed44be2db4960b5252f7dbd4ba0932ffcd3d3df80b71859c3a9347 | +| | | | Python3.11 | [mindspore-2.7.0-cp311-cp311-macosx_11_0_arm64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/aarch64/mindspore-2.7.0-cp311-cp311-macosx_11_0_arm64.whl) | 6be3c63c9a65b0e5fa06794f95de86ee1d7d85e8733a507ec4bc2965f1f852b8 | +| | | MacOS-x64 | Python3.9 | [mindspore-2.7.0-cp39-cp39-macosx_10_15_x86_64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/x86_64/mindspore-2.7.0-cp39-cp39-macosx_10_15_x86_64.whl) | 19a2062a033471b254c43ae48315507b2335281b507c3a8e464d83d5127b66e1 | +| | | | Python3.10 | [mindspore-2.7.0-cp310-cp310-macosx_10_15_x86_64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/x86_64/mindspore-2.7.0-cp310-cp310-macosx_10_15_x86_64.whl) | c33d010511be62dd5b8240a7f6d012c211776d0df89b4d454134ad3d304634d1 | +| | | | Python3.11 | [mindspore-2.7.0-cp311-cp311-macosx_10_15_x86_64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/x86_64/mindspore-2.7.0-cp311-cp311-macosx_10_15_x86_64.whl) | 78fca18ef9d06015a8bbf8674f0fc658403828df92e5d5fe71fae9f1984efe1a | + +| Commercial edition Installation Guide | Community edition download link (refer to commercial edition for instructions) | +|--------|------------------| +| TBD | [CANN 8.2.RC1](https://www.hiascend.com/developer/download/community/result?module=cann)
[firmware and driver](https://www.hiascend.com/hardware/firmware-drivers/community) | + ## 2.7.0-rc1 | Module Name | Hardware Platform | Operating System | Python Version | Download Links | SHA-256 | diff --git a/resource/release/release_list_zh_cn.md b/resource/release/release_list_zh_cn.md index 3c6c123301..a80313abf0 100644 --- a/resource/release/release_list_zh_cn.md +++ b/resource/release/release_list_zh_cn.md @@ -3,6 +3,7 @@ - [发布版本列表](#发布版本列表) + - [2.7.0](#270) - [2.7.0-rc1](#270-rc1) - [2.6.0](#260) - [2.6.0-rc1](#260-rc1) @@ -61,6 +62,32 @@ [![查看源文件](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg)](https://gitee.com/mindspore/docs/blob/master/resource/release/release_list_zh_cn.md) +## 2.7.0 + +| 组件 | 硬件平台 | 操作系统 | Python版本 | 链接 | SHA-256 | +|-----------|---------------|---------------|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------| +| MindSpore | Ascend
CPU | Linux-aarch64 | Python3.9 | [mindspore-2.7.0-cp39-cp39-linux_aarch64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/unified/aarch64/mindspore-2.7.0-cp39-cp39-linux_aarch64.whl) | 74020e04d8553d71c9b93b259b3d3af9a54e935ca4b4799c8c806d36be607635 | +| | | | Python3.10 | [mindspore-2.7.0-cp310-cp310-linux_aarch64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/unified/aarch64/mindspore-2.7.0-cp310-cp310-linux_aarch64.whl) | cf2cc43d73de86bc45878924c12f60865c0c06b43df76b28025ed6b27748ca0a | +| | | | Python3.11 | [mindspore-2.7.0-cp311-cp311-linux_aarch64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/unified/aarch64/mindspore-2.7.0-cp311-cp311-linux_aarch64.whl) | d4047ca0ff4bf1cce6fa6cc88044bdb598ce45f8b8fc9f51f9701dbc141aa8ff | +| | Ascend
CPU | Linux-x86_64 | Python3.9 | [mindspore-2.7.0-cp39-cp39-linux_x86_64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/unified/x86_64/mindspore-2.7.0-cp39-cp39-linux_x86_64.whl) | 281ebbcd5cfe0a5e4330f1029f067a4bce46d6a03c748d35dde9123994240a32 | +| | | | Python3.10 | [mindspore-2.7.0-cp310-cp310-linux_x86_64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/unified/x86_64/mindspore-2.7.0-cp310-cp310-linux_x86_64.whl) | 7b110af7a8321ebb331480d287b974490678be832c01d9f1036240d2099249c9 | +| | | | Python3.11 | [mindspore-2.7.0-cp311-cp311-linux_x86_64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/unified/x86_64/mindspore-2.7.0-cp311-cp311-linux_x86_64.whl) | 0051ecfc36b682df2e113b3e43c442f856509f567945d077c5728cd8e45b1f53 | +| | CPU | Windows-x64 | Python3.9 | [mindspore-2.7.0-cp39-cp39-win_amd64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/x86_64/mindspore-2.7.0-cp39-cp39-win_amd64.whl) | 64f2f42b127239d203cf4b93ef07202f02b0a185cce3f158a1ae214a4a9fb946 | +| | | | Python3.10 | [mindspore-2.7.0-cp310-cp310-win_amd64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/x86_64/mindspore-2.7.0-cp310-cp310-win_amd64.whl) | d598ce9efb88072c1ec7d3ec7c94398486c6d6f718eb607858e2345d65789669 | +| | | | Python3.11 | [mindspore-2.7.0-cp311-cp311-win_amd64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/x86_64/mindspore-2.7.0-cp311-cp311-win_amd64.whl) | de9779f037f21a1c0af544835d009d3b5c1d2cb446bde4b37388f6f027038c3b | +| | | MacOS-aarch64 | Python3.9 | [mindspore-2.7.0-cp39-cp39-macosx_11_0_arm64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/aarch64/mindspore-2.7.0-cp39-cp39-macosx_11_0_arm64.whl) | 2c187e2efd659f49afc87e6d42cc3c4ecf55c1fa4017480911a870e726bda8ba | +| | | | Python3.10 | [mindspore-2.7.0-cp310-cp310-macosx_11_0_arm64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/aarch64/mindspore-2.7.0-cp310-cp310-macosx_11_0_arm64.whl) | 1d0084245aed44be2db4960b5252f7dbd4ba0932ffcd3d3df80b71859c3a9347 | +| | | | Python3.11 | [mindspore-2.7.0-cp311-cp311-macosx_11_0_arm64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/aarch64/mindspore-2.7.0-cp311-cp311-macosx_11_0_arm64.whl) | 6be3c63c9a65b0e5fa06794f95de86ee1d7d85e8733a507ec4bc2965f1f852b8 | +| | | MacOS-x64 | Python3.9 | [mindspore-2.7.0-cp39-cp39-macosx_10_15_x86_64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/x86_64/mindspore-2.7.0-cp39-cp39-macosx_10_15_x86_64.whl) | 19a2062a033471b254c43ae48315507b2335281b507c3a8e464d83d5127b66e1 | +| | | | Python3.10 | [mindspore-2.7.0-cp310-cp310-macosx_10_15_x86_64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/x86_64/mindspore-2.7.0-cp310-cp310-macosx_10_15_x86_64.whl) | c33d010511be62dd5b8240a7f6d012c211776d0df89b4d454134ad3d304634d1 | +| | | | Python3.11 | [mindspore-2.7.0-cp311-cp311-macosx_10_15_x86_64.whl](https://ms-release.obs.cn-north-4.myhuaweicloud.com/2.7.0/MindSpore/cpu/x86_64/mindspore-2.7.0-cp311-cp311-macosx_10_15_x86_64.whl) | 78fca18ef9d06015a8bbf8674f0fc658403828df92e5d5fe71fae9f1984efe1a | + +**Ascend配套软件包** + +| 商用版安装指引文档 | 社区版下载地址(安装参考商用版) | +|--------|------------------| +| TBD | [CANN 8.2.RC1](https://www.hiascend.com/developer/download/community/result?module=cann)
[固件与驱动](https://www.hiascend.com/hardware/firmware-drivers/community) | + ## 2.7.0-rc1 | 组件 | 硬件平台 | 操作系统 | Python版本 | 链接 | SHA-256 | -- Gitee