[{"data":1,"prerenderedAt":880},["ShallowReactive",2],{"content-query-7c7e9oPf7S":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"category":13,"body":14,"_type":874,"_id":875,"_source":876,"_file":877,"_stem":878,"_extension":879},"/technology-blogs/zh/957","zh",false,"","昇思MindSpore 1.5不会安装？看这篇！","介绍在昇腾硬件平台上配置安装MindSpore，及对其进行简单测试的相关操作。","2022-01-21","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/01/22/8fa5ef9f426e452083836bb21268fc0a.png","technology-blogs","开发者分享",{"type":15,"children":16,"toc":855},"root",[17,25,34,52,57,67,72,80,85,90,110,115,129,134,141,146,154,164,172,180,185,193,201,206,211,219,227,236,241,249,267,272,277,286,299,308,320,324,329,337,349,357,369,386,390,398,403,410,415,422,431,436,441,449,454,462,467,475,484,489,497,502,510,515,523,531,536,544,553,558,563,575,583,592,597,605,614,622,630,639,647,655,660,668,673,681,686,694,699,704,716,727,735,753,779,786,794,802,808,815,818,828,837,846],{"type":18,"tag":19,"props":20,"children":22},"element","h1",{"id":21},"昇思mindspore-15不会安装看这篇",[23],{"type":24,"value":8},"text",{"type":18,"tag":26,"props":27,"children":28},"p",{},[29],{"type":18,"tag":30,"props":31,"children":33},"img",{"alt":7,"src":32},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/01/22/ab785eb999884fab963dc2183372ba7c.gif",[],{"type":18,"tag":26,"props":35,"children":36},{},[37,39,45,47],{"type":24,"value":38},"作者：",{"type":18,"tag":40,"props":41,"children":42},"strong",{},[43],{"type":24,"value":44},"Kaierlong",{"type":24,"value":46}," ｜",{"type":18,"tag":40,"props":48,"children":49},{},[50],{"type":24,"value":51},"来源：开源博客",{"type":18,"tag":26,"props":53,"children":54},{},[55],{"type":24,"value":56},"笔者在参加MindCon比赛过程中，需要用到昇腾硬件平台来跑一些推理步骤。但是当开通相应服务器及使用相应镜像后，在测试MindSpore是否安装成功的环节，出现了如下错误：",{"type":18,"tag":58,"props":59,"children":61},"pre",{"code":60},"./tensor_add_sample: error while loading shared libraries: libopskernel.so: cannot open shared object file: No such file or directory\n",[62],{"type":18,"tag":63,"props":64,"children":65},"code",{"__ignoreMap":7},[66],{"type":24,"value":60},{"type":18,"tag":26,"props":68,"children":69},{},[70],{"type":24,"value":71},"这使我意识到昇腾硬件平台的环境配置并没有想象中那么简单，也许大家也有相关的困扰，故而整理这篇文章供大家参考借鉴。",{"type":18,"tag":26,"props":73,"children":74},{},[75],{"type":18,"tag":40,"props":76,"children":77},{},[78],{"type":24,"value":79},"1 购买云资源",{"type":18,"tag":26,"props":81,"children":82},{},[83],{"type":24,"value":84},"购买云资源",{"type":18,"tag":26,"props":86,"children":87},{},[88],{"type":24,"value":89},"注意：",{"type":18,"tag":91,"props":92,"children":93},"ul",{},[94,100,105],{"type":18,"tag":95,"props":96,"children":97},"li",{},[98],{"type":24,"value":99},"系统镜像选择Ubuntu 18.04 server 64bit for Ai1s",{"type":18,"tag":95,"props":101,"children":102},{},[103],{"type":24,"value":104},"规格选择AI加速型",{"type":18,"tag":95,"props":106,"children":107},{},[108],{"type":24,"value":109},"默认购买的云资源没有开通公网，需要购买一个弹性公网进行IP绑定",{"type":18,"tag":26,"props":111,"children":112},{},[113],{"type":24,"value":114},"前往昇腾硬件平台：",{"type":18,"tag":26,"props":116,"children":117},{},[118,120],{"type":24,"value":119},"_",{"type":18,"tag":121,"props":122,"children":126},"a",{"href":123,"rel":124},"https://www.huaweicloud.com/product/ecs/ascend.html_%EF%BC%8C%E6%8C%89%E8%87%AA%E5%B7%B1%E9%9C%80%E8%A6%81%E8%B4%AD%E4%B9%B0%E5%90%88%E9%80%82%E4%BA%91%E8%B5%84%E6%BA%90%E3%80%82%E6%96%B0%E6%89%8B%E5%8F%AF%E4%BB%A5%E9%80%89%E6%8B%A9%E6%8C%89%E9%9C%80%E6%A8%A1%E5%BC%8F%EF%BC%8C%E8%8A%82%E7%9C%81%E8%B5%84%E9%87%91%E3%80%82",[125],"nofollow",[127],{"type":24,"value":128},"https://www.huaweicloud.com/product/ecs/ascend.html_，按自己需要购买合适云资源。新手可以选择按需模式，节省资金。",{"type":18,"tag":26,"props":130,"children":131},{},[132],{"type":24,"value":133},"本文购买的云资源如下图所示。",{"type":18,"tag":26,"props":135,"children":136},{},[137],{"type":18,"tag":30,"props":138,"children":140},{"alt":7,"src":139},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/01/22/a3a2e338a43145cc8c642738bb87532f.jpg",[],{"type":18,"tag":26,"props":142,"children":143},{},[144],{"type":24,"value":145},"之后根据提示配置网络等，开通服务器。",{"type":18,"tag":26,"props":147,"children":148},{},[149],{"type":18,"tag":40,"props":150,"children":151},{},[152],{"type":24,"value":153},"2 环境配置",{"type":18,"tag":155,"props":156,"children":158},"h3",{"id":157},"_21-更新系统",[159],{"type":18,"tag":40,"props":160,"children":161},{},[162],{"type":24,"value":163},"2.1 更新系统",{"type":18,"tag":58,"props":165,"children":167},{"code":166},"sudo apt update\nsudo apt upgrade\nsudo apt autoremove\nsudo apt autoclean\nsudo apt clean\n",[168],{"type":18,"tag":63,"props":169,"children":170},{"__ignoreMap":7},[171],{"type":24,"value":166},{"type":18,"tag":26,"props":173,"children":174},{},[175],{"type":18,"tag":40,"props":176,"children":177},{},[178],{"type":24,"value":179},"2.2 创建目录",{"type":18,"tag":26,"props":181,"children":182},{},[183],{"type":24,"value":184},"创建目录用户存储后续的虚拟环境和代码",{"type":18,"tag":58,"props":186,"children":188},{"code":187},"mkdir pyenvs\nmkdir codes\n",[189],{"type":18,"tag":63,"props":190,"children":191},{"__ignoreMap":7},[192],{"type":24,"value":187},{"type":18,"tag":26,"props":194,"children":195},{},[196],{"type":18,"tag":40,"props":197,"children":198},{},[199],{"type":24,"value":200},"2.3 更新cmake",{"type":18,"tag":26,"props":202,"children":203},{},[204],{"type":24,"value":205},"系统自带的cmake版本较低，无法满足后续的一些操作，故升级。",{"type":18,"tag":26,"props":207,"children":208},{},[209],{"type":24,"value":210},"注意事项：",{"type":18,"tag":91,"props":212,"children":213},{},[214],{"type":18,"tag":95,"props":215,"children":216},{},[217],{"type":24,"value":218},"在服务器端使用wget下载cmake源码可能速度太慢，建议本地下载好之后上传到服务器",{"type":18,"tag":58,"props":220,"children":222},{"code":221},"sudo apt autoremove cmakecd ~/codeswget https://github.com/Kitware/CMake/archive/refs/tags/v3.20.1.tar.gzscp v3.20.1.tar.gz root@124.71.78.174:/root/codes/tar -zxvf v3.20.1.tar.gzCMake-3.20.1/./bootstrapmakesudo make install\n",[223],{"type":18,"tag":63,"props":224,"children":225},{"__ignoreMap":7},[226],{"type":24,"value":221},{"type":18,"tag":155,"props":228,"children":230},{"id":229},"_24-安装gflags",[231],{"type":18,"tag":40,"props":232,"children":233},{},[234],{"type":24,"value":235},"2.4 安装gflags",{"type":18,"tag":26,"props":237,"children":238},{},[239],{"type":24,"value":240},"后续的一些编译工作需要用到gflags",{"type":18,"tag":58,"props":242,"children":244},{"code":243},"cd ~/codes\nwget https://github.com/gflags/gflags/archive/refs/tags/v2.2.2.tar.gz\nscp v2.2.2.tar.gz root@124.71.78.174:/root/codes/\ntar -zxvf v2.2.2.tar.gz\ncd gflags-2.2.2/\nmkdir build && cd build\nexport CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0\ncmake .. -DBUILD_SHARED_LIBS=ON\nmake -j 10\nsudo make install\n",[245],{"type":18,"tag":63,"props":246,"children":247},{"__ignoreMap":7},[248],{"type":24,"value":243},{"type":18,"tag":26,"props":250,"children":251},{},[252],{"type":18,"tag":40,"props":253,"children":254},{},[255,257,265],{"type":24,"value":256},"2.5 更新",{"type":18,"tag":40,"props":258,"children":259},{},[260],{"type":18,"tag":40,"props":261,"children":262},{},[263],{"type":24,"value":264},"昇腾硬件平台",{"type":24,"value":266},"驱动及工具包",{"type":18,"tag":26,"props":268,"children":269},{},[270],{"type":24,"value":271},"本文因条件限制采用社区版",{"type":18,"tag":26,"props":273,"children":274},{},[275],{"type":24,"value":276},"社区版下载地址如下：",{"type":18,"tag":155,"props":278,"children":280},{"id":279},"昇腾硬件平台驱动下载地址",[281],{"type":18,"tag":40,"props":282,"children":283},{},[284],{"type":24,"value":285},"昇腾硬件平台****驱动下载地址：",{"type":18,"tag":26,"props":287,"children":288},{},[289],{"type":18,"tag":290,"props":291,"children":292},"em",{},[293],{"type":18,"tag":121,"props":294,"children":297},{"href":295,"rel":296},"https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fwww.hiascend.com%2Fhardware%2Ffirmware-drivers%3Ftag%3Dcommunity",[125],[298],{"type":24,"value":295},{"type":18,"tag":155,"props":300,"children":302},{"id":301},"昇腾硬件平台工具包下载地址",[303],{"type":18,"tag":40,"props":304,"children":305},{},[306],{"type":24,"value":307},"昇腾硬件平台工****具包下载地址：",{"type":18,"tag":26,"props":309,"children":310},{},[311],{"type":18,"tag":290,"props":312,"children":313},{},[314],{"type":18,"tag":121,"props":315,"children":318},{"href":316,"rel":317},"https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fwww.hiascend.com%2Fsoftware%2Fcann%2Fcommunity",[125],[319],{"type":24,"value":316},{"type":18,"tag":26,"props":321,"children":322},{},[323],{"type":24,"value":210},{"type":18,"tag":26,"props":325,"children":326},{},[327],{"type":24,"value":328},"如果具备商业版下载条件，建议下载商业版。",{"type":18,"tag":26,"props":330,"children":331},{},[332],{"type":18,"tag":40,"props":333,"children":334},{},[335],{"type":24,"value":336},"商业版驱动下载地址：",{"type":18,"tag":26,"props":338,"children":339},{},[340],{"type":18,"tag":290,"props":341,"children":342},{},[343],{"type":18,"tag":121,"props":344,"children":347},{"href":345,"rel":346},"https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fwww.hiascend.com%2Fhardware%2Ffirmware-drivers%3Ftag%3Dcommercial",[125],[348],{"type":24,"value":345},{"type":18,"tag":26,"props":350,"children":351},{},[352],{"type":18,"tag":40,"props":353,"children":354},{},[355],{"type":24,"value":356},"商业版工具包下载地址：",{"type":18,"tag":26,"props":358,"children":359},{},[360],{"type":18,"tag":290,"props":361,"children":362},{},[363],{"type":18,"tag":121,"props":364,"children":367},{"href":365,"rel":366},"https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fwww.hiascend.com%2Fzh%2Fsoftware%2Fcann%2Fcommercial",[125],[368],{"type":24,"value":365},{"type":18,"tag":370,"props":371,"children":373},"h4",{"id":372},"_251-昇腾硬件平台相关文件下载",[374,379,381],{"type":18,"tag":40,"props":375,"children":376},{},[377],{"type":24,"value":378},"2.5.1",{"type":24,"value":380}," ",{"type":18,"tag":40,"props":382,"children":383},{},[384],{"type":24,"value":385},"昇腾硬件平台****相关文件下载",{"type":18,"tag":26,"props":387,"children":388},{},[389],{"type":24,"value":210},{"type":18,"tag":91,"props":391,"children":392},{},[393],{"type":18,"tag":95,"props":394,"children":395},{},[396],{"type":24,"value":397},"建议本地下载完成相应文件后，上传到服务器",{"type":18,"tag":26,"props":399,"children":400},{},[401],{"type":24,"value":402},"驱动文件如下图所示。",{"type":18,"tag":26,"props":404,"children":405},{},[406],{"type":18,"tag":30,"props":407,"children":409},{"alt":7,"src":408},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/01/22/809857f57df9489ca93966d5f2cb3c7f.jpg",[],{"type":18,"tag":26,"props":411,"children":412},{},[413],{"type":24,"value":414},"工具包文件如下图所示",{"type":18,"tag":26,"props":416,"children":417},{},[418],{"type":18,"tag":30,"props":419,"children":421},{"alt":7,"src":420},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/01/22/90db30ceb96a4e7e90a2b237332a0a81.jpg",[],{"type":18,"tag":370,"props":423,"children":425},{"id":424},"_252-驱动更新",[426],{"type":18,"tag":40,"props":427,"children":428},{},[429],{"type":24,"value":430},"2.5.2 驱动更新",{"type":18,"tag":26,"props":432,"children":433},{},[434],{"type":24,"value":435},"本文上传到了服务器root账户的install文件夹下",{"type":18,"tag":26,"props":437,"children":438},{},[439],{"type":24,"value":440},"进入安装文件所在目录",{"type":18,"tag":58,"props":442,"children":444},{"code":443},"cd ~/install\n",[445],{"type":18,"tag":63,"props":446,"children":447},{"__ignoreMap":7},[448],{"type":24,"value":443},{"type":18,"tag":26,"props":450,"children":451},{},[452],{"type":24,"value":453},"安装驱动",{"type":18,"tag":58,"props":455,"children":457},{"code":456},"# wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/5.0.4.alpha003/Ascend-cann-toolkit_5.0.4.alpha003_linux-x86_64.run\nchmod a+x A300-3010-npu-driver_21.0.3.1_linux-x86_64.run\nsudo ./A300-3010-npu-driver_21.0.3.1_linux-x86_64.run --upgrade\n",[458],{"type":18,"tag":63,"props":459,"children":460},{"__ignoreMap":7},[461],{"type":24,"value":456},{"type":18,"tag":26,"props":463,"children":464},{},[465],{"type":24,"value":466},"驱动安装输出如下内容",{"type":18,"tag":58,"props":468,"children":470},{"code":469},"Verifying archive integrity...  100%   SHA256 checksums are OK. All good.\nUncompressing npu-driver-run-package  100%\n[Driver] [2021-12-16 16:12:38] [INFO]Start time: 2021-12-16 16:12:38\n[Driver] [2021-12-16 16:12:38] [INFO]LogFile: /var/log/ascend_seclog/ascend_install.log\n[Driver] [2021-12-16 16:12:38] [INFO]OperationLogFile: /var/log/ascend_seclog/operation.log\n[Driver] [2021-12-16 16:12:38] [INFO]base version is 20.1.0.\n[Driver] [2021-12-16 16:12:38] [WARNING]Do not power off or restart the system during the installation/upgrade\n[Driver] [2021-12-16 16:12:38] [INFO]set username and usergroup, HwHiAiUser:HwHiAiUser\ndeleting install files...\nremove install files successfully!\ndeleting installed folders...\nremove install folders successfully!\n[Driver] [2021-12-16 16:12:45] [INFO]driver install type: DKMS\n[Driver] [2021-12-16 16:12:45] [INFO]upgradePercentage:10%\n[Driver] [2021-12-16 16:12:48] [INFO]upgradePercentage:30%\n[Driver] [2021-12-16 16:12:48] [INFO]upgradePercentage:40%\n[Driver] [2021-12-16 16:13:35] [INFO]upgradePercentage:90%\n[Driver] [2021-12-16 16:13:35] [INFO]upgradePercentage:100%\n[Driver] [2021-12-16 16:13:35] [INFO]Driver package upgrade success! Reboot needed for installation/upgrade to take effect!\n[Driver] [2021-12-16 16:13:35] [INFO]End time: 2021-12-16 16:13:35\n",[471],{"type":18,"tag":63,"props":472,"children":473},{"__ignoreMap":7},[474],{"type":24,"value":469},{"type":18,"tag":370,"props":476,"children":478},{"id":477},"_253-工具包更新",[479],{"type":18,"tag":40,"props":480,"children":481},{},[482],{"type":24,"value":483},"2.5.3 工具包更新",{"type":18,"tag":26,"props":485,"children":486},{},[487],{"type":24,"value":488},"配置python环境",{"type":18,"tag":58,"props":490,"children":492},{"code":491},"cd /usr/local/bin\nln -s /usr/local/python3.7.5/bin/pip3\n",[493],{"type":18,"tag":63,"props":494,"children":495},{"__ignoreMap":7},[496],{"type":24,"value":491},{"type":18,"tag":26,"props":498,"children":499},{},[500],{"type":24,"value":501},"安装工具包",{"type":18,"tag":58,"props":503,"children":505},{"code":504},"cd ~/install\nchmod a+x Ascend-cann-toolkit_5.0.4.alpha003_linux-x86_64.run\nsudo ./Ascend-cann-toolkit_5.0.4.alpha003_linux-x86_64.run --upgrade\n",[506],{"type":18,"tag":63,"props":507,"children":508},{"__ignoreMap":7},[509],{"type":24,"value":504},{"type":18,"tag":26,"props":511,"children":512},{},[513],{"type":24,"value":514},"工具包安装输出如下内容",{"type":18,"tag":58,"props":516,"children":518},{"code":517},"Verifying archive integrity...  100%   SHA256 checksums are OK. All good.\nUncompressing ASCEND_RUN_PACKAGE  100%\n[Toolkit] [20211216-16:20:33] [INFO] LogFile:/var/log/ascend_seclog/ascend_toolkit_install.log\n[Toolkit] [20211216-16:20:33] [INFO] upgrade start\n[Toolkit] [20211216-16:21:56] [INFO] Ascend-fwkacllib-1.75.22.0.220-linux.x86_64.run uninstall start\n[Fwkacllib] [2021-12-16 16:21:56] [INFO]: Start time:2021-12-16 16:21:56\n[Fwkacllib] [2021-12-16 16:21:56] [INFO]: LogFile:/var/log/ascend_seclog/ascend_install.log\n[Fwkacllib] [2021-12-16 16:21:56] [INFO]: InputParams:--uninstall\n[Fwkacllib] [2021-12-16 16:21:56] [INFO]: uninstall /usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux full\n[Fwkacllib] [2021-12-16 16:22:00] [INFO]: Fwkacllib package uninstall success! Uninstallation takes effect immediately.\n[Fwkacllib] [2021-12-16 16:22:00] [INFO]: End time:2021-12-16 16:22:00\n[Toolkit] [20211216-16:22:00] [INFO] rm soft link fwkacllib\n[Toolkit] [20211216-16:22:00] [INFO] Ascend-toolkit-1.75.22.0.220-linux.x86_64.run uninstall start\n[INFO] LogFile: /var/log/ascend_seclog/ascend_install.log\n[INFO] OperationLogFile: /var/log/ascend_seclog/operation.log\n[INFO] InputParams: --quiet\n[INFO] base version is 1.75.22.0.220.\n2021-12-16,16:22:00 [INFO] [MSVP] install_profiling_hiprof.sh: Begin to uninstall profiling...\n2021-12-16,16:22:00 [INFO] [MSVP] install_profiling_hiprof.sh: Begin to stop profiling...\n2021-12-16,16:22:00 [INFO] [MSVP] install_profiling_hiprof.sh: Stop profiler success\n2021-12-16,16:22:00 [INFO] [MSVP] install_profiling_hiprof.sh: Uninstall profiling success.\ndeleting install files...\nremove install files successfully!\ndeleting installed folders...\nremove install folders successfully!\n[INFO] Toolkit package uninstall success! Uninstallation takes effect immediately.\n[Toolkit] [20211216-16:22:07] [INFO] rm soft link toolkit\n[Toolkit] [20211216-16:22:07] [INFO] Ascend-opp-1.75.22.0.220-linux.x86_64.run uninstall start\n[opp] [INFO]:Execute the opp run package.\n[opp] [INFO]:OperationLogFile path: /var/log/ascend_seclog/ascend_install.log.\n[opp] [INFO]:Input params: --uninstall --install-path=/usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux --quiet\n[opp] [INFO]:Begin uninstall the opp module.\n[opp] [INFO]:Delete the ops soft link (/usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux/ops).\n[opp] [INFO]:Delete the installed opp source files in (/usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux).\n[opp] [INFO]:Delete the version info file (/usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux/opp/version.info).\n[opp] [INFO]:Delete the install info file (/usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux/opp/ascend_install.info).\n[opp] [INFO]:Opp package uninstall success! Uninstallation takes effect immediately.\nInstall MAJOR root 2021-12-16 16:22:09 xxx.xxx.xxx..xxx OPP success install_type=full; cmdlist=--uninstall --install-path=/usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux --quiet.\n[Toolkit] [20211216-16:22:09] [INFO] rm soft link opp\n[Toolkit] [20211216-16:22:09] [INFO] Ascend-atc-1.75.22.0.220-linux.x86_64.run uninstall start\n[Atc] [2021-12-16 16:22:09] [INFO]: Start time:2021-12-16 16:22:09\n[Atc] [2021-12-16 16:22:09] [INFO]: LogFile:/var/log/ascend_seclog/ascend_install.log\n[Atc] [2021-12-16 16:22:09] [INFO]: InputParams:--uninstall\n[Atc] [2021-12-16 16:22:09] [INFO]: uninstall /usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux full\n[Atc] [2021-12-16 16:22:11] [INFO]: Atc package uninstall success! Uninstallation takes effect immediately.\n[Atc] [2021-12-16 16:22:11] [INFO]: End time:2021-12-16 16:22:11\n[Toolkit] [20211216-16:22:11] [INFO] rm soft link atc\n[Toolkit] [20211216-16:22:11] [INFO] Ascend-pyACL-20.1.rc1-linux.x86_64.run uninstall start\n[Toolkit] [20211216-16:22:11] [INFO] rm soft link pyACL\n[Toolkit] [20211216-16:22:11] [INFO] Ascend-acllib-1.75.22.0.220-linux.x86_64.run uninstall start\n[Acllib] [2021-12-16 16:22:11] [INFO]: Start time:2021-12-16 16:22:11\n[Acllib] [2021-12-16 16:22:11] [INFO]: LogFile:/var/log/ascend_seclog/ascend_install.log\n[Acllib] [2021-12-16 16:22:11] [INFO]: InputParams:--uninstall\n[Acllib] [2021-12-16 16:22:11] [INFO]: uninstall /usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux full\n[Acllib] [2021-12-16 16:22:11] [INFO]: step into run_acllib_uninstall.sh ......\n[Acllib] [2021-12-16 16:22:11] [INFO]: uninstall targetdir /usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux, type full.\n[Acllib] [2021-12-16 16:22:12] [INFO]: Acllib package uninstall success! Uninstallation takes effect immediately.\n[Acllib] [2021-12-16 16:22:12] [INFO]: End time:2021-12-16 16:22:12\n[Toolkit] [20211216-16:22:12] [INFO] rm soft link acllib_linux.x86_64\n[Toolkit] [20211216-16:22:12] [INFO] rm soft link acllib\n[Toolkit] [20211216-16:22:12] [INFO] /usr/local/Ascend/ascend-toolkit not empty\n[Toolkit] [20211216-16:22:12] [INFO] toolkit uninstall success\n[Toolkit] [20211216-16:22:12] [INFO] process end\n[Toolkit] [20211216-16:22:12] [INFO] upgrade package CANN-runtime-5.0.4.alpha003-linux.x86_64.run start\n[Toolkit] [20211216-16:22:13] [INFO] CANN-runtime-5.0.4.alpha003-linux.x86_64.run --full --quiet --nox11 --install-path=/usr/local/Ascend/ascend-toolkit/5.0.4.alpha003/x86_64-linux --install-for-all upgrade success\n[Toolkit] [20211216-16:22:13] [INFO] upgrade package CANN-compiler-5.0.4.alpha003-linux.x86_64.run start\nWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\nWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\nWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\nWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\nWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\n[Toolkit] [20211216-16:22:53] [INFO] CANN-compiler-5.0.4.alpha003-linux.x86_64.run --full --pylocal --quiet --nox11 --install-path=/usr/local/Ascend/ascend-toolkit/5.0.4.alpha003/x86_64-linux --install-for-all upgrade success\n[Toolkit] [20211216-16:22:53] [INFO] upgrade package CANN-opp-5.0.4.alpha003-linux.x86_64.run start\n[Toolkit] [20211216-16:23:16] [INFO] CANN-opp-5.0.4.alpha003-linux.x86_64.run --full --quiet --nox11 --install-path=/usr/local/Ascend/ascend-toolkit/5.0.4.alpha003/x86_64-linux --install-for-all upgrade success\n[Toolkit] [20211216-16:23:16] [INFO] upgrade package CANN-toolkit-5.0.4.alpha003-linux.x86_64.run start\n[Toolkit] [20211216-16:23:55] [INFO] CANN-toolkit-5.0.4.alpha003-linux.x86_64.run --full --pylocal --quiet --nox11 --install-path=/usr/local/Ascend/ascend-toolkit/5.0.4.alpha003/x86_64-linux --install-for-all upgrade success\n[Toolkit] [20211216-16:23:55] [INFO] upgrade package Ascend-mindstudio-toolkit_3.0.3.B120_linux-x86_64.run start\n[Toolkit] [20211216-16:23:56] [INFO] Ascend-mindstudio-toolkit_3.0.3.B120_linux-x86_64.run --full --quiet --nox11 --install-path=/usr/local/Ascend/ascend-toolkit/5.0.4.alpha003/x86_64-linux --install-for-all upgrade success\n[Toolkit] [20211216-16:23:56] [INFO] upgrade package Ascend-test-ops_5.0.3_linux.run start\n[Toolkit] [20211216-16:23:56] [INFO] Ascend-test-ops_5.0.3_linux.run --full --quiet --nox11 --install-path=/usr/local/Ascend/ascend-toolkit/5.0.4.alpha003/x86_64-linux --install-for-all upgrade success\n[Toolkit] [20211216-16:23:56] [INFO] upgrade package Ascend-pyACL_5.0.3_linux-x86_64.run start\n[Toolkit] [20211216-16:23:56] [INFO] Ascend-pyACL_5.0.3_linux-x86_64.run --full --quiet --nox11 --install-path=/usr/local/Ascend/ascend-toolkit/5.0.4.alpha003/x86_64-linux --install-for-all upgrade success\n[Toolkit] [20211216-16:23:57] [INFO] /etc/Ascend/ascend_cann_install.info generate success\n[Toolkit] [20211216-16:23:57] [INFO] Please make sure that:\nPATH includes :\n  /usr/local/Ascend/ascend-toolkit/latest/bin:\n  /usr/local/Ascend/ascend-toolkit/latest/compiler/ccec_compiler/bin:\nLD_LIBRARY_PATH includes :\n  /usr/local/Ascend/ascend-toolkit/latest/lib64:\n  /usr/local/Ascend/ascend-toolkit/latest/compiler/lib64/plugin/opskernel:\n  /usr/local/Ascend/ascend-toolkit/latest/compiler/lib64/plugin/nnengine:\nPYTHONPATH includes :\n  /usr/local/Ascend/ascend-toolkit/latest/python/site-packages:\n  /usr/local/Ascend/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe:\nASCEND_AICPU_PATH includes :\n  /usr/local/Ascend/ascend-toolkit/latest:\nASCEND_OPP_PATH includes :\n  /usr/local/Ascend/ascend-toolkit/latest/opp:\nTOOLCHAIN_HOME includes :\n  /usr/local/Ascend/ascend-toolkit/latest/toolkit:\nASCEND_AUTOML_PATH includes :\n  /usr/local/Ascend/latest/tools:\n[Toolkit] [20211216-16:23:57] [INFO] If your service is started using the shell script, you can call the /usr/local/Ascend/ascend-toolkit/set_env.sh script to configure environment variables. Note that this script can not be executed mannually.\n[Toolkit] [20211216-16:23:57] [INFO] Ascend-cann-toolkit_5.0.4.alpha003_linux-x86_64 upgrade success,The install path is /usr/local/Ascend !\n",[519],{"type":18,"tag":63,"props":520,"children":521},{"__ignoreMap":7},[522],{"type":24,"value":517},{"type":18,"tag":26,"props":524,"children":525},{},[526],{"type":18,"tag":40,"props":527,"children":528},{},[529],{"type":24,"value":530},"2.5.4 设置环境变量",{"type":18,"tag":26,"props":532,"children":533},{},[534],{"type":24,"value":535},"新新版本工具包生成的环境变量文件复制到指定目录，便于使用",{"type":18,"tag":58,"props":537,"children":539},{"code":538},"mkdir ~/scripts\ncp /usr/local/Ascend/ascend-toolkit/set_env.sh ~/scripts/\n",[540],{"type":18,"tag":63,"props":541,"children":542},{"__ignoreMap":7},[543],{"type":24,"value":538},{"type":18,"tag":370,"props":545,"children":547},{"id":546},"_255-安装amct工具可跳过",[548],{"type":18,"tag":40,"props":549,"children":550},{},[551],{"type":24,"value":552},"2.5.5 安装amct工具（可跳过）",{"type":18,"tag":26,"props":554,"children":555},{},[556],{"type":24,"value":557},"在使用昇腾硬件平台和MindSpore进行量化推理时，会用到该工具。但笔者尚未在社区版找到可用版本，仅商业版支持。",{"type":18,"tag":26,"props":559,"children":560},{},[561],{"type":24,"value":562},"下面仅给出相关工具包下载地址，安装过程暂略。",{"type":18,"tag":26,"props":564,"children":565},{},[566,568],{"type":24,"value":567},"Ascend-cann-amct_1.76.22.10.220_ubuntu18.04-x86_64.tar.gz（_",{"type":18,"tag":121,"props":569,"children":572},{"href":570,"rel":571},"https://support.huawei.com/enterprise/zh/software/251707127-ESW2000346859_%EF%BC%89",[125],[573],{"type":24,"value":574},"https://support.huawei.com/enterprise/zh/software/251707127-ESW2000346859_）",{"type":18,"tag":26,"props":576,"children":577},{},[578],{"type":18,"tag":40,"props":579,"children":580},{},[581],{"type":24,"value":582},"3 MindSpore安装",{"type":18,"tag":155,"props":584,"children":586},{"id":585},"_31-设置python环境",[587],{"type":18,"tag":40,"props":588,"children":589},{},[590],{"type":24,"value":591},"3.1 设置python环境",{"type":18,"tag":26,"props":593,"children":594},{},[595],{"type":24,"value":596},"主要设置pip和virtualenv",{"type":18,"tag":58,"props":598,"children":600},{"code":599},"pip3 install --upgrade pip3\npip3 config set global.index-url \npip3 install virtualenv\n",[601],{"type":18,"tag":63,"props":602,"children":603},{"__ignoreMap":7},[604],{"type":24,"value":599},{"type":18,"tag":155,"props":606,"children":608},{"id":607},"_32-安装mindspore",[609],{"type":18,"tag":40,"props":610,"children":611},{},[612],{"type":24,"value":613},"3.2 安装MindSpore",{"type":18,"tag":58,"props":615,"children":617},{"code":616},"cd ~/pyenvs\nvirtualenv -p python3 env_mindspore_ascend_1.5.0\nsource env_mindspore_ascend_1.5.0/bin/activate\npip3 list\n\nPackage         Version\n--------------- -------\nauto-tune       0.1.0\nhccl            0.1.0\nop-gen          0.1\nop-test-frame   0.1\npip             21.3.1\nschedule-search 0.0.1\nsetuptools      58.3.0\nte              0.4.0\ntopi            0.4.0\nwheel           0.37.0\n\npip3 install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/ascend/x86_64/mindspore_ascend-1.5.0-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple\n",[618],{"type":18,"tag":63,"props":619,"children":620},{"__ignoreMap":7},[621],{"type":24,"value":616},{"type":18,"tag":26,"props":623,"children":624},{},[625],{"type":18,"tag":40,"props":626,"children":627},{},[628],{"type":24,"value":629},"4 MindSpore测试",{"type":18,"tag":155,"props":631,"children":633},{"id":632},"_41-安装缺失环境",[634],{"type":18,"tag":40,"props":635,"children":636},{},[637],{"type":24,"value":638},"4.1 安装缺失环境",{"type":18,"tag":58,"props":640,"children":642},{"code":641},"pip3 install decorator\npip3 install sympy\n",[643],{"type":18,"tag":63,"props":644,"children":645},{"__ignoreMap":7},[646],{"type":24,"value":641},{"type":18,"tag":26,"props":648,"children":649},{},[650],{"type":18,"tag":40,"props":651,"children":652},{},[653],{"type":24,"value":654},"4.2 测试是否安装成功",{"type":18,"tag":26,"props":656,"children":657},{},[658],{"type":24,"value":659},"下载测试代码并编译",{"type":18,"tag":58,"props":661,"children":663},{"code":662},"cd ~/codes\nwget --no-check-certificate https://obs.dualstack.cn-north-4.myhuaweicloud.com/mindspore-website/sample_resources/ascend310_single_op_sample.zip\nunzip -x ascend310_single_op_sample.zip\ncmake . -DMINDSPORE_PATH=`pip3 show mindspore-ascend | grep Location | awk '{print $2\"/mindspore\"}' | xargs realpath`\nmake\n",[664],{"type":18,"tag":63,"props":665,"children":666},{"__ignoreMap":7},[667],{"type":24,"value":662},{"type":18,"tag":26,"props":669,"children":670},{},[671],{"type":24,"value":672},"测试命令如下",{"type":18,"tag":58,"props":674,"children":676},{"code":675},"./tensor_add_sample\n",[677],{"type":18,"tag":63,"props":678,"children":679},{"__ignoreMap":7},[680],{"type":24,"value":675},{"type":18,"tag":26,"props":682,"children":683},{},[684],{"type":24,"value":685},"如果安装成功，会输出如下内容",{"type":18,"tag":58,"props":687,"children":689},{"code":688},"3\n5\n7\n9\n",[690],{"type":18,"tag":63,"props":691,"children":692},{"__ignoreMap":7},[693],{"type":24,"value":688},{"type":18,"tag":26,"props":695,"children":696},{},[697],{"type":24,"value":698},"本文主要介绍了在昇腾硬件平台上配置安装MindSpore，及对其进行简单测试的相关操作。",{"type":18,"tag":26,"props":700,"children":701},{},[702],{"type":24,"value":703},"参考资料：",{"type":18,"tag":26,"props":705,"children":706},{},[707,709],{"type":24,"value":708},"[1] 弹性云服务器--AI加速型：",{"type":18,"tag":121,"props":710,"children":713},{"href":711,"rel":712},"https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsupport.huaweicloud.com%2Fproductdesc-ecs%2Fecs%5C_01%5C_0047.html",[125],[714],{"type":24,"value":715},"https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fsupport.huaweicloud.com%2Fproductdesc-ecs%2Fecs\\_01\\_0047.html",{"type":18,"tag":26,"props":717,"children":718},{},[719,721],{"type":24,"value":720},"[2] amct量化工具包中没有sample文件：",{"type":18,"tag":121,"props":722,"children":725},{"href":723,"rel":724},"https://toscode.gitee.com/ascend/modelzoo/issues/I4HA8A",[125],[726],{"type":24,"value":723},{"type":18,"tag":26,"props":728,"children":729},{},[730],{"type":18,"tag":40,"props":731,"children":732},{},[733],{"type":24,"value":734},"欢迎投稿",{"type":18,"tag":26,"props":736,"children":737},{},[738],{"type":18,"tag":40,"props":739,"children":740},{},[741,743,751],{"type":24,"value":742},"欢迎大家踊跃投稿，有想投稿技术干货、项目经验等分享的同学，可以添加MindSpore官方小助手：小猫子（",{"type":18,"tag":40,"props":744,"children":745},{},[746],{"type":18,"tag":40,"props":747,"children":748},{},[749],{"type":24,"value":750},"mindspore0328",{"type":24,"value":752},"）的微信，告诉猫哥哦！",{"type":18,"tag":26,"props":754,"children":755},{},[756,761,762,767,769,777],{"type":18,"tag":40,"props":757,"children":758},{},[759],{"type":24,"value":760},"昇思MindSpore官方交流QQ群 :",{"type":24,"value":380},{"type":18,"tag":40,"props":763,"children":764},{},[765],{"type":24,"value":766},"486831414",{"type":24,"value":768},"**（",{"type":18,"tag":40,"props":770,"children":771},{},[772],{"type":18,"tag":40,"props":773,"children":774},{},[775],{"type":24,"value":776},"群里有很多技术大咖助力答疑！",{"type":24,"value":778},"）**",{"type":18,"tag":26,"props":780,"children":781},{},[782],{"type":18,"tag":30,"props":783,"children":785},{"alt":7,"src":784},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/01/22/9e5170f509764809920800a985f6cef2.jpg",[],{"type":18,"tag":26,"props":787,"children":788},{},[789],{"type":18,"tag":40,"props":790,"children":791},{},[792],{"type":24,"value":793},"官方QQ群号 : 486831414",{"type":18,"tag":26,"props":795,"children":796},{},[797],{"type":18,"tag":40,"props":798,"children":799},{},[800],{"type":24,"value":801},"微信小助手：mindspore0328",{"type":18,"tag":155,"props":803,"children":805},{"id":804},"扫描下方二维码加入mindspore项目",[806],{"type":24,"value":807},"扫描下方二维码加入MindSpore项目",{"type":18,"tag":26,"props":809,"children":810},{},[811],{"type":18,"tag":30,"props":812,"children":814},{"alt":7,"src":813},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/01/09/984c702452434b10817b9084c6a2cee6.jpg",[],{"type":18,"tag":155,"props":816,"children":817},{"id":7},[],{"type":18,"tag":26,"props":819,"children":820},{},[821],{"type":18,"tag":121,"props":822,"children":825},{"href":823,"rel":824},"http://mp.weixin.qq.com/s?__biz=MzAxMDA1MDM0NQ==&mid=2247541446&idx=1&sn=f397c4aadf6313efe8c16d15cec8db3d&chksm=9b542c80ac23a596935839754dc4690c6c0a20319c1bb23c67bc3bd7b527c8cf6d3c1efcc9a9&scene=21#wechat_redirect",[125],[826],{"type":24,"value":827},"MindSpore官方资料",{"type":18,"tag":26,"props":829,"children":830},{},[831],{"type":18,"tag":121,"props":832,"children":834},{"href":823,"rel":833},[125],[835],{"type":24,"value":836},"GitHub : https://github.com/mindspore-ai/mindspore",{"type":18,"tag":26,"props":838,"children":839},{},[840],{"type":18,"tag":121,"props":841,"children":843},{"href":823,"rel":842},[125],[844],{"type":24,"value":845},"Gitee : https : //gitee.com/mindspore/mindspore",{"type":18,"tag":26,"props":847,"children":848},{},[849],{"type":18,"tag":121,"props":850,"children":852},{"href":823,"rel":851},[125],[853],{"type":24,"value":854},"官方QQ群 : 486831414",{"title":7,"searchDepth":856,"depth":856,"links":857},4,[858,860,861,862,869,870,871,872,873],{"id":157,"depth":859,"text":163},3,{"id":229,"depth":859,"text":235},{"id":279,"depth":859,"text":285},{"id":301,"depth":859,"text":307,"children":863},[864,866,867,868],{"id":372,"depth":856,"text":865},"2.5.1 昇腾硬件平台****相关文件下载",{"id":424,"depth":856,"text":430},{"id":477,"depth":856,"text":483},{"id":546,"depth":856,"text":552},{"id":585,"depth":859,"text":591},{"id":607,"depth":859,"text":613},{"id":632,"depth":859,"text":638},{"id":804,"depth":859,"text":807},{"id":7,"depth":859,"text":7},"markdown","content:technology-blogs:zh:957.md","content","technology-blogs/zh/957.md","technology-blogs/zh/957","md",1776506142472]