ubuntu_install.html 10.3 KB
Newer Older
1 2


Y
Yu Yang 已提交
3 4 5 6 7 8 9 10
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
11
    <title>使用deb包在Ubuntu上安装PaddlePaddle &#8212; PaddlePaddle  documentation</title>
Y
Yu Yang 已提交
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
    
    <link rel="stylesheet" href="../../_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
29
    <link rel="top" title="PaddlePaddle  documentation" href="../../index.html" /> 
30 31 32 33 34 35 36 37 38 39
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?b9a314ab40d04d805655aab1deee08ba";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

Y
Yu Yang 已提交
40 41 42 43 44 45 46 47
  </head>
  <body role="document">
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
48
        <li class="nav-item nav-item-0"><a href="../../index.html">PaddlePaddle  documentation</a> &#187;</li> 
Y
Yu Yang 已提交
49 50 51 52 53 54 55 56
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
Y
Yu Yang 已提交
57 58
  <div class="section" id="debubuntupaddlepaddle">
<h1>使用deb包在Ubuntu上安装PaddlePaddle<a class="headerlink" href="#debubuntupaddlepaddle" title="Permalink to this headline"></a></h1>
59 60 61 62 63 64 65 66
<p>PaddlePaddle目前支持使用deb包安装。Paddle的 <code class="code docutils literal"><span class="pre">deb</span></code> 安装包在ubuntu 14.04中正确,但理论上支持其他的 debian 发行版。</p>
<p>PaddlePaddle的ubuntu安装包分为四个版本,他们是 cpu、gpu、cpu-noavx、gpu-noavx 四个版本。其中 noavx 用于不支持AVX指令集的cpu。安装包的下载地址是: <a class="reference external" href="https://github.com/baidu/Paddle/releases/">https://github.com/baidu/Paddle/releases/</a></p>
<p>用户需要先将PaddlePaddle安装包下载到本地,然后执行如下 <code class="code docutils literal"><span class="pre">gdebi</span></code> 命令即可完成安装。</p>
<div class="highlight-shell"><div class="highlight"><pre><span></span>gdebi paddle-*-cpu.deb
</pre></div>
</div>
<p>如果 <code class="code docutils literal"><span class="pre">gdebi</span></code> 没有安装,则需要使用 <code class="code docutils literal"><span class="pre">sudo</span> <span class="pre">apt-get</span> <span class="pre">install</span> <span class="pre">gdebi</span></code>, 来安装 <code class="code docutils literal"><span class="pre">gdebi</span></code></p>
<p>或者使用下面一条命令安装.</p>
67
<div class="highlight-shell"><div class="highlight"><pre><span></span>dpkg -i paddle-*-cpu.deb
Y
Yu Yang 已提交
68 69 70
apt-get install -f
</pre></div>
</div>
Y
Yu Yang 已提交
71
<p><code class="code docutils literal"><span class="pre">dpkg</span> <span class="pre">-i</span></code> 的时候如果报一些依赖未找到的错误是正常的,
72 73
<code class="code docutils literal"><span class="pre">apt-get</span> <span class="pre">install</span> <span class="pre">-f</span></code> 里会继续安装 PaddlePaddle。</p>
<p>需要注意的是,如果使用GPU版本的PaddlePaddle,请安装CUDA 7.5 和CUDNN 5到本地环境中,
Y
Yu Yang 已提交
74
并设置好对应的环境变量(LD_LIBRARY_PATH等等)。</p>
75
<p>安装完成后,可以使用命令 <code class="code docutils literal"><span class="pre">paddle</span> <span class="pre">version</span></code> 查看安装后的paddle 版本。可能的输出为</p>
76 77 78 79 80 81 82 83 84 85 86
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">PaddlePaddle</span> <span class="mf">0.8</span><span class="o">.</span><span class="mb">0b1</span><span class="p">,</span> <span class="n">compiled</span> <span class="k">with</span>
    <span class="n">with_avx</span><span class="p">:</span> <span class="n">ON</span>
    <span class="n">with_gpu</span><span class="p">:</span> <span class="n">OFF</span>
    <span class="n">with_double</span><span class="p">:</span> <span class="n">OFF</span>
    <span class="n">with_python</span><span class="p">:</span> <span class="n">ON</span>
    <span class="n">with_rdma</span><span class="p">:</span> <span class="n">OFF</span>
    <span class="n">with_glog</span><span class="p">:</span> <span class="n">ON</span>
    <span class="n">with_gflags</span><span class="p">:</span> <span class="n">ON</span>
    <span class="n">with_metric_learning</span><span class="p">:</span>
    <span class="n">with_timer</span><span class="p">:</span> <span class="n">OFF</span>
    <span class="n">with_predict_sdk</span><span class="p">:</span>
87 88
</pre></div>
</div>
89 90
<div class="section" id="id1">
<h2>可能遇到的问题<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h2>
Y
Yu Yang 已提交
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
<div class="section" id="libcudart-so-libcudnn-so">
<h3>libcudart.so/libcudnn.so找不到<a class="headerlink" href="#libcudart-so-libcudnn-so" title="Permalink to this headline"></a></h3>
<p>安装完成PaddlePaddle后,运行 <code class="code docutils literal"><span class="pre">paddle</span> <span class="pre">train</span></code> 报错:</p>
<div class="highlight-shell"><div class="highlight"><pre><span></span>0831 12:36:04.151525  1085 hl_dso_loader.cc:70] Check failed: nullptr != *dso_handle For Gpu version of PaddlePaddle, it couldn&#39;t find CUDA library: libcudart.so Please make sure you already specify its path.Note: for training data on Cpu using Gpu version of PaddlePaddle,you must specify libcudart.so via LD_LIBRARY_PATH.
</pre></div>
</div>
<p>PaddlePaddle使用运行时动态连接CUDA的so,如果在 LD_LIBRARY_PATH里面找不到这些动态
库的话,会报寻找不到这些动态库。</p>
<p>解决方法很简单,就是将这些动态库加到环境变量里面。比较可能的命令如下。</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
</pre></div>
</div>
</div>
<div class="section" id="cuda-driver">
<h3>CUDA Driver找不到<a class="headerlink" href="#cuda-driver" title="Permalink to this headline"></a></h3>
<p>运行 <code class="code docutils literal"><span class="pre">paddle</span> <span class="pre">train</span></code> 报错:</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>F0831 12:39:16.699000  1090 hl_cuda_device.cc:530] Check failed: cudaSuccess == cudaStat (0 vs. 35) Cuda Error: CUDA driver version is insufficient for CUDA runtime version
</pre></div>
</div>
<p>PaddlePaddle运行时如果没有寻找到cuda的driver,变会报这个错误。解决办法是将cuda
driver添加到LD_LIBRARY_PATH中。比较可能的命令如下。</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH
</pre></div>
</div>
</div>
<div class="section" id="config">
<h3>config文件找不到<a class="headerlink" href="#config" title="Permalink to this headline"></a></h3>
<p>运行 <code class="code docutils literal"><span class="pre">paddle</span> <span class="pre">train</span></code> 得到结果:</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>F0831 20:53:07.525789  1302 TrainerMain.cpp:94] Check failed: config != nullptr no valid config
</pre></div>
</div>
<p>PaddlePaddle在运行时找不到对应的config文件,说明命令行参数 <code class="code docutils literal"><span class="pre">config</span></code> 没有设置。
而这个一般说明PaddlePaddle已经安装完毕了。</p>
</div>
</div>
Y
Yu Yang 已提交
126 127 128 129 130 131 132 133
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
Y
Yu Yang 已提交
134 135 136
  <h3><a href="../../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">使用deb包在Ubuntu上安装PaddlePaddle</a><ul>
137
<li><a class="reference internal" href="#id1">可能遇到的问题</a><ul>
Y
Yu Yang 已提交
138 139 140 141 142 143 144 145 146
<li><a class="reference internal" href="#libcudart-so-libcudnn-so">libcudart.so/libcudnn.so找不到</a></li>
<li><a class="reference internal" href="#cuda-driver">CUDA Driver找不到</a></li>
<li><a class="reference internal" href="#config">config文件找不到</a></li>
</ul>
</li>
</ul>
</li>
</ul>

Y
Yu Yang 已提交
147 148 149 150 151 152 153 154 155 156
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/build_and_install/install/ubuntu_install.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
157 158
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
Y
Yu Yang 已提交
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
174
        <li class="nav-item nav-item-0"><a href="../../index.html">PaddlePaddle  documentation</a> &#187;</li> 
Y
Yu Yang 已提交
175 176 177
      </ul>
    </div>
    <div class="footer" role="contentinfo">
178 179
        &#169; Copyright 2016, PaddlePaddle developers.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.6.
Y
Yu Yang 已提交
180 181 182
    </div>
  </body>
</html>