已合并
修复install.sh权限失败静默报 SUCCESS 并补充 QUICKSTART 安装校验指引 #9670
游震创建于 8月6日
修复install.sh权限失败静默报 SUCCESS 并补充 QUICKSTART 安装校验指引 #9670
已合并
共 3 个文件变更+26-2
| @@ -253,6 +253,10 @@ if [ ! -d ${targetdir}/vendors ];then | |||
| 253 | fi | 253 | fi |
| 254 | fi | 254 | fi |
| 255 | chmod u+w ${targetdir}/vendors | 255 | chmod u+w ${targetdir}/vendors |
| 256 | +if [ $? -ne 0 ];then | ||
| 257 | + log "[ERROR] chmod u+w ${targetdir}/vendors failed, please check the directory owner (current user: $(whoami)) and retry, or use --install-path to install into a writable directory" | ||
| 258 | + exit 1 | ||
| 259 | +fi | ||
| 256 | 260 | ||
| 257 | log "[INFO] upgrade framework" | 261 | log "[INFO] upgrade framework" |
| 258 | upgrade framework | 262 | upgrade framework |
| @@ -315,10 +319,18 @@ else | |||
| 315 | config_file=${targetdir}/vendors/config.ini | 319 | config_file=${targetdir}/vendors/config.ini |
| 316 | if [ ! -f ${config_file} ]; then | 320 | if [ ! -f ${config_file} ]; then |
| 317 | touch ${config_file} | 321 | touch ${config_file} |
| 322 | + if [ $? -ne 0 ];then | ||
| 323 | + log "[ERROR] touch ${config_file} failed, please check write permission of ${targetdir}/vendors (current user: $(whoami))" | ||
| 324 | + exit 1 | ||
| 325 | + fi | ||
| 318 | chmod 640 ${config_file} | 326 | chmod 640 ${config_file} |
| 327 | + if [ $? -ne 0 ];then | ||
| 328 | + log "[ERROR] chmod 640 ${config_file} failed" | ||
| 329 | + exit 1 | ||
| 330 | + fi | ||
| 319 | echo "load_priority=$vendor_name" > ${config_file} | 331 | echo "load_priority=$vendor_name" > ${config_file} |
| 320 | if [ $? -ne 0 ];then | 332 | if [ $? -ne 0 ];then |
| 321 | - log "[ERROR] echo load_priority failed" | 333 | + log "[ERROR] write load_priority to ${config_file} failed" |
| 322 | exit 1 | 334 | exit 1 |
| 323 | fi | 335 | fi |
| 324 | else | 336 | else |
| @@ -327,13 +339,22 @@ else | |||
| 327 | vendor=$(echo $found_vendor | tr -s ' ' ',') | 339 | vendor=$(echo $found_vendor | tr -s ' ' ',') |
| 328 | if [ "$vendor" != "" ]; then | 340 | if [ "$vendor" != "" ]; then |
| 329 | sed -i "/load_priority=$found_vendors/s@load_priority=$found_vendors@load_priority=$vendor_name,$vendor@g" "$config_file" | 341 | sed -i "/load_priority=$found_vendors/s@load_priority=$found_vendors@load_priority=$vendor_name,$vendor@g" "$config_file" |
| 342 | + if [ $? -ne 0 ];then | ||
| 343 | + log "[ERROR] sed update load_priority in ${config_file} failed, please check write permission of config.ini (current user: $(whoami))" | ||
| 344 | + exit 1 | ||
| 345 | + fi | ||
| 330 | fi | 346 | fi |
| 331 | fi | 347 | fi |
| 332 | if test $INSTALL_FOR_ALL = "y"; then | 348 | if test $INSTALL_FOR_ALL = "y"; then |
| 333 | chmod 755 ${config_file} | 349 | chmod 755 ${config_file} |
| 350 | + if [ $? -ne 0 ];then | ||
| 351 | + log "[ERROR] chmod 755 ${config_file} failed" | ||
| 352 | + exit 1 | ||
| 353 | + fi | ||
| 334 | fi | 354 | fi |
| 335 | log "[INFO] using requirements: when custom module install finished or before you run the custom module, \ | 355 | log "[INFO] using requirements: when custom module install finished or before you run the custom module, \ |
| 336 | execute the command [ export LD_LIBRARY_PATH=${_ASCEND_CUSTOM_OPP_PATH}/op_api/lib/:\${LD_LIBRARY_PATH} ] to set the environment path" | 356 | execute the command [ export LD_LIBRARY_PATH=${_ASCEND_CUSTOM_OPP_PATH}/op_api/lib/:\${LD_LIBRARY_PATH} ] to set the environment path" |
| 357 | + log "[INFO] verify install: run [ grep load_priority ${config_file} ] to confirm the vendor is loaded" | ||
| 337 | fi | 358 | fi |
| 338 | 359 | ||
| 339 | if [ -d ${targetdir}/$vendordir/op_impl/cpu/aicpu_kernel/impl/ ]; then | 360 | if [ -d ${targetdir}/$vendordir/op_impl/cpu/aicpu_kernel/impl/ ]; then |
| @@ -81,6 +81,8 @@ Self-extractable archive "cann-ops-transformer-custom_linux.${arch}.run" success | |||
| 81 | 81 | ||
| 82 | `AddExample`安装在```${ASCEND_HOME_PATH}/opp/vendors```路径中,```${ASCEND_HOME_PATH}```表示CANN软件安装目录。 | 82 | `AddExample`安装在```${ASCEND_HOME_PATH}/opp/vendors```路径中,```${ASCEND_HOME_PATH}```表示CANN软件安装目录。 |
| 83 | 83 | ||
| 84 | +> 安装后执行 `grep load_priority ${ASCEND_HOME_PATH}/opp/vendors/config.ini` 校验,预期输出含本 vendor。若无输出,通常是 `${ASCEND_HOME_PATH}/opp/vendors` 属主或权限不对,请排查后重新安装。 | ||
| 85 | + | ||
| 84 | ### 4. 配置环境变量 | 86 | ### 4. 配置环境变量 |
| 85 | 87 | ||
| 86 | 将自定义算子包的路径加入环境变量,确保运行时能够找到。 | 88 | 将自定义算子包的路径加入环境变量,确保运行时能够找到。 |
| @@ -81,6 +81,8 @@ | |||
| 81 | 81 | ||
| 82 | 自定义算子包安装路径为```${ASCEND_HOME_PATH}/opp/vendors```,\$\{ASCEND\_HOME\_PATH\}已通过环境变量配置,表示CANN toolkit包安装路径,一般为\$\{install\_path\}/cann。 | 82 | 自定义算子包安装路径为```${ASCEND_HOME_PATH}/opp/vendors```,\$\{ASCEND\_HOME\_PATH\}已通过环境变量配置,表示CANN toolkit包安装路径,一般为\$\{install\_path\}/cann。 |
| 83 | 83 | ||
| 84 | + > 安装后执行 `grep load_priority ${ASCEND_HOME_PATH}/opp/vendors/config.ini` 校验,预期输出含本 vendor。若无输出,通常是 `${ASCEND_HOME_PATH}/opp/vendors` 属主或权限不对,请排查后重新安装。 | ||
| 85 | + | ||
| 84 | 如果部署算子包时通过配置--install-path参数指定了算子包的安装目录,则在使用自定义算子前,需要执行```source ${install_path}/vendors/${vendor_name}/bin/set_env.bash```命令,set_env.bash脚本中将自定义算子包的安装路径追加到环境变量ASCEND_CUSTOM_OPP_PATH中,使自定义算子在当前环境中生效。 | 86 | 如果部署算子包时通过配置--install-path参数指定了算子包的安装目录,则在使用自定义算子前,需要执行```source ${install_path}/vendors/${vendor_name}/bin/set_env.bash```命令,set_env.bash脚本中将自定义算子包的安装路径追加到环境变量ASCEND_CUSTOM_OPP_PATH中,使自定义算子在当前环境中生效。 |
| 85 | 87 | ||
| 86 | 3. **(可选)删除自定义算子包** | 88 | 3. **(可选)删除自定义算子包** |
| @@ -309,4 +311,3 @@ bash build.sh --pkg --soc=${soc_version} --ops=${op_list} --opkernel_aicpu | |||
| 309 | ### 编译失败或中断后恢复 | 311 | ### 编译失败或中断后恢复 |
| 310 | 312 | ||
| 311 | 编译失败或强制中断可能导致 build 缓存损坏,再次编译异常时,执行 `bash build.sh --make_clean` 清理后重新编译。 | 313 | 编译失败或强制中断可能导致 build 缓存损坏,再次编译异常时,执行 `bash build.sh --make_clean` 清理后重新编译。 |
| 312 | - | ||