274 lines
8.8 KiB
HTML

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Configuring your PC to use your Nvidia GPU with PCL &mdash; Point Cloud Library 1.12.0 documentation</title>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></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="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> Point Cloud Library
</a>
<div class="version">
1.12.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">Configuring your PC to use your Nvidia GPU with PCL</a></li>
<li><a class="reference internal" href="#checking-cuda-version">Checking CUDA Version</a></li>
<li><a class="reference internal" href="#checking-c-version">Checking C++ Version</a></li>
<li><a class="reference internal" href="#installing-gcc">Installing GCC</a></li>
<li><a class="reference internal" href="#installing-eigen">Installing Eigen</a></li>
<li><a class="reference internal" href="#building-pcl">Building PCL</a></li>
</ul>
</div>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Point Cloud Library</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>Configuring your PC to use your Nvidia GPU with PCL</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="configuring-your-pc-to-use-your-nvidia-gpu-with-pcl">
<span id="gpu-install"></span><h1>Configuring your PC to use your Nvidia GPU with PCL</h1>
<p>In this tutorial you will learn how to configure your system to make it compatible to run the GPU methods provided by PCL.
This tutorial is for Ubuntu, other Linux distrubutions can follow a similar process to set it up.</p>
<p>Windows is currently <strong>not</strong> officially supported for the GPU methods.</p>
</div>
<div class="section" id="checking-cuda-version">
<h1>Checking CUDA Version</h1>
<p>In order to run the code you will need a system with an Nvidia GPU, having CUDA Toolkit v9.2+ installed.
We will not be covering CUDA toolkit installation in this tutorial as there already exists many great tutorials for the same.</p>
<p>You can check your CUDA toolkit version using the following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ nvcc --version | grep &quot;release&quot; | awk &#39;{print $6}&#39; | cut -c2-
</pre></div>
</div>
</div>
<div class="section" id="checking-c-version">
<h1>Checking C++ Version</h1>
<p>The GPU methods in PCL require a min version of GCC 7 or Clang 6 onwards (min version unknown).
This will not be a problem if you are running Ubuntu 18.04 or later. However on Ubuntu 16.04, you will need to install GCC 7 or Clang 6 (lower versions not tested) manually because the versions available by default are: GCC 5 and Clang 3.8</p>
<p>You can check your GCC and Clang version using the following commands:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ gcc -dumpversion
$ clang --version
</pre></div>
</div>
</div>
<div class="section" id="installing-gcc">
<h1>Installing GCC</h1>
<p>To install GCC 7 run the following commands:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt update &amp;&amp; apt install g++-7 -y
</pre></div>
</div>
<p>Set it as the default version:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7
$ sudo update-alternatives --config gcc
</pre></div>
</div>
</div>
<div class="section" id="installing-eigen">
<h1>Installing Eigen</h1>
<p>You will also need Eigen v3.3.7+, since the previous versions are incompatible with the latest CUDA versions.
If you are on Ubuntu 20 or newer, then there is no issue since Eigen 3.3.7 is shipped by default.
On older versions Eigen v3.3.7 will need to be installed manually:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ wget -qO- https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz | tar xz
$ sudo apt install -y libblas-dev
$ cd eigen-3.3.7 &amp;&amp; mkdir build &amp;&amp; cd build
$ cmake ..
$ sudo make install
$ cd ../.. &amp;&amp; rm -rf eigen-3.3.7/ &amp;&amp; rm -f eigen-3.3.7.tar.gz
</pre></div>
</div>
</div>
<div class="section" id="building-pcl">
<h1>Building PCL</h1>
<p>Now you can get the latest git master (or another one) of PCL and configure your
installation to use the CUDA functions.</p>
<p>Go to your PCL root folder and do:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ mkdir build; cd build
$ ccmake ..
</pre></div>
</div>
<p>Press c to configure ccmake, press t to toggle to the advanced mode as a number of options
only appear in advanced mode. The latest CUDA algorithms are being kept in the GPU project, for
this the BUILD_GPU option needs to be on and the BUILD_gpu_&lt;X&gt; indicate the different
GPU subprojects.</p>
<a class="reference internal image-reference" href="_images/gpu_ccmake.png"><img alt="_images/gpu_ccmake.png" src="_images/gpu_ccmake.png" style="width: 400pt;" /></a>
<p>Press c again to configure for you options, press g to generate the makefiles and to exit. Now
the makefiles have been generated successfully and can be executed by doing:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ make
</pre></div>
</div>
<p>If you want to install your PCL installation for everybody to use:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ make install
</pre></div>
</div>
<p>Now your installation is finished!</p>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>