使用VTune进行硬件事件热点分析时遇内部错误与采集失败的解决方法
VTune热点采集失败及self-checker报告无数据问题的解决方法
问题场景
在CentOS 7(搭配Ubuntu 18.04)环境下,执行VTune热点采集命令时触发内部错误,同时vtune-self-checker的硬件事件分析报告阶段失败,提示无数据(错误码0x40000024)。
执行的VTune命令
/opt/intel/oneapi/vtune/2022.1.0/bin64/vtune -collect hotspots -knob sampling-mode=hw -knob sampling-interval=1 -knob enable-stack-collection=true -knob stack-size=0 -mrte-mode=native -target-duration-type=veryshort -data-limit=10000 -cpu-mask=3 -finalization-mode=full -app-working-dir /local/home/vsolontsov/itto.run --app-working-dir=/local/home/vsolontsov/itto.run -- /usr/local/bin/pin -c 3 -e ./run_feed.sh
错误提示
vtune: Warning: The Duration Time Estimate option is deprecated. Use the CPU Sampling Interval option on the Analysis Type configuration pane instead.
vtune: Collection failed.
vtune: Internal Error
self-checker结果
HW event-based analysis check (Intel driver)
Example of analysis types: Microarchitecture Exploration
Collection: Ok
Finalization: Ok...
Report: Fail
vtune: Error: 0x40000024 (No data) -- No data is collected.
Possible reasons:
- Workload is too small. No samples are collected.
- The application environment is not specified correctly.
- The executable file has been stripped so cannot be profiled with algorithm analysis types.
解决方法
1. 调整采样参数,降低采集压力
- 你设置的
sampling-interval=1(1纳秒)过小,会导致VTune采集负载过高触发内部错误。建议将采样间隔调至合理值,比如sampling-interval=1000(1微秒)。 - 移除
target-duration-type=veryshort或改为short/medium,确保有足够时长采集到有效样本。
修改后的命令片段示例:
-knob sampling-interval=1000 -target-duration-type=short
2. 清理冗余配置,修复参数冲突
- 命令中重复设置了
--app-working-dir,保留一个即可,避免配置冲突。 - 移除
stack-size=0,VTune默认会自动适配栈大小,手动设为0可能导致栈收集异常;若需手动指定,建议设置为8192等合理值。
3. 排查目标应用环境
- 确认
./run_feed.sh启动的进程确实运行在cpu-mask=3指定的核心0、1上,可通过top -H -p <PID>或taskset -p <PID>验证CPU亲和性。 - 检查脚本中调用的可执行文件是否被stripped:执行
file <your-executable>,若输出包含"stripped",需使用保留符号信息的版本重新编译应用——VTune依赖符号信息生成分析报告。
4. 验证驱动与权限
- 检查Intel VTune相关驱动是否加载:执行
lsmod | grep intel_pmu或lsmod | grep vtsspp,若未加载则重新安装驱动。 - 以root权限重新执行VTune命令和self-checker,部分硬件事件采集需要管理员权限:
sudo /opt/intel/oneapi/vtune/2022.1.0/bin64/vtune -collect hotspots [其他参数] sudo /opt/intel/oneapi/vtune/2022.1.0/bin64/vtune-self-checker.sh
5. 用简单负载验证VTune环境
- 先通过CPU密集型测试程序确认VTune本身功能正常:
vtune -collect hotspots -- /bin/dd if=/dev/zero of=/dev/null bs=1M count=10000
若此命令能成功生成报告,说明问题出在目标应用的环境或配置上,而非VTune本身。
内容的提问来源于stack exchange,提问作者Aishwarya
相关产品推荐
相关产品推荐

