# OpenCV

**URL:** <https://forums.developer.nvidia.com/t/opencv/51996>\
**Category:** FAQ\
**Created:** [July 27, 2017, 12:07am UTC](https://forums.developer.nvidia.com/t/opencv/51996 "2017-07-27T00:07:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteveNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/stevenv/32/14043_2.png) [@SteveNV](https://forums.developer.nvidia.com/u/SteveNV)\
**Post date:** [July 27, 2017, 12:07am UTC](https://forums.developer.nvidia.com/t/opencv/51996/1 "2017-07-27T00:07:03Z")

</div>

**Pre-Conditions:**

1. DrivePX2 hardware: AutoCruise or AutoChauffeur.
2. The latest Nvidia Drive Linux SDK is installed, SDK can be downloaded from : [https://developer.nvidia.com/nvidia-drive-downloads](https://developer.nvidia.com/nvidia-drive-downloads)
3. Git is installed , otherwise run : sudo apt-get install git

- sudo apt-get install git
- git config --global user.email “your email”
- git config --global user.name “your name” 

**The instructions to build OpenCV on DrivePX2 Linux (V4L) platform:**

1. Review the instructions at [OpenCV: Building OpenCV for Tegra with CUDA](http://docs.opencv.org/3.2.0/d6/d15/tutorial_building_tegra_cuda.html)
2. Read following notes and apply them accordingly:

1. cherry pick command for cdb9c contains a white space error, change to git cherry-pick cdb9c
2. SDK does not contain default FFMPEG and V4L2, install these packages by :

- sudo apt-get install libx264-dev libx265-dev libvpx-dev ffmpeg
- sudo apt-get install v4l-utils libv4l-dev

- The proper DCUDA\_ARCH\_BIN variable need be set in CMake configurations:

- -DCUDA\_ARCH\_BIN=6.2 // AutoCruise with iGPU 
- -DCUDA\_ARCH\_BIN='6.1 6.2' // AutoChauffeur with both iGPU and dGPU

1. Follow V4L instructions from [OpenCV: Building OpenCV for Tegra with CUDA](http://docs.opencv.org/3.2.0/d6/d15/tutorial_building_tegra_cuda.html) to download and build OpenCV .
2. Both OpenCV 3.1.0 and 2.4.X are supported.
