文档
注册

如何通过gdb启动算子调测工具脚本

问题描述

在Linux环境下,用户需要通过gdb方式开启对算子调测(ascendebug)工具的调试。

可能的原因

处理方案

  1. 执行如下命令,获取工具安装路径。
    which ascendebug

    一般情况下,ascendebug工具路径缺省为“${INSTALL_DIR}/tools/ascendc_tools/ascendebug”,其中${INSTALL_DIR}请替换为CANN软件安装后文件存储路径。例如,若安装的Ascend-cann-toolkit软件包,则安装后文件存储路径为:$HOME/Ascend/ascend-toolkit/latest。

  2. 打开ascendebug工具启动脚本(以缺省路径为例)。
    vim ${INSTALL_DIR}/tools/ascendc_tools/ascendebug
  3. 在启动脚本中添加gdb调试命令。
    样例如下:
    main() {
        check_env $LD_LIBRARY_PATH
        ret1=$?
        check_env $PATH
        ret2=$?
        check_env $TOOLCHAIN_HOME
        ret3=$?
        if [ $ret1 -eq 1 ] || [ $ret2 -eq 1 ] || [ $ret3 -eq 1 ]; then
            echo "Please make sure source the correct cann package setenv.bash only. you can open a new window,and restart"
            exit 0
        fi
        export _ASCENDC_DEBUG_TOOL_INSTALL_PATH=${DIR%%latest*}
        gdb --ex r --args python3 -m ascendebug.cmd $@
    }
搜索结果
找到“0”个结果

当前产品无相关内容

未找到相关内容,请尝试其他搜索词