关于在使用msprof时始终报错软链接和无法找到LD_LIBRARY_PATH的问题
收藏回复举报
关于在使用msprof时始终报错软链接和无法找到LD_LIBRARY_PATH的问题
t('forum.solved') 已解决
发表于2026-03-19 11:57:28
0 查看

环境

  • Atlas200I DK A2开发套件
  • get_env.sh > env.txt添加到附件。

测试工程

  • 官方代码仓中的样例:samples/operator/ascendc/0_introduction/3_add_kernellaunch
  • 工程目录结构如下:
HwHiAiUser@davinci-mini:~/study/3_add_kernellaunch$ tree -L 2
.
├── AddKernelInvocationAcl
│   ├── CMakeLists.txt
│   ├── README.md
│   ├── add_custom.cpp
│   ├── ascendc_kernels_bbit
│   ├── build
│   ├── cmake
│   ├── data_utils.h
│   ├── input
│   ├── main.cpp
│   ├── out
│   ├── output
│   ├── run.sh
│   └── scripts
├── AddKernelInvocationNeo
│   ├── CMakeLists.txt
│   ├── README.md
│   ├── add_custom.cpp
│   ├── cmake
│   ├── data_utils.h
│   ├── main.cpp
│   ├── run.sh
│   └── scripts
├── AddKernelInvocationTilingNeo
│   ├── CMakeLists.txt
│   ├── README.md
│   ├── add_custom.cpp
│   ├── add_custom_tiling.h
│   ├── cmake
│   ├── data_utils.h
│   ├── main.cpp
│   ├── run.sh
│   └── scripts
├── CppExtensions
│   ├── CMakeLists.txt
│   ├── README.md
│   ├── add_custom.cpp
│   ├── add_custom_test.py
│   ├── pybind11.cpp
│   └── run.sh
└── README.md

14 directories, 27 files

问题描述

  1. 我使用命令msprof op ./ascendc_kernels_bbit对算子二进制文件进行测试时报错:
HwHiAiUser@davinci-mini:~/study/3_add_kernellaunch/AddKernelInvocationAcl$ msprof op ./ascendc_kernels_bbit 
2026-03-19 11:39:11 [ERROR] Input parameter path contains softlink, may cause security problems
2026-03-19 11:39:11 [WARN]  Can't find valid libascend_hal.so, please check your LD_LIBRARY_PATH
2026-03-19 11:39:11 [ERROR] Fail to get soc platform because of null ptr
2026-03-19 11:39:11 [ERROR] Device profiling is not supported on current chip.
2026-03-19 11:39:11 [INFO]  Use msprof op --help or msprof op simulator --help for more details
  1. 可以通过命令ls -l ./ascendc_kernels_bbit证明这个文件不是软链接:
HwHiAiUser@davinci-mini:~/study/3_add_kernellaunch/AddKernelInvocationAcl$ ls -l ./ascendc_kernels_bbit
-rwxr-xr-x 1 HwHiAiUser HwHiAiUser 125112 Mar 19 00:19 ./ascendc_kernels_bbit
  1. 已通过env.txt验证环境变量:LD_LIBRARY_PATH、PATH、ASCEND_TOOLKIT_HOME、ASCEND_HOME_PATH、ASCEND_OPP_PATH、PYTHONPATH等全部正确配置并生效。
  2. 我在自建的Framework工程中对bulid_out下的.run文件进行操作也是同样的输出:
HwHiAiUser@davinci-mini:~/study/Softplus/SoftplusCustom/build_out$ msprof op custom_opp_ubuntu_aarch64.run
2026-03-19 11:49:49 [ERROR] Input parameter path contains softlink, may cause security problems
2026-03-19 11:49:49 [WARN]  Can't find valid libascend_hal.so, please check your LD_LIBRARY_PATH
2026-03-19 11:49:49 [ERROR] Fail to get soc platform because of null ptr
2026-03-19 11:49:49 [ERROR] Device profiling is not supported on current chip.
2026-03-19 11:49:49 [INFO]  Use msprof op --help or msprof op simulator --help for more details

请问下问题出在哪,如何正确地使用msprof命令呢?

本帖最后由 匿名用户 于 2026/03/19 16:10:37 编辑

我要发帖子