From 4bd0050180843e39a6c99c652e9a566a09daeccc Mon Sep 17 00:00:00 2001
From: JoeyLin <linxin40@huawei.com>
Date: Tue, 18 Oct 2022 17:11:51 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0310=E6=8E=A8=E7=90=86?=
 =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E8=AE=BE=E7=BD=AE=E6=8C=87?=
 =?UTF-8?q?=E5=BC=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 utils/ascend310_env_set/README.md    | 47 ++++++++++++++++++++++++++++
 utils/ascend310_env_set/README_CN.md | 47 ++++++++++++++++++++++++++++
 2 files changed, 94 insertions(+)
 create mode 100644 utils/ascend310_env_set/README.md
 create mode 100644 utils/ascend310_env_set/README_CN.md

diff --git a/utils/ascend310_env_set/README.md b/utils/ascend310_env_set/README.md
new file mode 100644
index 000000000..0060829e2
--- /dev/null
+++ b/utils/ascend310_env_set/README.md
@@ -0,0 +1,47 @@
+# Description
+
+In order to ensure that the script can run normally on the Ascend 310/310P, environment variables need to be set before inference is executed.
+
+## Check the installation path
+
+If the root user is used to install the run package, the default path is '/usr/local/Ascend', and the default installation path for non-root users is '/home/HwHiAiUser/Ascend'.
+
+Take the path of the root user as an example, set the environment variables as follows:
+
+```bash
+export ASCEND_HOME=/usr/local/Ascend  # the root directory of run package
+```
+
+## Identify the run package version
+
+The run package is divided into two versions according to whether the 'ascend-toolkit' directory exists in the installation path.
+
+If 'ascend-toolkit' directory exists, set the environment variables as follows:
+
+```bash
+export ASCEND_HOME=/usr/local/Ascend
+export PATH=${ASCEND_HOME}/ascend-toolkit/latest/compiler/bin:${ASCEND_HOME}/ascend-toolkit/latest/compiler/ccec_compiler/bin/:${PATH}
+export LD_LIBRARY_PATH=${ASCEND_HOME}/driver/lib64:${ASCEND_HOME}/ascend-toolkit/latest/lib64:${LD_LIBRARY_PATH}
+export ASCEND_OPP_PATH=${ASCEND_HOME}/ascend-toolkit/latest/opp
+export ASCEND_AICPU_PATH=${ASCEND_HOME}/ascend-toolkit/latest/
+export PYTHONPATH=${ASCEND_HOME}/ascend-toolkit/latest/compiler/python/site-packages:${PYTHONPATH}
+export TOOLCHAIN_HOME=${ASCEND_HOME}/ascend-toolkit/latest/toolkit
+```
+
+Another version:
+
+```bash
+export ASCEND_HOME=/usr/local/Ascend
+export PATH=${ASCEND_HOME}/latest/compiler/bin:${ASCEND_HOME}/latest/compiler/ccec_compiler/bin:${PATH}
+export LD_LIBRARY_PATH=${ASCEND_HOME}/driver/lib64:${ASCEND_HOME}/latest/lib64:${LD_LIBRARY_PATH}
+export ASCEND_OPP_PATH=${ASCEND_HOME}/latest/opp
+export ASCEND_AICPU_PATH=${ASCEND_HOME}/latest
+export PYTHONPATH=${ASCEND_HOME}/latest/compiler/python/site-packages:${PYTHONPATH}
+export TOOLCHAIN_HOME=${ASCEND_HOME}/latest/toolkit
+```
+
+## Set the Host log level
+
+```bash
+export GLOG_v=2 # 0-DEBUG, 1-INFO, 2-WARNING, 3-ERROR, 4-CRITICAL, default level is WARNING.
+```
diff --git a/utils/ascend310_env_set/README_CN.md b/utils/ascend310_env_set/README_CN.md
new file mode 100644
index 000000000..e7369618e
--- /dev/null
+++ b/utils/ascend310_env_set/README_CN.md
@@ -0,0 +1,47 @@
+# 绠€浠�
+
+涓轰簡纭繚鑴氭湰鑳藉姝e父鍦拌繍琛屽湪鏄囪吘310/310P锛岄渶瑕佸湪鎵ц鎺ㄧ悊鍓嶈缃幆澧冨彉閲忋€�
+
+## 纭run鍖呭畨瑁呰矾寰�
+
+鑻ヤ娇鐢╮oot鐢ㄦ埛瀹屾垚run鍖呭畨瑁咃紝榛樿璺緞涓�'/usr/local/Ascend'锛岄潪root鐢ㄦ埛鐨勯粯璁ゅ畨瑁呰矾寰勪负'/home/HwHiAiUser/Ascend'銆�
+
+浠oot鐢ㄦ埛鐨勮矾寰勪负渚嬶紝璁剧疆鐜鍙橀噺濡備笅锛�
+
+```bash
+export ASCEND_HOME=/usr/local/Ascend  # the root directory of run package
+```
+
+## 鍖哄垎run鍖呯増鏈�
+
+run鍖呭垎涓�2涓増鏈紝鐢ㄥ畨瑁呯洰褰曚笅鏄惁瀛樺湪'ascend-toolkit'鏂囦欢澶硅繘琛屽尯鍒嗐€�
+
+濡傛灉瀛樺湪'ascend-toolkit'鏂囦欢澶癸紝璁剧疆鐜鍙橀噺濡備笅锛�
+
+```bash
+export ASCEND_HOME=/usr/local/Ascend
+export PATH=${ASCEND_HOME}/ascend-toolkit/latest/compiler/bin:${ASCEND_HOME}/ascend-toolkit/latest/compiler/ccec_compiler/bin/:${PATH}
+export LD_LIBRARY_PATH=${ASCEND_HOME}/driver/lib64:${ASCEND_HOME}/ascend-toolkit/latest/lib64:${LD_LIBRARY_PATH}
+export ASCEND_OPP_PATH=${ASCEND_HOME}/ascend-toolkit/latest/opp
+export ASCEND_AICPU_PATH=${ASCEND_HOME}/ascend-toolkit/latest/
+export PYTHONPATH=${ASCEND_HOME}/ascend-toolkit/latest/compiler/python/site-packages:${PYTHONPATH}
+export TOOLCHAIN_HOME=${ASCEND_HOME}/ascend-toolkit/latest/toolkit
+```
+
+鑻ヤ笉瀛樺湪锛岃缃幆澧冨彉閲忎负锛�
+
+```bash
+export ASCEND_HOME=/usr/local/Ascend
+export PATH=${ASCEND_HOME}/latest/compiler/bin:${ASCEND_HOME}/latest/compiler/ccec_compiler/bin:${PATH}
+export LD_LIBRARY_PATH=${ASCEND_HOME}/driver/lib64:${ASCEND_HOME}/latest/lib64:${LD_LIBRARY_PATH}
+export ASCEND_OPP_PATH=${ASCEND_HOME}/latest/opp
+export ASCEND_AICPU_PATH=${ASCEND_HOME}/latest
+export PYTHONPATH=${ASCEND_HOME}/latest/compiler/python/site-packages:${PYTHONPATH}
+export TOOLCHAIN_HOME=${ASCEND_HOME}/latest/toolkit
+```
+
+## 璁剧疆Host渚ф棩蹇楃骇鍒�
+
+```bash
+export GLOG_v=2 # 0-DEBUG, 1-INFO, 2-WARNING, 3-ERROR, 4-CRITICAL, default level is WARNING.
+```
-- 
GitLab