Skip to content

Latest commit

 

History

History
12 lines (11 loc) · 1.39 KB

OPENCV_BUILD.md

File metadata and controls

12 lines (11 loc) · 1.39 KB

Obtaining opencv-python with CUDA support

  1. Follow steps 1 and 2 in Manual Build at OpenCV-Python Package;
  2. Discover your GPU Compute Capability. You will need to replace in the flag -DCUDA_ARCH_BIN=<YOUR CUDA VERSION> on step 3;
  3. Install dependencies:
  4. Build with this command, this may take a while:
ENABLE_HEADLESS=1 ENABLE_CONTRIB=1 CMAKE_ARGS="-DWITH_TBB=ON -DWITH_CUDA=ON -DWITH_CUDNN=ON -DWITH_CUBLAS=ON -DWITH_FFMPEG=ON -DWITH_GSTREAMER=ON -DWITH_OPENJPEG=ON -DWITH_JPEG=ON -DOPENCV_ENABLE_NONFREE=ON -DWITH_OPENMP=ON -DWITH_LAPACK=ON -DCUDA_FAST_MATH=1 -DENABLE_FAST_MATH=1 -DOPENCV_DNN_CUDA=ON -DWITH_V4L=ON -DWITH_OPENGL=ON -DWITH_GSTREAMER=ON -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_EXAMPLES=OFF -DCUDA_ARCH_BIN=7.5" pip wheel . --verbose
  1. The compiled .whl files will be in the the opencv-python, you can install them with: pip install <fileneame>.whl