Skip to content

Commit 93b7773

Browse files
shrijitsingh99larshgkunaltyagi
authored
Update tutorial for latest versions of CUDA (PointCloudLibrary#4229)
Co-authored-by: Lars Glud <[email protected]> Co-authored-by: Kunal Tyagi <[email protected]>
1 parent 0757613 commit 93b7773

File tree

2 files changed

+45
-85
lines changed

2 files changed

+45
-85
lines changed

doc/tutorials/content/compiling_pcl_posix.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The following code libraries enable certain additional features for the PCL libr
110110
+---------------------------------------------------------------+-----------------+-------------------+-------------------+
111111
| .. image:: images/posix_building_pcl/openni_logo.png | OpenNI | 1.3 | pcl_io |
112112
+---------------------------------------------------------------+-----------------+-------------------+-------------------+
113-
| .. image:: images/posix_building_pcl/cuda_logo.png | CUDA | 4.0 | pcl_* |
113+
| .. image:: images/posix_building_pcl/cuda_logo.png | CUDA | 9.2 | pcl_* |
114114
+---------------------------------------------------------------+-----------------+-------------------+-------------------+
115115

116116
Troubleshooting

doc/tutorials/content/gpu_install.rst

+44-84
Original file line numberDiff line numberDiff line change
@@ -2,85 +2,65 @@
22

33
Configuring your PC to use your Nvidia GPU with PCL
44
---------------------------------------------------
5-
In this tutorial we will learn how to check if your PC is
6-
suitable for use with the GPU methods provided within PCL.
7-
This tutorial has been tested on Ubuntu 11.04 and 12.04, let
8-
us know on the user mailing list if you have tested this on other
9-
distributions.
105

11-
The explanation
12-
---------------
13-
14-
In order to run the code you'll need a decent Nvidia GPU with Fermi or Kepler architecture you can check this by::
15-
16-
$ lspci | grep nVidia
17-
18-
This should indicate which GPU you have on your system, if you don't have an Nvidia GPU, we're sorry, but you
19-
won't be able to use PCL GPU.
20-
The output of this you can compare with `this link <http://www.nvidia.co.uk/object/cuda-parallel-computing-uk.html>`_
21-
on the Nvidia website, your card should mention compute capability of 2.x (Fermi) or 3.x (Kepler) or higher.
22-
If you want to run with a GUI, you can also run::
23-
24-
$ nvidia-settings
25-
26-
From either CLI or from your system settings menu. This should mention the same information.
27-
28-
First you need to test if your CPU is 32 or 64 bit, if it is 64-bit, it is preferred to work in this mode.
29-
For this you can run::
6+
In this tutorial you will learn how to configure your system to make it compatible to run the GPU methods provided by PCL.
7+
This tutorial is for Ubuntu, other Linux distrubutions can follow a similar process to set it up.
308

31-
$ lscpu | grep op-mode
9+
Windows is currently **not** officially supported for the GPU methods.
3210

33-
As a next step you will need a up to date version of the Cuda Toolkit. You can get this
34-
`here <http://developer.nvidia.com/cuda/cuda-downloads>`_, at the time of writing the
35-
latest version was 4.2 and the beta release of version 5 was available as well.
36-
37-
First you will need to install the latest video drivers, download the correct one from the site
38-
and run the install file, after this, download the toolkit and install it.
39-
At the moment of writing this was version 295.41, please choose the most up to date one::
40-
41-
$ wget http://developer.download.nvidia.com/compute/cuda/4_2/rel/drivers/devdriver_4.2_linux_64_295.41.run
42-
43-
Make the driver executable::
44-
45-
$ chmod +x devdriver_4.2_linux_64_295.41.run
11+
Checking CUDA Version
12+
---------------
4613

47-
Run the driver::
14+
In order to run the code you will need a system with an Nvidia GPU, having CUDA Toolkit v9.2+ installed.
15+
We will not be covering CUDA toolkit installation in this tutorial as there already exists many great tutorials for the same.
4816

49-
$ sudo ./devdriver_4.2_linux_64_295.41.run
17+
You can check your CUDA toolkit version using the following command::
5018

51-
You need to run this script without your X-server running. You can shut your X-server down as follows:
52-
Go to a terminal by pressing Ctrl-Alt-F1 and typing::
19+
$ nvcc --version | grep "release" | awk '{print $6}' | cut -c2-
20+
21+
22+
Checking C++ Version
23+
---------------
5324

54-
$ sudo service gdm stop
25+
The GPU methods in PCL require a min version of GCC 7 or Clang 6 onwards (min version unknown).
26+
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
5527

56-
Once you have installed you GPU device driver you will also need to install the CUDA Toolkit::
28+
You can check your GCC and Clang version using the following commands::
5729

58-
$ wget http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/cudatoolkit_4.2.9_linux_64_ubuntu11.04.run
59-
$ chmod +x cudatoolkit_4.2.9_linux_64_ubuntu11.04.run
60-
$ sudo ./cudatoolkit_4.2.9_linux_64_ubuntu11.04.run
30+
$ gcc -dumpversion
6131
62-
You can get the SDK, but for PCL this is not needed, this provides you with general CUDA examples
63-
and some scripts to test the performance of your CPU as well as your hardware specifications.
64-
65-
CUDA only compiles with gcc 4.4 and lower, so if your default installed gcc is 4.5 or higher you'll need to install gcc 4.4:
66-
67-
$ sudo apt-get install gcc-4.4
32+
$ clang --version
33+
34+
35+
Installing GCC
36+
---------------
6837

69-
Now you need to force your gcc to use this version, you can remove the older version, the other option is to create a symlink in your home folder and include that in the beginning of your path:
38+
To install GCC 7 run the following commands::
39+
40+
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
41+
$ sudo apt update && apt install g++-7 -y
42+
43+
Set it as the default version::
44+
45+
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7
46+
$ sudo update-alternatives --config gcc
7047

71-
$ cd
72-
$ mkdir bin
48+
Installing Eigen
49+
---------------
7350

74-
Add 'export PATH=$HOME/bin:$PATH as the last line to your ~/.bashrc file.
75-
Now create the symlinks in your bin folder:
51+
You will also need Eigen v3.3.7+, since the previous versions are incompatible with the latest CUDA versions.
52+
If you are on Ubuntu 29+, then there is no issue since Eigen 3.3.7 is shipped by default.
53+
On older versions Eigen v3.3.7 will need to be installed manually::
7654

77-
$ cd ~/bin
78-
$ ln -s <your_gcc_installation> c++
79-
$ ln -s <your_gcc_installation> cc
80-
$ ln -s <your_gcc_installation> g++
81-
$ ln -s <your_gcc_installation> gcc
55+
$ wget -qO- https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz | tar xz
56+
$ sudo apt install -y libblas-dev
57+
$ cd eigen-3.3.7 && mkdir build && cd build
58+
$ cmake ..
59+
$ sudo make install
60+
$ cd ../.. && rm -rf eigen-3.3.7/ && rm -f eigen-3.3.7.tar.gz
8261

83-
If you use colorgcc these links all need to point to /usr/bin/colorgcc.
62+
Building PCL
63+
---------------
8464

8565
Now you can get the latest git master (or another one) of PCL and configure your
8666
installation to use the CUDA functions.
@@ -108,23 +88,3 @@ If you want to install your PCL installation for everybody to use::
10888
$ make install
10989

11090
Now your installation is finished!
111-
112-
Tested Hardware
113-
---------------
114-
Please report us the hardware you have tested the following methods with.
115-
116-
+-----------------------+----------------------------------------------------------------------+----------------+
117-
| Method | Hardware | Reported FPS |
118-
+=======================+======================================================================+================+
119-
| Kinfu | GTX680, Intel Xeon CPU E5620 @ 2.40Ghz x 8, 24Gb RAM | 20-27 |
120-
+-----------------------+----------------------------------------------------------------------+----------------+
121-
| | GTX480, Intel Xeon CPU W3550 @ 3.07GHz × 4, 7.8Gb RAM | 40 |
122-
+-----------------------+----------------------------------------------------------------------+----------------+
123-
| | C2070, Intel Xeon CPU E5620 @ 2.40Ghz x 8, 24Gb RAM | 29 |
124-
+-----------------------+----------------------------------------------------------------------+----------------+
125-
| People Pose Detection | GTX680, Intel Xeon CPU E5620 @ 2.40Ghz x 8, 24Gb RAM | 20-23 |
126-
+-----------------------+----------------------------------------------------------------------+----------------+
127-
| | C2070, Intel Xeon CPU E5620 @ 2.40Ghz x 8, 24Gb RAM | 10-20 |
128-
+-----------------------+----------------------------------------------------------------------+----------------+
129-
130-

0 commit comments

Comments
 (0)