User Tools

Site Tools


drexel_cuda_install

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

drexel_cuda_install [2016/10/31 22:04] – created dwallacedrexel_cuda_install [2016/10/31 22:06] (current) dwallace
Line 1: Line 1:
 ====== 5. Installing CUDA with OpenCV and PCL ====== ====== 5. Installing CUDA with OpenCV and PCL ======
  
-'''0) Start'''+**0) Start**
  
 I would suggest starting this on a newly formatted partition of Linux, because if you screw up some things may be broken for good. You have been warned. I would suggest starting this on a newly formatted partition of Linux, because if you screw up some things may be broken for good. You have been warned.
  
-'''1) CUDA INSTALL''' +**1) CUDA INSTALL**
- +
- +
-[http://sn0v.wordpress.com/2012/12/07/installing-cuda-5-on-ubuntu-12-04/ Installing CUDA-5.5 in Linux 12.04 LTS (Original Page--below is copied content)]+
  
 +[[http://sn0v.wordpress.com/2012/12/07/installing-cuda-5-on-ubuntu-12-04/|Installing CUDA-5.5 in Linux 12.04 LTS (Original Page--below is copied content)]]
  
 This is a follow up to my previous post which was aimed at CUDA 4.2 on Ubuntu 12.04. Although 12.10 is out, it’s not as stable as I would like it to be – I’d recommend sticking with Ubuntu 12.04 for development unless you have specific reasons to upgrade. With CUDA 5, Nvidia has greatly simplified the installation process for Linux, packaging the CUDA toolkit, the SDK and the development drivers all in a neat little package. This is a follow up to my previous post which was aimed at CUDA 4.2 on Ubuntu 12.04. Although 12.10 is out, it’s not as stable as I would like it to be – I’d recommend sticking with Ubuntu 12.04 for development unless you have specific reasons to upgrade. With CUDA 5, Nvidia has greatly simplified the installation process for Linux, packaging the CUDA toolkit, the SDK and the development drivers all in a neat little package.
Line 24: Line 22:
 Make sure the requisite tools are installed using the following command - Make sure the requisite tools are installed using the following command -
  
-::sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev+  sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
  
 Next, blacklist the required modules (so that they don’t interfere with the driver installation) - Next, blacklist the required modules (so that they don’t interfere with the driver installation) -
  
-::sudo nano /etc/modprobe.d/blacklist.conf+  sudo nano /etc/modprobe.d/blacklist.conf
  
 Add the following lines to the end of the file, one per line, and save it when done - Add the following lines to the end of the file, one per line, and save it when done -
Line 41: Line 39:
 In order to get rid of any nVidia residuals, run the following command in a terminal - In order to get rid of any nVidia residuals, run the following command in a terminal -
  
-::sudo apt-get remove --purge nvidia*+  sudo apt-get remove --purge nvidia*
  
 This may take a while, so be patient. Once it’s done, reboot your machine. At the login screen, don’t login just yet. Press Ctrl+Alt+F1 to switch to a text-based login, and switch to the directory which contains the downloaded driver. Run the following commands - This may take a while, so be patient. Once it’s done, reboot your machine. At the login screen, don’t login just yet. Press Ctrl+Alt+F1 to switch to a text-based login, and switch to the directory which contains the downloaded driver. Run the following commands -
  
-::sudo service lightdm stop +  sudo service lightdm stop 
-::chmod +x NVIDIA*.run+  chmod +x NVIDIA*.run 
 +  
 where NVIDIA*.run is the full name of your driver. Next, start the installation with - where NVIDIA*.run is the full name of your driver. Next, start the installation with -
  
-::sudo ./NVIDIA*.run+  sudo ./NVIDIA*.run 
 +  
 Follow the onscreen instructions. If the installer throws up an error about nouveau still running, allow it to create a blacklist for nouveau, quit the installation and reboot. In that case, run the following commands again - Follow the onscreen instructions. If the installer throws up an error about nouveau still running, allow it to create a blacklist for nouveau, quit the installation and reboot. In that case, run the following commands again -
  
-::sudo service lightdm stop +  sudo service lightdm stop 
-::sudo ./NVIDIA*.run+  sudo ./NVIDIA*.run 
 +  
 The installation should now proceed smoothly. When it asks you if you want the 32-bit libraries and if you want it to edit xorg.conf to use these drivers by default, allow both. The installation should now proceed smoothly. When it asks you if you want the 32-bit libraries and if you want it to edit xorg.conf to use these drivers by default, allow both.
  
Line 62: Line 63:
 Download the CUDA toolkit (I used the Ubuntu 11.10 64-bit version). Navigate to the directory that contains the downloaded CUDA toolkit package, and run the following command - Download the CUDA toolkit (I used the Ubuntu 11.10 64-bit version). Navigate to the directory that contains the downloaded CUDA toolkit package, and run the following command -
  
-::chmod +x cuda*.run +  chmod +x cuda*.run 
-::sudo ./cuda*.run+  sudo ./cuda*.run 
 +  
 where cuda*.run is the full name of the downloaded CUDA toolkit. Accept the license that appears. Next, choose to install the driver if you’ve not done so already (this is the development version). Installation of the driver will require switching to a text-based shell (Ctrl+Alt+F1), stopping lightdm as detailed in the previous step and running the toolkit installer as superuser. The CUDA 5.0 toolkit installation is compulsory, while that of the included samples isn’t. Allow the installer to proceed with default locations unless you have specific reasons for not doing so. This makes for easier troubleshooting in the future. where cuda*.run is the full name of the downloaded CUDA toolkit. Accept the license that appears. Next, choose to install the driver if you’ve not done so already (this is the development version). Installation of the driver will require switching to a text-based shell (Ctrl+Alt+F1), stopping lightdm as detailed in the previous step and running the toolkit installer as superuser. The CUDA 5.0 toolkit installation is compulsory, while that of the included samples isn’t. Allow the installer to proceed with default locations unless you have specific reasons for not doing so. This makes for easier troubleshooting in the future.
  
Line 71: Line 73:
  
 32 bit systems - 32 bit systems -
-::export PATH=$PATH:/usr/local/cuda-5.0/bin + 
-::export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib+  export PATH=$PATH:/usr/local/cuda-5.0/bin 
 +  export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib
  
 64 bit systems - 64 bit systems -
-::export PATH=$PATH:/usr/local/cuda-5.0/bin + 
-::export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib64:/lib+  export PATH=$PATH:/usr/local/cuda-5.0/bin 
 +  export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib64:/lib
  
 The paths used above will vary based on the install directory you choose for the toolkit. This wraps up the arguably simpler setup (compared to CUDA 4.x for Linux users), although the samples’ installation still suffers from dependency hell. The paths used above will vary based on the install directory you choose for the toolkit. This wraps up the arguably simpler setup (compared to CUDA 4.x for Linux users), although the samples’ installation still suffers from dependency hell.
Line 86: Line 90:
 Determine if variants of libglut.so are present as follows - Determine if variants of libglut.so are present as follows -
  
-::sudo find /usr -name libglut\*+  sudo find /usr -name libglut\*
  
 On my 64-bit installation of Ubuntu 12.04, this output the following text - On my 64-bit installation of Ubuntu 12.04, this output the following text -
  
-/usr/lib/x86_64-linux-gnu/libglut.so.3 +  /usr/lib/x86_64-linux-gnu/libglut.so.3 
-/usr/lib/x86_64-linux-gnu/libglut.so.3.9.0 +  /usr/lib/x86_64-linux-gnu/libglut.so.3.9.0 
-/usr/lib/x86_64-linux-gnu/libglut.a +  /usr/lib/x86_64-linux-gnu/libglut.a 
-/usr/lib/x86_64-linux-gnu/libglut.so+  /usr/lib/x86_64-linux-gnu/libglut.so
  
 Now that a variant of libglut.so (that is, libglut.so.3) has been found, we can create a softlink to it - Now that a variant of libglut.so (that is, libglut.so.3) has been found, we can create a softlink to it -
  
-::sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so+  sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so
  
 Next, rerun the all in one installer choosing to install only the samples this time around. That should fix the “Missing libraries” error that cropped up previously. Next, rerun the all in one installer choosing to install only the samples this time around. That should fix the “Missing libraries” error that cropped up previously.
Line 106: Line 110:
  
  
- +**2) OpenCV Install**
- +
- +
-'''2) OpenCV Install'''+
  
 Go to your working directory/make one Go to your working directory/make one
Line 115: Line 116:
 Get the latest repo of OpenCV available Get the latest repo of OpenCV available
  
-::git clone https://github.com/Itseez/opencv.git +  git clone https://github.com/Itseez/opencv.git
  
 Install dependencies (not sure how many of these are actually needed....) Install dependencies (not sure how many of these are actually needed....)
  
-::sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev +  sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev 
  
 Install cmake gui Install cmake gui
  
-::sudo apt-get install cmake-qt-gui+  sudo apt-get install cmake-qt-gui
  
 Set proper source (opencv) and build directories (opencv/build) Set proper source (opencv) and build directories (opencv/build)
Line 136: Line 136:
 Go to your build directory Go to your build directory
  
-::make -j8+  make -j8
  
 (-j8 is a flag to tell your computer to make the file with all 8 cores. Change the 8 to however many cores you currently have.) (-j8 is a flag to tell your computer to make the file with all 8 cores. Change the 8 to however many cores you currently have.)
  
-::sudo make install+  sudo make install
  
 At this time you should try out a couple of the tests that they have so graciously provided. Some of the functions may not work but that is OKAY as long as most of them work...some functions will work with some versions of the CUDA SDK and others will not. At this time you should try out a couple of the tests that they have so graciously provided. Some of the functions may not work but that is OKAY as long as most of them work...some functions will work with some versions of the CUDA SDK and others will not.
  
 Go to some of their sample program code (not the tests) and try to run that--this will really be the determining fa Go to some of their sample program code (not the tests) and try to run that--this will really be the determining fa
drexel_cuda_install.txt · Last modified: 2016/10/31 22:06 by dwallace