{"id":57305,"date":"2024-10-10T18:39:15","date_gmt":"2024-10-10T10:39:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/57305\/"},"modified":"2024-11-14T10:35:46","modified_gmt":"2024-11-14T02:35:46","slug":"ubuntu-16-04-%e4%b8%8b%e5%ae%89%e8%a3%9d-cuda-8-0-anaconda-4-4-0-%e5%92%8c-tensorflow-1-2-1","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/57305\/","title":{"rendered":"Ubuntu 16.04 \u4e0b\u5b89\u88dd CUDA 8.0, Anaconda 4.4.0 \u548c TensorFlow 1.2.1"},"content":{"rendered":"<h1 id=\"ubuntu-16-04-%e4%b8%8b%e5%ae%89%e8%a3%9d-cuda-8-0-anaconda-4-4-0-%e5%92%8c-tensorflow-1-2-1-pmDNLtREiK\">Ubuntu 16.04 \u4e0b\u5b89\u88dd CUDA 8.0, Anaconda 4.4.0 \u548c TensorFlow 1.2.1<\/h1>\n<p>\u5728\u6df1\u5ea6\u5b78\u7fd2\u548c\u6a5f\u5668\u5b78\u7fd2\u7684\u9818\u57df\u4e2d\uff0cCUDA\u3001Anaconda \u548c TensorFlow \u662f\u4e09\u500b\u4e0d\u53ef\u6216\u7f3a\u7684\u5de5\u5177\u3002\u672c\u6587\u5c07\u6307\u5c0e\u60a8\u5982\u4f55\u5728 Ubuntu 16.04 \u7cfb\u7d71\u4e0a\u5b89\u88dd CUDA 8.0\u3001Anaconda 4.4.0 \u548c TensorFlow 1.2.1\uff0c\u5e6b\u52a9\u60a8\u5feb\u901f\u642d\u5efa\u6df1\u5ea6\u5b78\u7fd2\u74b0\u5883\u3002<\/p>\n<h2 id=\"%e4%b8%80%e3%80%81%e5%ae%89%e8%a3%9d-cuda-8-0-pmDNLtREiK\">\u4e00\u3001\u5b89\u88dd CUDA 8.0<\/h2>\n<p>CUDA\uff08Compute Unified Device Architecture\uff09\u662f NVIDIA \u63d0\u4f9b\u7684\u4e00\u500b\u5e73\u884c\u8a08\u7b97\u5e73\u53f0\u548c\u7a0b\u5f0f\u8a2d\u8a08\u6a21\u578b\uff0c\u80fd\u5920\u5229\u7528 NVIDIA \u986f\u793a\u5361\u7684\u8a08\u7b97\u80fd\u529b\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd CUDA 8.0 \u7684\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-%e6%ba%96%e5%82%99%e5%b7%a5%e4%bd%9c-pmDNLtREiK\">1. \u6e96\u5099\u5de5\u4f5c<\/h3>\n<ul>\n<li>\u78ba\u4fdd\u60a8\u7684\u7cfb\u7d71\u5df2\u5b89\u88dd NVIDIA \u986f\u793a\u5361\u9a45\u52d5\u7a0b\u5f0f\u3002<\/li>\n<li>\u66f4\u65b0\u7cfb\u7d71\uff1a<code>sudo apt-get update<\/code><\/li>\n<\/ul>\n<h3 id=\"2-%e4%b8%8b%e8%bc%89-cuda-8-0-pmDNLtREiK\">2. \u4e0b\u8f09 CUDA 8.0<\/h3>\n<p>\u8a2a\u554f NVIDIA \u7684\u5b98\u65b9\u7db2\u7ad9\uff0c\u4e0b\u8f09\u9069\u5408 Ubuntu 16.04 \u7684 CUDA 8.0 \u5b89\u88dd\u5305\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\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.XX-1_amd64.deb<\/code><\/pre>\n<h3 id=\"3-%e5%ae%89%e8%a3%9d-cuda-pmDNLtREiK\">3. \u5b89\u88dd CUDA<\/h3>\n<p>\u5b89\u88dd\u4e0b\u8f09\u7684\u5305\uff1a<\/p>\n<pre><code>sudo dpkg -i cuda-repo-ubuntu1604-8-0-local_8.0.XX-1_amd64.deb<\/code><\/pre>\n<p>\u7136\u5f8c\u66f4\u65b0 apt \u8cc7\u6599\u5eab\u4e26\u5b89\u88dd CUDA\uff1a<\/p>\n<pre><code>sudo apt-get update<\/code><\/pre>\n<pre><code>sudo apt-get install cuda<\/code><\/pre>\n<h3 id=\"4-%e8%a8%ad%e5%ae%9a%e7%92%b0%e5%a2%83%e8%ae%8a%e6%95%b8-pmDNLtREiK\">4. \u8a2d\u5b9a\u74b0\u5883\u8b8a\u6578<\/h3>\n<p>\u7de8\u8f2f <code>~\/.bashrc<\/code> \u6587\u4ef6\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<\/p>\n<pre><code>export PATH=\/usr\/local\/cuda-8.0\/bin${PATH:+:${PATH}}<\/code><\/pre>\n<pre><code>export LD_LIBRARY_PATH=\/usr\/local\/cuda-8.0\/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}<\/code><\/pre>\n<p>\u7136\u5f8c\u57f7\u884c <code>source ~\/.bashrc<\/code> \u4f7f\u6539\u52d5\u751f\u6548\u3002<\/p>\n<h2 id=\"%e4%ba%8c%e3%80%81%e5%ae%89%e8%a3%9d-anaconda-4-4-0-pmDNLtREiK\">\u4e8c\u3001\u5b89\u88dd Anaconda 4.4.0<\/h2>\n<p>Anaconda \u662f\u4e00\u500b\u6d41\u884c\u7684 Python \u767c\u884c\u7248\uff0c\u7279\u5225\u9069\u5408\u6578\u64da\u79d1\u5b78\u548c\u6a5f\u5668\u5b78\u7fd2\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd Anaconda 4.4.0 \u7684\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-%e4%b8%8b%e8%bc%89-anaconda-pmDNLtREiK\">1. \u4e0b\u8f09 Anaconda<\/h3>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4e0b\u8f09 Anaconda 4.4.0\uff1a<\/p>\n<pre><code>wget https:\/\/repo.anaconda.com\/archive\/Anaconda3-4.4.0-Linux-x86_64.sh<\/code><\/pre>\n<h3 id=\"2-%e5%ae%89%e8%a3%9d-anaconda-pmDNLtREiK\">2. \u5b89\u88dd Anaconda<\/h3>\n<p>\u904b\u884c\u5b89\u88dd\u8173\u672c\uff1a<\/p>\n<pre><code>bash Anaconda3-4.4.0-Linux-x86_64.sh<\/code><\/pre>\n<p>\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88dd\uff0c\u4e26\u9078\u64c7\u662f\u5426\u5c07 Anaconda \u6dfb\u52a0\u5230\u60a8\u7684 PATH \u4e2d\u3002<\/p>\n<h3 id=\"3-%e6%9b%b4%e6%96%b0-anaconda-pmDNLtREiK\">3. \u66f4\u65b0 Anaconda<\/h3>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u66f4\u65b0 Anaconda\uff1a<\/p>\n<pre><code>conda update conda<\/code><\/pre>\n<pre><code>conda update anaconda<\/code><\/pre>\n<h2 id=\"%e4%b8%89%e3%80%81%e5%ae%89%e8%a3%9d-tensorflow-1-2-1-pmDNLtREiK\">\u4e09\u3001\u5b89\u88dd TensorFlow 1.2.1<\/h2>\n<p>TensorFlow \u662f\u4e00\u500b\u958b\u6e90\u7684\u6a5f\u5668\u5b78\u7fd2\u6846\u67b6\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u6df1\u5ea6\u5b78\u7fd2\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd TensorFlow 1.2.1 \u7684\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-%e5%89%b5%e5%bb%ba%e8%99%9b%e6%93%ac%e7%92%b0%e5%a2%83-pmDNLtREiK\">1. \u5275\u5efa\u865b\u64ec\u74b0\u5883<\/h3>\n<p>\u4f7f\u7528 Anaconda \u5275\u5efa\u4e00\u500b\u65b0\u7684\u865b\u64ec\u74b0\u5883\uff1a<\/p>\n<pre><code>conda create -n tf_env python=3.5<\/code><\/pre>\n<p>\u6fc0\u6d3b\u865b\u64ec\u74b0\u5883\uff1a<\/p>\n<pre><code>source activate tf_env<\/code><\/pre>\n<h3 id=\"2-%e5%ae%89%e8%a3%9d-tensorflow-pmDNLtREiK\">2. \u5b89\u88dd TensorFlow<\/h3>\n<p>\u5728\u865b\u64ec\u74b0\u5883\u4e2d\u5b89\u88dd TensorFlow 1.2.1\uff1a<\/p>\n<pre><code>pip install tensorflow-gpu==1.2.1<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-pmDNLtREiK\">\u7e3d\u7d50<\/h2>\n<p>\u901a\u904e\u4ee5\u4e0a\u6b65\u9a5f\uff0c\u60a8\u5df2\u6210\u529f\u5728 Ubuntu 16.04 \u4e0a\u5b89\u88dd\u4e86 CUDA 8.0\u3001Anaconda 4.4.0 \u548c TensorFlow 1.2.1\u3002\u9019\u4e9b\u5de5\u5177\u5c07\u5e6b\u52a9\u60a8\u5728\u6df1\u5ea6\u5b78\u7fd2\u548c\u6a5f\u5668\u5b78\u7fd2\u7684\u7814\u7a76\u4e2d\u53d6\u5f97\u66f4\u597d\u7684\u6210\u679c\u3002\u5982\u679c\u60a8\u9700\u8981\u7a69\u5b9a\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u4f86\u904b\u884c\u60a8\u7684\u6df1\u5ea6\u5b78\u7fd2\u6a21\u578b\uff0c\u8acb\u8003\u616e\u6211\u5011\u7684\u670d\u52d9\uff0c\u63d0\u4f9b\u9ad8\u6548\u80fd\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a> \u89e3\u6c7a\u65b9\u6848\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to install CUDA 8.0, Anaconda 4.4.0, and TensorFlow 1.2.1 on Ubuntu 16.04 for optimized machine learning performance.<\/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-57305","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/57305","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=57305"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/57305\/revisions"}],"predecessor-version":[{"id":57306,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/57305\/revisions\/57306"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=57305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=57305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=57305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}