Ubuntu10.10 install Opencv2.2 (with gpu, cuda module) preparation: 1. Install the CUDA driver. This may be troublesome. Here is a reference page. For more information, refer to. Or
Preparation for installing Opencv2.2 (with gpu and cuda module) in Ubuntu 10.10:
1. Install the CUDA driver. This may be troublesome. Here is a reference page for reference.
Http://www.linuxidc.com/Linux/2010-10/29455.htm
This is about installing a common driver, but we need to use a developer driver for cuda programming. Download the driver here.
Mine is 32-bit
2. Install cuda toolkit.
Download it here
3. Install the SDK
Here again
The three steps 1, 2, 3 must be installed in this order.
After the CUDA driver is installed, it may not be able to enter the graphical interface. You need to start X on the command line.
Start to install OpenCV:
1. Install the following packages
Apt-get install build-essential apt-get install cmake apt-get install pkg-config apt-get install libpng12-0 libpng12-dev libpng ++-dev libpngng3 apt-get install libpnglite-dev libpngwriter0-dev libpngwriter0c2 apt-get install zlib1g-dbg zlib1g zlib1g-dev apt-get install libjasper-dev libjasper-runtime libjasper1 apt-get install pngtools libtiff4-dev lib%4 lib%xx0c2 libtiff-tools apt-get install lib%8 libjpeg8-dev libjpeg8-dbg libjpeg-prog apt -get install ffmpeg libavcodec-dev libavcodec52 libavformat52 libavformat-dev apt-get install runtime-0-dbg runtime-0 libgstreamer0.10-dev apt-get install libxine1-ffmpeg libxine-dev libxine1-bin apt-get install libunicap2 libunicap2-dev apt-get install libdc1394-22-dev libdc1394-22 libdc1394-utils apt-get install swig apt-get install libv4l-0 libv4l-dev apt-get install python-numpy apt-get install libpython2.6 python-dev python2.6-dev # You must install this for python support
2. Cmake extracts the installation file to the current directory, for example, LinuxIDC.com
Cmake <你linuxidc.com文件存放的文件夹>
3. Create a release folder
Mkdir release
Download the NPP development kit from the nvidia website.
4. Go to the release folder.
Cd release
5. Use Cmake to generate Makefile. This step is very important. The official instructions use the make command, which is incorrect and should be the cmake command.
First, make the PATH environment variable contain the cuda/bin PATH, for example,/usr/local/cuda/bin.
Then, the LD_LIBRARY_PATH contains the cuda/lib path, for example,/usr/local/cuda/lib (32-bit System)/usr/local/cuda/lib64: use the export command to import environment variables to/usr/local/cuda/lib. If you are not familiar with it, check it on google.
Then execute
Cmake-D CMAKE_BUILD_TYPE = RELEASE-D CMAKE_INSTALL_PREFIX =/usr/local-D plugin = here is the path to the SDK folder after unzipping NPP-D WITH_CUDA = ON-D BUILD_PYTHON_SUPPORT = ON-D BUILD_EXAMPLES = ON ..
6. According to the official document, you can directly execute the make command in the release directory. During the previous experiments, Makefile is indeed generated in the release directory, however, the previous directory of the release generates Makefile several times. If the previous directory contains Makefile, then cd .. then execute make
7. sudo make install
Installation is complete.
Test whether the installation is complete. Go to OpenCV (to see which directory you are installing)/bin, which contains a hog_gpu and execute it (at least two parameters-src and-src_is_video are required ), if yes, the installation is complete.