-
Notifications
You must be signed in to change notification settings - Fork 4
GPU
Enric Cervera edited this page Nov 17, 2019
·
3 revisions
- Ubuntu 18.04
- ROS Melodic
- Graphics Processor: GeForce 940M
- NVIDIA Driver Version: 418.87.01
cd ~/Downloads/
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys \
https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
sudo apt-get update
sudo apt-get -y install cuda
cd ~/Downloads/
wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.4.0.zip
wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.4.0.zip
unzip opencv.zip
unzip opencv_contrib.zip
mv opencv-3.4.0/ ..
mv opencv_contrib-3.4.0/ ..
cd opencv-3.4.0/
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D WITH_CUDA=ON \
-D ENABLE_FAST_MATH=1 \
-D CUDA_FAST_MATH=1 \
-D WITH_CUBLAS=1 \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.0/modules \
-D BUILD_EXAMPLES=ON \
-D BUILD_opencv_cudacodec=OFF ..
make -j4
sudo make install
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/ros-perception/image_common.git
git clone https://github.com/ros-perception/vision_opencv.git
git clone https://github.com/ros-perception/image_pipeline.git
git clone https://github.com/RobInLabUJI/ricoh_camera.git
cd ..
catkin_make -DOpenCV_DIR=/usr/local/share/OpenCV