diff --git a/_static/pytorch_actions.js b/_static/pytorch_actions.js
index de98780..6395f7b 100644
--- a/_static/pytorch_actions.js
+++ b/_static/pytorch_actions.js
@@ -44,9 +44,9 @@ $(document).ready(function () {
$.gen_content = function () {
var options = $.get_options();
+ var pytorch_version = options['pytorch'];
+ var match_versions = pytorch_versions[pytorch_version];
if (options['install_type'] == "docker") {
- var pytorch_version = options['pytorch'];
- var match_versions = pytorch_versions[pytorch_version];
var dockerCommand = `
docker run \\
--name cann_container \\
@@ -69,19 +69,19 @@ docker run \\
} else if (options['install_type'] == "pip") {
$('#codecell1').html("# install torch
");
if(options['arch'] == "aarch64")
- $('#codecell1').append("pip3 install torch==" + options['pytorch']);
+ $('#codecell1').append("pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple torch==" + options['pytorch']);
else
$('#codecell1').append("pip3 install torch=="+options['pytorch']+"+cpu --index-url https://download.pytorch.org/whl/cpu");
- $("#codecell1").append("
# install torch-npu
pip3 install torch-npu==" + options['pytorch_npu']);
+ $("#codecell1").append("
# install torch-npu
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple torch-npu==" + options['pytorch_npu']);
$('#install-pytorch-source-section').hide();
$('#install-pytorch-docker-section').hide();
$('#install-pytorch-pip-section').show();
} else {
- $("#codecell2").html("# install requirements
conda install cmake ninja
# get torch source
git clone -b "+options['pytorch']+" --recursive https://github.com/pytorch/pytorch
cd pytorch
git submodule update --init --recursive
# install torch
pip install -r requirements.txt
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-\"$(dirname $(which conda))/../\"}
python setup.py develop");
+ $("#codecell4").html("# install requirements
conda install cmake ninja git
# get torch source
git clone -b v"+options['pytorch']+" --recursive https://github.com/pytorch/pytorch
cd pytorch
git submodule sync
git submodule update --init --recursive
# install torch
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-\"$(dirname $(which conda))/../\"}
USE_CUDA=0 python setup.py develop");
- $('#codecell2').append("
# get torch-npu source
git clone https://github.com/ascend/pytorch.git -b "+options['pytorch_npu']+" --depth 1 pytorch_npu
cd pytorch_npu
#install torch-npu
bash ci/build.sh --python=$(python --version 2>&1 | awk '{print $2}' | cut -d '.' -f 1,2)");
+ $('#codecell4').append("
# get torch-npu source
git clone https://github.com/ascend/pytorch.git -b "+match_versions['npu_branch']+" --depth 1 pytorch_npu
cd pytorch_npu
# install torch-npu
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
bash ci/build.sh --python=$(python --version 2>&1 | awk '{print $2}' | cut -d '.' -f 1,2)
pip install dist/torch_npu*.whl");
$('#install-pytorch-pip-section').hide();
$('#install-pytorch-docker-section').hide();
diff --git a/sources/ascend/quick_install.rst b/sources/ascend/quick_install.rst
index 5ffe4e1..6cd03ea 100644
--- a/sources/ascend/quick_install.rst
+++ b/sources/ascend/quick_install.rst
@@ -34,6 +34,10 @@ Python 3.8, 3.9, 3.10
------------------
根据您的需求,选择合适的软件包版本:
+.. note::
+
+ 建议使用非root用户安装
+
.. raw:: html
@@ -87,12 +91,12 @@ Python 3.8, 3.9, 3.10
安装依赖
sudo apt-get install -y gcc g++ make cmake zlib1g zlib1g-dev openssl libsqlite3-dev libssl-dev libffi-dev unzip pciutils net-tools libblas-dev gfortran libblas3
+ sudo apt-get install -y gcc g++ make cmake zlib1g zlib1g-dev openssl libsqlite3-dev libssl-dev libffi-dev unzip pciutils net-tools libblas-dev gfortran libblas3 python3-dev
sudo yum install -y gcc gcc-c++ make cmake unzip zlib-devel libffi-devel openssl-devel pciutils net-tools sqlite-devel lapack-devel gcc-gfortran
+ sudo yum install -y gcc gcc-c++ make cmake unzip zlib-devel libffi-devel openssl-devel pciutils net-tools sqlite-devel lapack-devel gcc-gfortran python3-devel
创建驱动运行用户
@@ -114,13 +118,17 @@ Python 3.8, 3.9, 3.10 +备注
+根据提示决定是否需要重启系统
+安装python依赖
pip3 install attrs numpy decorator sympy cffi pyyaml pathlib2 psutil protobuf scipy requests absl-py wheel typing_extensions
+ pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple attrs numpy decorator sympy cffi pyyaml pathlib2 psutil protobuf scipy requests absl-py wheel typing_extensions
下载并安装
@@ -140,7 +148,7 @@ Python 3.8, 3.9, 3.10设置环境变量
echo "source /usr/local/Ascend/ascend-toolkit/set_env.sh" >> ~/.bashrc
source ~/.bashrc
+ echo "source ~/Ascend/ascend-toolkit/set_env.sh" >> ~/.bashrc
source ~/.bashrc
备注
+请确保已经安装了与上述CANN-toolkit版本匹配的驱动和固件。
+备注
+请确保已经根据上述表格建议安装了对应的CANN-toolkit版本以及相应的固件和驱动,并应用了CANN-toolkit环境变量。
+备注
+请确保已经根据上述表格建议安装了对应的CANN-toolkit版本以及相应的固件和驱动,并应用了CANN-toolkit环境变量。
+1. Python 3.8 ~ 3.10
2. 支持C++17的编译器,例如clang 或者 gcc (9.4.0及以上)
备注
+如果使用Conda,请确保CANN-toolkit依赖的Python包在Conda环境中已经安装
+警告
+不建议您使用Conda提供的gcc,可能需要解决一些编译依赖问题,如果一定要使用,可参考以下命令:
+conda install -c conda-forge libstdcxx-ng libgcc-ng gcc=9.4 gxx=9.4
备注
+请确认CXX11_ABI是关闭的,如果无法确定,建议显式关闭:
+export _GLIBCXX_USE_CXX11_ABI=0