[{"data":1,"prerenderedAt":162},["ShallowReactive",2],{"content-query-RrTZAXq6Hh":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":156,"_id":157,"_source":158,"_file":159,"_stem":160,"_extension":161},"/technology-blogs/zh/802","zh",false,"","MindSpore GPU版本安装指导","根据操作系统版本和MindSpore版本选择对应的CUDA  Toolkit版本进行安装","2021-11-27","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/11/27/729d3ea443d74c4cab9a6bc197338f4e.png","technology-blogs","开发者分享",{"type":15,"children":16,"toc":153},"root",[17,25,31,36,41,46,51,64,69,77,82,87,92,97,104,109,114,127,134,139,146],{"type":18,"tag":19,"props":20,"children":22},"element","h1",{"id":21},"mindspore-gpu版本安装指导",[23],{"type":24,"value":8},"text",{"type":18,"tag":26,"props":27,"children":28},"p",{},[29],{"type":24,"value":30},"MindSpore GPU软件包依赖Nvidia GPU驱动，CUDA runtime以及CUDNN库",{"type":18,"tag":26,"props":32,"children":33},{},[34],{"type":24,"value":35},"当前MindSpore-GPU适配了CUDA 10.1和CUDA 11.1两个版本，可以根据操作系统版本和MindSpore版本选择对应的CUDA Toolkit版本进行安装。",{"type":18,"tag":26,"props":37,"children":38},{},[39],{"type":24,"value":40},"接下来以CUDA11.1 + CUDNN8.0为例，介绍如何安装上述软件",{"type":18,"tag":26,"props":42,"children":43},{},[44],{"type":24,"value":45},"1、Nvidia GPU驱动和CUDA runtime可以通过CUDA Toolkit安装：",{"type":18,"tag":26,"props":47,"children":48},{},[49],{"type":24,"value":50},"1）下载CUDA Toolkit",{"type":18,"tag":26,"props":52,"children":53},{},[54,56],{"type":24,"value":55},"下载路径：",{"type":18,"tag":57,"props":58,"children":62},"a",{"href":59,"rel":60},"https://developer.nvidia.com/cuda-11.1.1-download-archive",[61],"nofollow",[63],{"type":24,"value":59},{"type":18,"tag":26,"props":65,"children":66},{},[67],{"type":24,"value":68},"如下所示，当选择Ubuntu18.04版本的runfile之后，Base installer中会给出下载的路径以及安装命令",{"type":18,"tag":26,"props":70,"children":71},{},[72],{"type":18,"tag":73,"props":74,"children":76},"img",{"alt":7,"src":75},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202111/16/1713290m4n3wzcqtccj80a.png",[],{"type":18,"tag":26,"props":78,"children":79},{},[80],{"type":24,"value":81},"2）安装CUDA Toolkit",{"type":18,"tag":26,"props":83,"children":84},{},[85],{"type":24,"value":86},"sudo sh cuda_11.1.1_455.32.00_linux.run",{"type":18,"tag":26,"props":88,"children":89},{},[90],{"type":24,"value":91},"3）检查安装结果",{"type":18,"tag":26,"props":93,"children":94},{},[95],{"type":24,"value":96},"执行nvidia-smi命令，可以看到当前cuda驱动版本为455.32.00，CUDA版本是11.1，默认安装路径是/usr/local/cuda-11.1",{"type":18,"tag":26,"props":98,"children":99},{},[100],{"type":18,"tag":73,"props":101,"children":103},{"alt":7,"src":102},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202111/16/171441veki6exlaky78r2q.png",[],{"type":18,"tag":26,"props":105,"children":106},{},[107],{"type":24,"value":108},"2、安装CUDNN",{"type":18,"tag":26,"props":110,"children":111},{},[112],{"type":24,"value":113},"CUDNN是Nvidia提供的能神经网络算子库",{"type":18,"tag":26,"props":115,"children":116},{},[117,119,125],{"type":24,"value":118},"下载CUNN之前需要完成账户注册（这里不再赘述），接下来在",{"type":18,"tag":57,"props":120,"children":123},{"href":121,"rel":122},"https://developer.nvidia.com/cudnn",[61],[124],{"type":24,"value":121},{"type":24,"value":126},"选择对应的CUDNN版本",{"type":18,"tag":26,"props":128,"children":129},{},[130],{"type":18,"tag":73,"props":131,"children":133},{"alt":7,"src":132},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202111/16/172723rxrysvxwsm9b5hsb.png",[],{"type":18,"tag":26,"props":135,"children":136},{},[137],{"type":24,"value":138},"下载解压后分别将include和lib64移动到/usr/local/cuda/include目录即完成安装：",{"type":18,"tag":26,"props":140,"children":141},{},[142],{"type":18,"tag":73,"props":143,"children":145},{"alt":7,"src":144},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202111/16/172433a7pgwcf3bfjljhwk.png",[],{"type":18,"tag":26,"props":147,"children":148},{},[149],{"type":18,"tag":73,"props":150,"children":152},{"alt":7,"src":151},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/202111/16/172349qb76mge5wztq5hux.png",[],{"title":7,"searchDepth":154,"depth":154,"links":155},4,[],"markdown","content:technology-blogs:zh:802.md","content","technology-blogs/zh/802.md","technology-blogs/zh/802","md",1776506141400]