• MindSpore:测试mindspore的ascend用例编译失败


    问题描述:

    测试mindspore的ascend用例编译失败(MindSpore官网  )

    (base) xling@xling-MS-7916:~$ cd /home/xling/codes/ascend_projects/docs/tutorials/tutorial_code/ascend310_single_op_sample
    (base) xling@xling-MS-7916:~/codes/ascend_projects/docs/tutorials/tutorial_code/ascend310_single_op_sample$ ls
    CMakeCache.txt  CMakeFiles  cmake_install.cmake  CMakeLists.txt  main.cc  Makefile  README.md  tensor_add.mindir  tensor_add_sample
    (base) xling@xling-MS-7916:~/codes/ascend_projects/docs/tutorials/tutorial_code/ascend310_single_op_sample$ cmake . -DMINDSPORE_PATH=`pip3 show mindspore-ascend | grep Location | awk '{print $2"/mindspore"}' | xargs realpath`
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/xling/codes/ascend_projects/docs/tutorials/tutorial_code/ascend310_single_op_sample
    (base) xling@xling-MS-7916:~/codes/ascend_projects/docs/tutorials/tutorial_code/ascend310_single_op_sample$ make
    Consolidate compiler generated dependencies of target tensor_add_sample
    make[2]: *** No rule to make target '/home/xling/.local/lib/python3.7/site-packages/mindspore/lib/libmindspore.so', needed by 'tensor_add_sample'.  Stop.
    CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/tensor_add_sample.dir/all' failed
    make[1]: *** [CMakeFiles/tensor_add_sample.dir/all] Error 2
    Makefile:90: recipe for target 'all' failed
    make: *** [all] Error 2

    系统配置:x86 ubuntu18.04 + atlas200dk

    环境变量:

    export PATH=/usr/local/cuda/bin:$PATH
    export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
    
    ########### Ascend development ###########
    #用于设置python3.7.5库文件路径
    export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:$LD_LIBRARY_PATH
    #如果用户环境存在多个python3版本,则指定使用python3.7.5版本
    export PATH=/usr/local/python3.7.5/bin:$PATH
    
    export install_path=/home/xling/Ascend/ascend-toolkit/latest     # 以安装用户为HwHiAiUser为例
    export ASCEND_OPP_PATH=${install_path}/opp
    export ASCEND_AICPU_PATH=${install_path}
    export TOOLCHAIN_HOME=${install_path}/toolkit
    #开发离线推理程序时配置
    export LD_LIBRARY_PATH=${install_path}/acllib/lib64:$LD_LIBRARY_PATH
    export PATH=${install_path}/toolkit/bin:$PATH
    export PYTHONPATH=${install_path}/toolkit/python/site-packages:${install_path}/pyACL/python/site-packages/acl:$PYTHONPATH
    #进行模型转换/算子编译时配置
    export LD_LIBRARY_PATH=${install_path}/atc/lib64:$LD_LIBRARY_PATH
    export PATH=${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:${install_path}/toolkit/bin:$PATH
    export PYTHONPATH=${install_path}/toolkit/python/site-packages:${install_path}/atc/python/site-packages:$PYTHONPATH
    
    ###### mindspore ascend ###################
    # https://www.mindspore.cn/install
    # control log level. 0-DEBUG, 1-INFO, 2-WARNING, 3-ERROR, default level is WARNING.
    export GLOG_v=2
    
    # Conda environmental options
    LOCAL_ASCEND=/home/xling/Ascend # the root directory of run package
    
    # lib libraries that the run package depends on
    export LD_LIBRARY_PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/acllib/lib64:${LOCAL_ASCEND}/ascend-toolkit/latest/atc/lib64:${LOCAL_ASCEND}/driver/lib64:${LOCAL_ASCEND}/opp/op_impl/built-in/ai_core/tbe/op_tiling:${LD_LIBRARY_PATH}
    
    # lib libraries that the mindspore depends on, modify "pip3" according to the actual situation
    export LD_LIBRARY_PATH=`pip3 show mindspore-ascend | grep Location | awk '{print $2"/mindspore/lib"}' | xargs realpath`:${LD_LIBRARY_PATH}
    
    # Environment variables that must be configured
    export TBE_IMPL_PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe            # TBE operator implementation tool path
    export ASCEND_OPP_PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/opp                                       # OPP path
    export PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/atc/ccec_compiler/bin/:${PATH}                       # TBE operator compilation tool path
    export PYTHONPATH=${TBE_IMPL_PATH}:${PYTHONPATH}                                                       # Python library that TBE implementation depends on

    文件:

    /home/xling/Ascend
    ├── ascend-toolkit
    │   ├── 20.0 -> /home/xling/Ascend/ascend-toolkit/20.0.RC1
    │   ├── 20.0.RC1
    │   │   ├── acllib_linux.arm64 -> /home/xling/Ascend/ascend-toolkit/20.0.RC1/arm64-linux_gcc7.3.0/acllib
    │   │   ├── acllib_linux.x86_64 -> /home/xling/Ascend/ascend-toolkit/20.0.RC1/x86_64-linux_gcc7.3.0/acllib
    │   │   ├── arm64-linux_gcc7.3.0
    │   │   ├── atc -> /home/xling/Ascend/ascend-toolkit/20.0.RC1/x86_64-linux_gcc7.3.0/atc
    │   │   ├── opp -> /home/xling/Ascend/ascend-toolkit/20.0.RC1/x86_64-linux_gcc7.3.0/opp
    │   │   ├── pyACL -> /home/xling/Ascend/ascend-toolkit/20.0.RC1/x86_64-linux_gcc7.3.0/pyACL
    │   │   ├── toolkit -> /home/xling/Ascend/ascend-toolkit/20.0.RC1/x86_64-linux_gcc7.3.0/toolkit
    │   │   └── x86_64-linux_gcc7.3.0
    │   ├── 3.3 -> ./3.3.0.alpha001
    │   ├── 3.3.0.alpha001
    │   │   ├── acllib -> ./x86_64-linux/acllib
    │   │   ├── acllib_linux.x86_64 -> /home/xling/Ascend/ascend-toolkit/3.3.0.alpha001/x86_64-linux
    │   │   ├── atc -> ./x86_64-linux/atc
    │   │   ├── opp -> ./x86_64-linux/opp
    │   │   ├── opp_linux.x86_64 -> ./x86_64-linux/opp
    │   │   ├── pyACL -> ./x86_64-linux/pyACL
    │   │   ├── toolkit -> ./x86_64-linux/toolkit
    │   │   └── x86_64-linux
    │   ├── latest -> /home/xling/Ascend/ascend-toolkit/20.0.RC1
    │   ├── log
    │   └── pid.log
    └── mindx_sdk
        └── mxVision_20.2.0
            └── linux-x86_64

    可以ssh到atlas

    (base) xling@xling-MS-7916:~/codes/ascend_projects/docs/tutorials/tutorial_code/ascend310_single_op_sample$ ssh HwHiAiUser@192.168.1.40
    Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.19.95+ aarch64)
    
     * Documentation:  https://help.ubuntu.com
     * Management:     https://landscape.canonical.com
     * Support:        https://ubuntu.com/advantage
    
    Last login: Thu Mar 25 12:49:13 2021 from 192.168.1.39

     

    解决方案:

    检查一下这个libmindspore.so是否存在,然后看一下CMakelist文件中的find_library的查找路径,将SMINDSPORE_PATH指定为libmindspore.so存在的路径后,再试一下

     

  • 相关阅读:
    〖Python 数据库开发实战 - MySQL篇㉚〗- MySQL 条件函数
    恩智浦官方Uboot移植
    Java基础:代理
    [Dubbo3.0.8源码解析系列]-26-消费者一个服务是如何通过RPC调用到提供者的
    【云原生】服务限流熔断概述、常见限流算法
    洛谷 P1978 集合
    openEuler 22.03 安装及配置Gitlab容器
    Nginx负载均衡和备份和故障转移
    系列十二、强引用、软引用、弱引用、虚引用分别是什么?
    工业蒸汽量预测(速通二)
  • 原文地址:https://blog.csdn.net/weixin_45666880/article/details/126022292