Browse Source

Pre Merge pull request !1697 from 刘康/master

pull/1697/MERGE
刘康 Gitee 4 years ago
parent
commit
020a9d6fb4
3 changed files with 65 additions and 3 deletions
  1. +6
    -2
      scripts/readme.md
  2. +17
    -0
      scripts/update/deps_config_community.sh
  3. +42
    -1
      scripts/update/ge_update.sh

+ 6
- 2
scripts/readme.md View File

@@ -41,7 +41,7 @@ $ cd ./scripts
$ ./ge.sh env
```

3.配置外部依赖服务器信息
3.配置外部依赖服务器信息,社区安装跳过此步骤。
```sh
ge config -i=121.36.**.** -u=asc**, -p=Asc***\#@\!$ (Need add escape character \ before special charactor $、#、!)
```
@@ -49,7 +49,10 @@ ge config -i=121.36.**.** -u=asc**, -p=Asc***\#@\!$ (Need add escape charact
4.下载和安装构建所依赖的外部库

```sh
$ ge update
社区安装
$ ge update -p
非社区安装
$ ge update
```

(注:进入容器后,`ge`命令已经自动注册进系统,因此容器内不需要写脚本全称)
@@ -164,6 +167,7 @@ Usage: ge update [OPTIONS]
update dependencies of build and test

Options:
-p, --public Download dependencies from community
-d, --download Download dependencies
-i, --install Install dependencies
-c, --clear Clear dependencies


+ 17
- 0
scripts/update/deps_config_community.sh View File

@@ -0,0 +1,17 @@
#社区版
CHIP_NAME_C=A800-9010
DRIVER_VERSION_C=21.0.rc1
DRIVER_RUN_NAME_C=${CHIP_NAME_C}-npu-driver_${DRIVER_VERSION_C}_ubuntu18.04-x86_64.run
DRIVER_SERVER_PATH_C=https://obs-9be7.obs.cn-east-2.myhuaweicloud.com
DRIVER_URL_C=${DRIVER_SERVER_PATH_C}/turing/resourcecenter/Software/AtlasI/A800-9010%201.0.10/NPU/${DRIVER_RUN_NAME_C}

PACKAGE_VERSION_C=5.0.2.alpha002
PACKAGE_NAME_C=Ascend-cann-toolkit_${PACKAGE_VERSION_C}_linux-x86_64.run
PACKAGE_SERVER_PATH_C=https://mirrors.huaweicloud.com
PACKAGE_URL_C=${PACKAGE_SERVER_PATH_C}/ascend/autoarchive/CANN/${PACKAGE_VERSION_C}/${PACKAGE_NAME_C}

DEV_TOOLS_VERSION_C=1.78.t12.0.b120
CPU_ARCH_C=linux.x86_64
ATC_RUN_NAME_C=Ascend-atc-${DEV_TOOLS_VERSION_C}-${CPU_ARCH_C}.run
ACL_RUN_NAME_C=Ascend-acllib-${DEV_TOOLS_VERSION_C}-${CPU_ARCH_C}.run
FWKACL_RUN_NAME_C=Ascend-fwkacllib-${DEV_TOOLS_VERSION_C}-${CPU_ARCH_C}.run

+ 42
- 1
scripts/update/ge_update.sh View File

@@ -34,6 +34,19 @@ function extract_deps_so()
./${DEV_TOOLS_PACKAGE}/${FWKACL_RUN_NAME} --noexec --extract=${DEP_TMP_DIR}/fwkacllib
}

function extract_deps_so_community()
{
echo "begin to extract .run file ........."
chmod 777 ./${DRIVER_RUN_NAME_C}
chmod 777 ./${PACKAGE_NAME_C}
[ -n "${DEP_TMP_DIR}" ] && rm -rf "${DEP_TMP_DIR}"
./${DRIVER_RUN_NAME_C} --noexec --extract=${DEP_TMP_DIR}/driver
./${PACKAGE_NAME_C} --noexec --extract=${DEP_TMP_DIR}/Packages_tmp
${DEP_TMP_DIR}/Packages_tmp/run_package/${ATC_RUN_NAME_C} --noexec --extract=${DEP_TMP_DIR}/atc
${DEP_TMP_DIR}/Packages_tmp/run_package/${ACL_RUN_NAME_C} --noexec --extract=${DEP_TMP_DIR}/acllib
${DEP_TMP_DIR}/Packages_tmp/run_package/${FWKACL_RUN_NAME_C} --noexec --extract=${DEP_TMP_DIR}/fwkacllib
}

function copy_so_to_target_dir()
{
mkdir -p $DEP_LIB_DIR
@@ -62,6 +75,19 @@ function download_runs()

}

function download_runs_from_community
{
source ${PROJECT_HOME}/scripts/update/deps_config_community.sh
echo "begin to download .run file from community........."
clear_libs
mkdir -p ./ ${DOWNLOAD_PATH}
pushd "${DOWNLOAD_PATH}" >/dev/null
cd ${DOWNLOAD_PATH}
wget ${DRIVER_URL_C}
wget ${PACKAGE_URL_C}
popd >/dev/null
}

function install_deps()
{
source scripts/update/deps_config.sh
@@ -73,6 +99,16 @@ function install_deps()
popd >/dev/null
}

function install_deps_community()
{
source ${PROJECT_HOME}/scripts/update/deps_config_community.sh
mkdir -p ./ ${DOWNLOAD_PATH}
pushd "${DOWNLOAD_PATH}" >/dev/null
cd ${DOWNLOAD_PATH}
extract_deps_so_community
copy_so_to_target_dir
popd >/dev/null
}

function help(){
cat <<-EOF
@@ -81,6 +117,7 @@ Usage: ge update [OPTIONS]
update dependencies of build and test

Options:
-p, --public Download dependencies from community
-d, --download Download dependencies
-i, --install Install dependencies
-c, --clear Clear dependencies
@@ -90,7 +127,7 @@ EOF
}

function parse_args(){
parsed_args=$(getopt -a -o dich --long download,install,clear,help -- "$@") || {
parsed_args=$(getopt -a -o dich --long public,download,install,clear,help -- "$@") || {
help
exit 1
}
@@ -104,6 +141,10 @@ function parse_args(){
eval set -- "$parsed_args"
while true; do
case "$1" in
-p | --public)
download_runs_from_community
install_deps_community
;;
-d | --download)
download_runs
;;


Loading…
Cancel
Save