{"id":51415,"date":"2024-10-08T18:25:14","date_gmt":"2024-10-08T10:25:14","guid":{"rendered":"https:\/\/server.hk\/cnblog\/51415\/"},"modified":"2024-11-14T10:43:21","modified_gmt":"2024-11-14T02:43:21","slug":"ubuntu-16-04-%e5%ae%89%e8%a3%9d-cuda-8-0","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/51415\/","title":{"rendered":"Ubuntu 16.04 \u5b89\u88dd CUDA 8.0"},"content":{"rendered":"<h1 id=\"ubuntu-16-04-%e5%ae%89%e8%a3%9d-cuda-8-0-XABGYGyQqv\">Ubuntu 16.04 \u5b89\u88dd CUDA 8.0<\/h1>\n<p>CUDA\uff08Compute Unified Device Architecture\uff09\u662f\u7531 NVIDIA \u958b\u767c\u7684\u4e00\u7a2e\u5e73\u884c\u8a08\u7b97\u5e73\u53f0\u548c\u7a0b\u5f0f\u8a2d\u8a08\u6a21\u578b\uff0c\u65e8\u5728\u5229\u7528 NVIDIA \u986f\u793a\u5361\u7684\u5f37\u5927\u8a08\u7b97\u80fd\u529b\u3002\u5c0d\u65bc\u9700\u8981\u9032\u884c\u9ad8\u6548\u80fd\u8a08\u7b97\u7684\u958b\u767c\u8005\u548c\u7814\u7a76\u4eba\u54e1\u4f86\u8aaa\uff0c\u5b89\u88dd CUDA \u662f\u4e00\u500b\u91cd\u8981\u7684\u6b65\u9a5f\u3002\u672c\u6587\u5c07\u6307\u5c0e\u60a8\u5982\u4f55\u5728 Ubuntu 16.04 \u4e0a\u5b89\u88dd CUDA 8.0\u3002<\/p>\n<h2 id=\"%e7%b3%bb%e7%b5%b1%e8%a6%81%e6%b1%82-XABGYGyQqv\">\u7cfb\u7d71\u8981\u6c42<\/h2>\n<p>\u5728\u5b89\u88dd CUDA 8.0 \u4e4b\u524d\uff0c\u8acb\u78ba\u4fdd\u60a8\u7684\u7cfb\u7d71\u7b26\u5408\u4ee5\u4e0b\u8981\u6c42\uff1a<\/p>\n<ul>\n<li>\u64cd\u4f5c\u7cfb\u7d71\uff1aUbuntu 16.04<\/li>\n<li>\u652f\u63f4\u7684 NVIDIA \u986f\u793a\u5361<\/li>\n<li>\u9069\u7576\u7684\u9a45\u52d5\u7a0b\u5f0f\u7248\u672c\uff08\u81f3\u5c11 367.48 \u4ee5\u4e0a\uff09<\/li>\n<\/ul>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%b8%80%ef%bc%9a%e6%9b%b4%e6%96%b0%e7%b3%bb%e7%b5%b1-XABGYGyQqv\">\u6b65\u9a5f\u4e00\uff1a\u66f4\u65b0\u7cfb\u7d71<\/h2>\n<p>\u5728\u958b\u59cb\u5b89\u88dd\u4e4b\u524d\uff0c\u5efa\u8b70\u60a8\u66f4\u65b0\u7cfb\u7d71\u4ee5\u78ba\u4fdd\u6240\u6709\u5957\u4ef6\u90fd\u662f\u6700\u65b0\u7684\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>sudo apt-get update\nsudo apt-get upgrade<\/code><\/pre>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%ba%8c%ef%bc%9a%e5%ae%89%e8%a3%9d-nvidia-%e9%a9%85%e5%8b%95%e7%a8%8b%e5%bc%8f-XABGYGyQqv\">\u6b65\u9a5f\u4e8c\uff1a\u5b89\u88dd NVIDIA \u9a45\u52d5\u7a0b\u5f0f<\/h2>\n<p>CUDA \u9700\u8981 NVIDIA \u9a45\u52d5\u7a0b\u5f0f\u7684\u652f\u6301\u3002\u60a8\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88dd\u6700\u65b0\u7684\u9a45\u52d5\u7a0b\u5f0f\uff1a<\/p>\n<pre><code>sudo apt-get install nvidia-367<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u91cd\u555f\u7cfb\u7d71\u4ee5\u4f7f\u9a45\u52d5\u7a0b\u5f0f\u751f\u6548\uff1a<\/p>\n<pre><code>sudo reboot<\/code><\/pre>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%b8%89%ef%bc%9a%e4%b8%8b%e8%bc%89-cuda-8-0-%e5%ae%89%e8%a3%9d%e5%8c%85-XABGYGyQqv\">\u6b65\u9a5f\u4e09\uff1a\u4e0b\u8f09 CUDA 8.0 \u5b89\u88dd\u5305<\/h2>\n<p>\u524d\u5f80 NVIDIA \u7684\u5b98\u65b9\u7db2\u7ad9\uff0c\u4e0b\u8f09 CUDA 8.0 \u7684\u5b89\u88dd\u5305\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u76f4\u63a5\u4e0b\u8f09\uff1a<\/p>\n<pre><code>wget https:\/\/developer.download.nvidia.com\/compute\/cuda\/8.0\/Prod\/local_installers\/cuda-repo-ubuntu1604-8-0-local_8.0.61-1_amd64-deb<\/code><\/pre>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e5%9b%9b%ef%bc%9a%e5%ae%89%e8%a3%9d-cuda-8-0-XABGYGyQqv\">\u6b65\u9a5f\u56db\uff1a\u5b89\u88dd CUDA 8.0<\/h2>\n<p>\u4e0b\u8f09\u5b8c\u6210\u5f8c\uff0c\u60a8\u9700\u8981\u5b89\u88dd CUDA \u7684\u672c\u5730\u5b58\u5132\u5eab\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>sudo dpkg -i cuda-repo-ubuntu1604-8-0-local_8.0.61-1_amd64-deb<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\uff0c\u6dfb\u52a0 GPG \u5bc6\u9470\uff1a<\/p>\n<pre><code>sudo apt-key add \/var\/cuda-repo-ubuntu1604-8-0-local\/7fa2af80.pub<\/code><\/pre>\n<p>\u7136\u5f8c\u66f4\u65b0\u5b58\u5132\u5eab\u4e26\u5b89\u88dd CUDA\uff1a<\/p>\n<pre><code>sudo apt-get update\nsudo apt-get install cuda<\/code><\/pre>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e4%ba%94%ef%bc%9a%e8%a8%ad%e7%bd%ae%e7%92%b0%e5%a2%83%e8%ae%8a%e6%95%b8-XABGYGyQqv\">\u6b65\u9a5f\u4e94\uff1a\u8a2d\u7f6e\u74b0\u5883\u8b8a\u6578<\/h2>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u9700\u8981\u8a2d\u7f6e\u74b0\u5883\u8b8a\u6578\u4ee5\u4fbf\u7cfb\u7d71\u80fd\u5920\u627e\u5230 CUDA\u3002\u7de8\u8f2f\u60a8\u7684 .bashrc \u6587\u4ef6\uff1a<\/p>\n<pre><code>nano ~\/.bashrc<\/code><\/pre>\n<p>\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<\/p>\n<pre><code>export PATH=\/usr\/local\/cuda-8.0\/bin${PATH:+:${PATH}}\nexport LD_LIBRARY_PATH=\/usr\/local\/cuda-8.0\/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}<\/code><\/pre>\n<p>\u4fdd\u5b58\u4e26\u9000\u51fa\u7de8\u8f2f\u5668\uff0c\u7136\u5f8c\u904b\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\uff1a<\/p>\n<pre><code>source ~\/.bashrc<\/code><\/pre>\n<h2 id=\"%e6%ad%a5%e9%a9%9f%e5%85%ad%ef%bc%9a%e9%a9%97%e8%ad%89%e5%ae%89%e8%a3%9d-XABGYGyQqv\">\u6b65\u9a5f\u516d\uff1a\u9a57\u8b49\u5b89\u88dd<\/h2>\n<p>\u8981\u9a57\u8b49 CUDA \u662f\u5426\u5b89\u88dd\u6210\u529f\uff0c\u53ef\u4ee5\u904b\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>nvcc -V<\/code><\/pre>\n<p>\u5982\u679c\u986f\u793a CUDA 8.0 \u7684\u7248\u672c\u4fe1\u606f\uff0c\u5247\u8868\u793a\u5b89\u88dd\u6210\u529f\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-XABGYGyQqv\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Ubuntu 16.04 \u4e0a\u5b89\u88dd CUDA 8.0 \u7684\u904e\u7a0b\u76f8\u5c0d\u7c21\u55ae\uff0c\u53ea\u9700\u9075\u5faa\u4e0a\u8ff0\u6b65\u9a5f\u5373\u53ef\u5b8c\u6210\u3002\u9019\u5c07\u4f7f\u60a8\u80fd\u5920\u5229\u7528 NVIDIA \u986f\u793a\u5361\u7684\u8a08\u7b97\u80fd\u529b\uff0c\u9032\u884c\u9ad8\u6548\u80fd\u8a08\u7b97\u548c\u6df1\u5ea6\u5b78\u7fd2\u7b49\u61c9\u7528\u3002\u5982\u679c\u60a8\u9700\u8981\u7a69\u5b9a\u7684\u4f3a\u670d\u5668\u74b0\u5883\u4f86\u904b\u884c\u60a8\u7684\u61c9\u7528\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\uff0c\u4ee5\u7372\u5f97\u66f4\u597d\u7684\u6027\u80fd\u548c\u53ef\u9760\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to install CUDA 8.0 on Ubuntu 16.04 with this step-by-step guide, ensuring optimal performance for your GPU-accelerated applications.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-51415","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=51415"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51415\/revisions"}],"predecessor-version":[{"id":51416,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51415\/revisions\/51416"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=51415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=51415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=51415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}