{"id":177,"date":"2023-04-19T00:48:11","date_gmt":"2023-04-18T16:48:11","guid":{"rendered":"https:\/\/010421.xyz\/?p=177"},"modified":"2023-05-21T20:38:00","modified_gmt":"2023-05-21T12:38:00","slug":"%e3%80%90%e8%bd%af%e4%bb%b6%e5%ae%89%e8%a3%85%e3%80%91ubuntu22-04%e4%b8%8b%e6%b7%b1%e5%ba%a6%e5%ad%a6%e4%b9%a0%e7%8e%af%e5%a2%83%e5%ae%89%e8%a3%85%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/www.010421.xyz\/index.php\/2023\/04\/19\/%e3%80%90%e8%bd%af%e4%bb%b6%e5%ae%89%e8%a3%85%e3%80%91ubuntu22-04%e4%b8%8b%e6%b7%b1%e5%ba%a6%e5%ad%a6%e4%b9%a0%e7%8e%af%e5%a2%83%e5%ae%89%e8%a3%85%e6%8c%87%e5%8d%97\/","title":{"rendered":"\u3010\u8f6f\u4ef6\u5b89\u88c5\u3011Ubuntu22.04\u4e0b\u6df1\u5ea6\u5b66\u4e60\u73af\u5883\u5b89\u88c5\u6307\u5357"},"content":{"rendered":"\n<p>\u5047\u8bbe\uff0c\u73b0\u5728\u4f60\u7684\u7cfb\u7edf\u662f\u521a\u521a\u5b89\u88c5\u7684Ubuntu22.04\uff0c\u5efa\u8bae\u4f7f\u7528EFI\u542f\u52a8\uff0cBIOS\u542f\u52a8\u4e0b\u7f16\u8bd1\u7b2c\u4e09\u65b9\u5185\u6838\u6a21\u5757\u4f1a\u62a5\u7b7e\u540d\u9519\u8bef\uff0c\u4f60\u5728\u5b89\u88c5\u6df1\u5ea6\u5b66\u4e60\u73af\u5883\u7684\u65f6\u5019\uff0c\u53ef\u80fd\u9047\u5230\u4e00\u4e9b\u6211\u9047\u5230\u7684\u5751\uff0c\u6216\u8005\u4f60\u53ef\u4ee5\u76f4\u63a5\u6309\u7167\u6211\u7684\u5b89\u88c5\u6b65\u9aa4\u5b89\u88c5\u3002<\/p>\n\n\n\n<p>\u9996\u5148\uff0cTensorflow\u57282.10.1\uff08\u6700\u540e\u4e00\u4e2a\u652f\u6301\u7684\u7248\u672c\uff09\u4e4b\u540e\u5c31\u4e0d\u652f\u6301Windows\u539f\u751f\u7684\u57fa\u4e8eCUDA\u73af\u5883\u7684GPU\u52a0\u901f\u4e86\uff0cWindows\u73af\u5883\u7684\u540c\u5b66\uff0c\u53ef\u4ee5\u4f7f\u7528Tensorflow-gpu==2.10.1\uff1b\u5bf9\u4e8eLinux\u73af\u5883\u7684\u540c\u5b66\uff0cTensorflow\u57282.11.0\uff08\u6700\u540e\u4e00\u4e2aTensotflow-gpu\u7248\u672c\uff09\u4e4b\u540e\u5c31\u4e0d\u533a\u5206Tensotflow\u548cTensotflow-gpu\u4e86\uff08\u672c\u6587\u53d1\u8868\u4e8e2023\u5e744\u670819\u65e5\uff0c\u5982\u4e4b\u540eTensorflow\u91cd\u65b0\u652f\u6301Windows\u539f\u751f\u7684\u57fa\u4e8eCUDA\u73af\u5883\u7684GPU\u52a0\u901f\uff0c\u8bf7\u539f\u8c05\u6211\u672a\u80fd\u53ca\u65f6\u4fee\u6539\uff0c\u8bf7\u8054\u7cfb\u6211\uff09\u3002<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u5df2\u7ecf\u5b89\u88c5\u4e86\u6700\u65b0\u7684\u663e\u5361\u9a71\u52a8\uff0c\u4ec5\u652f\u6301CUDA12.1\u7684\u7528\u6237\u6765\u8bf4\uff0c\u8bf7\u4e0d\u8981\u614c\u5f20\uff0cCUDA12.1\u65e0\u8bba\u662fWindows\u8fd8\u662fLinux\u73af\u5883\u4e2d\u90fd\u5b8c\u5168\u53ef\u4ee5\u4f7f\u7528Tensorflow\u548cPytorch\u4e24\u4e2a\u4e3b\u6d41\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\u7684\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u663e\u5361\u9a71\u52a8<\/h2>\n\n\n\n<p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u5b89\u88c5\u663e\u5361\u9a71\u52a8\uff0c\u663e\u5361\u9a71\u52a8\u4ece\u8fd9\u91cc\u4e0b\u8f7d\uff1a<a href=\"https:\/\/www.nvidia.cn\/Download\/index.aspx?lang=cn\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.nvidia.cn\/Download\/index.aspx?lang=cn<\/a><\/p>\n\n\n\n<p>\u5f53\u7136\u4f60\u5fc5\u987b\u9009\u62e9\u5408\u9002\u7684\u9a71\u52a8\u7248\u672c\uff0c\u8fd9\u4e2a\u9700\u8981\u4f60\u6839\u636e\u4f60\u4f7f\u7528\u7684CUDA\u7248\u672c\u6765\u51b3\u5b9a\uff0c\u5c3d\u91cf\u5148\u5355\u72ec\u5b89\u88c5\u9a71\u52a8\uff0c\u4ee5\u514d\u5b89\u88c5CUDA\u65f6\u5b89\u88c5\u9a71\u52a8\u62a5\u9519\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5\u4f9d\u8d56<\/h3>\n\n\n\n<p>\u5728\u5b89\u88c5\u663e\u5361\u9a71\u52a8\u7684\u65f6\u5019\u53ef\u80fd\u8981\u7f16\u8bd1\u5185\u6838\u7684\u4e00\u4e9b\u9a71\u52a8\u6587\u4ef6\uff0c\u6240\u4ee5\u8bf4\u6211\u4eec\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u4f9d\u8d56\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install g++\nsudo apt-get install gcc\nsudo apt-get install make\nsudo apt-get install build-essential \nsudo apt-get install cmake\nsudo apt-get install lightdm<\/code><\/pre>\n\n\n\n<p>\u5f53\u7136\uff0c\u5728\u6b64\u4e4b\u524d\uff0c\u6211\u5efa\u8bae\u4f60\u66f4\u6362\u6e05\u534e\u6e90\u6765\u52a0\u5feb\u4e0b\u8f7d\u3002\u5e76\u4e14\uff0c\u66f4\u6362\u6e05\u534e\u6e90\u53ef\u4ee5\u51cf\u5c11\u5f88\u591a\u70e6\u607c\uff0c\u6709\u4e9b\u8f6f\u4ef6\u5728\u7cfb\u7edf\u9ed8\u8ba4\u7684\u6e90\u4e2d\u5e76\u6ca1\u6709\u3002\u4f8b\u5982Git\u7684\u4f9d\u8d56liberror-perl\uff0c\u4f60\u9700\u8981\u66f4\u6362\u4e3a\u6e05\u534e\u6e90\u518d\u4f7f\u7528apt-get\u5b89\u88c5Git\u3002<\/p>\n\n\n\n<p>\u66f4\u6362\u6e05\u534e\u6e90\u7684\u6559\u7a0b\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/mirrors.tuna.tsinghua.edu.cn\/help\/ubuntu\/\" target=\"_blank\">https:\/\/mirrors.tuna.tsinghua.edu.cn\/help\/ubuntu\/<\/a><\/p>\n\n\n\n<p>\u66f4\u6362\u5b8c\u6bd5\u540e\u8bf7\u4e0d\u8981\u5fd8\u4e86\u66f4\u65b0apt-get\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u7981\u7528nouveau<\/h3>\n\n\n\n<p>\u7136\u540e\uff0c\u4f60\u9700\u8981\u7981\u7528\u4e00\u4e2a\u540d\u4e3anouveau\u7684\u670d\u52a1\uff0c\u5426\u5219\uff0c\u5c06\u4f1a\u5728\u5b89\u88c5Nvidia\u9a71\u52a8\u65f6\u7ed9\u4f60\u629b\u51fa\u4e00\u4e2aERROR\u3002<\/p>\n\n\n\n<p>\u5728\u6b64\u4e4b\u524d\uff0c\u6211\u5efa\u8bae\u4f60\u5b89\u88c5\u4e00\u4e2a\u6587\u672c\u7f16\u8f91\u5668\uff0cVim\u6216\u8005Gedit\u3002\u5f53\u7136\uff0c\u5982\u679c\u4f60\u559c\u6b22\u4f7f\u7528vi\u4e5f\u662f\u53ef\u4ee5\u7684\u3002<\/p>\n\n\n\n<p>\u5176\u4e2d\u4e00\u79cd\u529e\u6cd5\u662f\u5728blacklist.conf\u6587\u4ef6\u672b\u8ffd\u52a0\u76f8\u5173\u5185\u5bb9\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo gedit \/etc\/modprobe.d\/blacklist.conf<\/pre>\n\n\n\n<p>\u5728\u5176\u6587\u4ef6\u672b\u5c3e\u8ffd\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">blacklist nouveau\noptions nouveau modeset=0<\/pre>\n\n\n\n<p>\u6216\u8005\u4f60\u4e5f\u53ef\u4ee5\u65b0\u5efa\u4e00\u4e2ablacklist-nouveau.conf\u6587\u4ef6\uff0c\u4e13\u95e8\u7528\u4e8e\u7981\u7528nouveau\u670d\u52a1\u3002\u5f53\u7136\uff0c\u8fd9\u4e24\u79cd\u65b9\u6cd5\u7684\u6548\u679c\u662f\u4e00\u6837\u7684\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/modprobe.d\/blacklist-nouveau.conf<\/code><\/pre>\n\n\n\n<p>\u5c06\u4e0a\u8ff0\u4e24\u884c\u4ee3\u7801\uff0c\u590d\u5236\u4e8e\u5176\u4e2d\u3002<\/p>\n\n\n\n<p>\u5f53\u7136\uff0c\u8fd9\u4e9b\u90fd\u9700\u8981\u91cd\u542f\u751f\u6548\uff0c\u8bf7\u5bf9\u4f60\u7684\u7ec8\u7aef\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo update-initramfs -u\nsudo reboot<\/code><\/pre>\n\n\n\n<p>\u91cd\u542f\u540e\uff0c\u4f60\u9700\u8981\u5207\u6362\u4e3a\u547d\u4ee4\u884c\u6a21\u5f0f\u8fdb\u884c\u5b89\u88c5\uff0c\u8bf7\u6309\u5148\u540e\u987a\u5e8f\u4e00\u8d77\u6309\u4e0b\u952e\u76d8\u4e0a\u7684Ctrl+Alt+F1\u4e09\u4e2a\u6309\u952e\u3002<\/p>\n\n\n\n<p>\u4f60\u968f\u65f6\u53ef\u4ee5\u5728\u5b89\u88c5\u9a71\u52a8\u6210\u529f\u540e\u6309\u5148\u540e\u987a\u5e8f\u4e00\u8d77\u6309\u4e0bCtrl+Alt+F7\u6062\u590d\u56fe\u5f62\u754c\u9762\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd $Path of Driver File$\u8bf7\u5c06\u6b64\u5904\u66ff\u6362\u4e3a\u4f60\u4e0b\u8f7d\u9a71\u52a8\u7684\u76ee\u5f55\nsudo chmod +x NVIDIA-Linux-x86_64-525.105.17.run\nsudo .\/NVIDIA-Linux-x86_64-525.105.17.run<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u63d0\u793a\u4ee5\u4e0b\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Error: you appear to running an x server\uff1bplease exit x before installing.<\/code><\/pre>\n\n\n\n<p>\u8bf7\u4f7f\u7528-no-x-check\u53c2\u6570\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo .\/NVIDIA-Linux-x86_64-525.105.17.run -no-x-check<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5\u8fc7\u7a0b\u76f8\u5bf9\u7b80\u5355\uff0c\u4e14\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\uff0c\u5728\u5404\u5927\u641c\u7d22\u5f15\u64ce\u4e2d\u90fd\u5f88\u5bb9\u6613\u68c0\u7d22\u5f97\u5230\uff0c\u6211\u5c31\u4e0d\u5728\u6b64\u8d58\u8ff0\u4e86\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u8bf7\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff0c\u9a8c\u8bc1\u662f\u5426\u5b89\u88c5\u6210\u529f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nvidia-smi<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/010421.xyz\/wp-content\/uploads\/2023\/04\/\u56fe\u7247.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" data-original=\"https:\/\/010421.xyz\/wp-content\/uploads\/2023\/04\/\u56fe\u7247.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-191\" width=\"840\" height=\"417\"  sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/div><\/figure>\n\n\n\n<p>\u8f93\u51fa\u4e0a\u56fe\u6240\u793a\u5185\u5bb9\u5219\u5b89\u88c5\u6210\u529f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CUDA Toolkit<\/h2>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u4f60\u9700\u8981\u5b89\u88c5CUDA Toolkit\uff0cCUDA\u4ece\u8fd9\u91cc\u4e0b\u8f7d\uff1a<a href=\"https:\/\/developer.nvidia.com\/cuda-toolkit-archive\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/developer.nvidia.com\/cuda-toolkit-archive<\/a><\/p>\n\n\n\n<p>\u540c\u6837\u4f60\u5fc5\u987b\u9009\u62e9\u5408\u9002\u7684CUDA\u7248\u672c\uff0c\u8981\u4e0e\u4f60\u4e0b\u8f7d\u7684\u9a71\u52a8\u76f8\u5339\u914d\uff0c\u8fd9\u91cc\u6211\u63a8\u8350\u4f7f\u7528runfile\u5b89\u88c5\uff0cLinux\u7684runfile\u662f\u81ea\u5e26\u9a71\u52a8\u7684\uff0c\u4f46\u662f\u6211\u4e0d\u5efa\u8bae\u4f7f\u7528\u5176\u81ea\u5e26\u7684\u9a71\u52a8\u5b89\u88c5\uff0c\u5efa\u8bae\u9884\u5148\u5b89\u88c5\u9a71\u52a8\uff0c\u5e76\u53d6\u6d88\u5b89\u88c5\u4f4d\u4e8e\u7b2c\u4e00\u884c\u7684\u9a71\u52a8\uff0c\u56e0\u4e3a\u6211\u7ecf\u5e38\u9047\u5230\u62a5\u9519\u7684\u73b0\u8c61\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u8bf4\u4f60\u4f7f\u7528\u7684\u73af\u5883\u662fPytorch\uff0c\u5176\u5b9e\u4f60\u53ea\u9700\u8981\u5b89\u88c5Nvida\u7684\u663e\u5361\u9a71\u52a8\u548cCUDA Toolkit\uff0c\u7ecf\u8fc7\u6211\u7684\u6d4b\u8bd5\uff0c\u53ea\u5b89\u88c5\u8fd9\u4e9b\u4e5f\u53ef\u4ee5\u4f7f\u7528Pytorch\uff0c\u5f53\u7136\u4e3a\u4e86\u4f60\u4ee5\u540e\u5b66\u4e60Tensorflow\u4e5f\u597d\uff0c\u4e3a\u4e86\u514d\u53bb\u4e00\u4e9b\u672a\u77e5\u7684BUG\u4e5f\u597d\uff0c\u6211\u8fd8\u662f\u5efa\u8bae\u4f60\u5b89\u88c5CUDNN\u548cTensotRT\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5047\u8bbe\uff0c\u73b0\u5728\u4f60\u7684\u7cfb\u7edf\u662f\u521a\u521a\u5b89\u88c5\u7684Ubuntu22.04\uff0c\u4f60\u5728\u5b89\u88c5\u6df1\u5ea6\u5b66\u4e60\u73af\u5883\u7684\u65f6\u5019\uff0c\u53ef\u80fd\u9047\u5230\u4e00\u4e9b\u6211\u9047\u5230\u7684\u5751\uff0c\u6216\u8005\u4f60\u53ef\u4ee5\u76f4\u63a5\u6309\u7167\u6211\u7684\u5b89\u88c5\u6b65\u9aa4\u5b89\u88c5\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-177","post","type-post","status-publish","format-standard","hentry","category-install"],"_links":{"self":[{"href":"https:\/\/www.010421.xyz\/index.php\/wp-json\/wp\/v2\/posts\/177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.010421.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.010421.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.010421.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.010421.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=177"}],"version-history":[{"count":20,"href":"https:\/\/www.010421.xyz\/index.php\/wp-json\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":206,"href":"https:\/\/www.010421.xyz\/index.php\/wp-json\/wp\/v2\/posts\/177\/revisions\/206"}],"wp:attachment":[{"href":"https:\/\/www.010421.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.010421.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.010421.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}