Attempting to build opencv-python with Dockerfile on jetson nano but error
Dockerfile
Dockerfile (excerpt of relevant part)
# install opencv python3 (without CUDA option)
RUN git clone https://github.com/mdegans/nano_build_opencv /tmp/nano_build_opencv
RUN gosu jetson /tmp/nano_build_opencv/build_opencv.sh 3.4.10
Error when docker build
$ docker build -t xxx .
...
-- Video I/O:
-- DC1394: YES (ver 2.2.5)
-- FFMPEG: YES
-- avcodec: YES (ver 57.107.100)
-- avformat: YES (ver 57.83.100)
-- avutil: YES (ver 55.78.100)
-- swscale: YES (ver 4.8.100)
-- avresample: YES (ver 3.7.0)
-- GStreamer: YES
-- base: YES (ver 1.14.5)
-- video: YES (ver 1.14.5)
-- app: YES (ver 1.14.5)
-- riff: YES (ver 1.14.5)
-- pbutils: YES (ver 1.14.5)
-- libv4l/libv4l2: 1.14.2 / 1.14.2
-- v4l/v4l2: linux/videodev2.h
--
-- Parallel framework: pthreads
--
-- Trace: YES (with Intel ITT)
--
-- Other third-party libraries:
-- Lapack: YES (/usr/lib/aarch64-linux-gnu/liblapack.so /usr/lib/aarch64-linux-gnu/libcblas.so /usr/lib/aarch64-linux-gnu/libatlas.so)
-- Eigen: YES (ver 3.3.4)
-- Custom HAL: YES (carotene (ver 0.0.1))
-- Protobuf: build (3.5.1)
--
-- NVIDIA CUDA: YES (ver 10.2, CUFFT CUBLAS FAST_MATH)
-- NVIDIA GPU arch: 53 62 72
-- NVIDIA PTX archs:
--
-- OpenCL: YES (no extra features)
-- Include path: /tmp/build_opencv/opencv/3rdparty/include/opencl/1.2
-- Link libraries: Dynamic load
--
-- Python 2:
-- Interpreter: /usr/bin/python2.7 (ver 2.7.17)
-- Libraries: /usr/lib/aarch64-linux-gnu/libpython2.7.so (ver 2.7.17)
-- numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.13.3)
-- install path: lib/python2.7/dist-packages/cv2/python-2.7
--
-- Python 3:
-- Interpreter: /usr/bin/python3 (ver 3.6.9)
-- Libraries: /usr/lib/aarch64-linux-gnu/libpython3.6m.so (ver 3.6.9)
-- numpy: /usr/local/lib/python3.6/dist-packages/numpy/core/include (ver 1.19.2)
-- install path: lib/python3.6/dist-packages/cv2/python-3.6
--
-- Python (for build): /usr/bin/python2.7
--
-- Java:
-- ant: NO
-- JNI: NO
-- Java wrappers: NO
-- Java tests: NO
--
-- Install to: /usr/local
-- -----------------------------------------------------------------
--
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cufft_LIBRARY (ADVANCED)
...
-- Configuring incomplete, errors occurred!
See also "/tmp/build_opencv/opencv/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/build_opencv/opencv/build/CMakeFiles/CMakeError.log".
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target 'install'. Stop.
Avoided by turning off CUDA option when building OpenCV (Is this correct?)
Dockerfile (excerpt of relevant part)
# install opencv python3 (without CUDA option)
RUN git clone https://github.com/mdegans/nano_build_opencv /tmp/nano_build_opencv
ADD build_opencv.patch /.
RUN patch -p1 /build_opencv.patch && \
gosu jetson /tmp/nano_build_opencv/build_opencv.sh 3.4.10
Patch to turn off CUDA option
build_opencv.patch
--- build_opencv.sh.org 2020-11-07 11:37:01.350665183 +0900
+++ build_opencv.sh 2020-11-07 11:37:29.144085743 +0900
@@ -108,19 +108,12 @@
-D BUILD_opencv_python3=ON
-D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=${PREFIX}
- -D CUDA_ARCH_BIN=5.3,6.2,7.2
- -D CUDA_ARCH_PTX=
- -D CUDA_FAST_MATH=ON
- -D CUDNN_VERSION='8.0'
-D EIGEN_INCLUDE_PATH=/usr/include/eigen3
-D ENABLE_NEON=ON
-D OPENCV_DNN_CUDA=ON
-D OPENCV_ENABLE_NONFREE=ON
-D OPENCV_EXTRA_MODULES_PATH=/tmp/build_opencv/opencv_contrib/modules
-D OPENCV_GENERATE_PKGCONFIG=ON
- -D WITH_CUBLAS=ON
- -D WITH_CUDA=ON
- -D WITH_CUDNN=ON
-D WITH_GSTREAMER=ON
-D WITH_LIBV4L=ON
-D WITH_OPENGL=ON"
Recommended Posts