Skip to content

Commit 2daf744

Browse files
committed
20210414: added OpenCV 3.4.14 and 4.5.2
1 parent 796a0a5 commit 2daf744

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

Makefile

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SHELL := /bin/bash
33
.PHONY: all build_all actual_build build_prep
44

55
# Release to match data of Dockerfile and follow YYYYMMDD pattern
6-
CTO_RELEASE=20210211
6+
CTO_RELEASE=20210414
77

88
# Maximize build speed
99
CTO_NUMPROC := $(shell nproc --all)
@@ -45,8 +45,8 @@ DNN_ARCH_CUDA10=6.0,6.1,7.0,7.5
4545
DNN_ARCH_CUDA11=6.0,6.1,7.0,7.5,8.0,8.6
4646

4747
# According to https://opencv.org/releases/
48-
STABLE_OPENCV3=3.4.13
49-
STABLE_OPENCV4=4.5.1
48+
STABLE_OPENCV3=3.4.14
49+
STABLE_OPENCV4=4.5.2
5050

5151
# TF2 at minimum CUDA 10.1
5252
# TF2 is not going to support CUDA11 until 2.4.0, so not building those yet
@@ -78,25 +78,30 @@ TF1_NUMPY='numpy<1.19.0'
7878
TF2_NUMPY='numpy<1.20.0'
7979

8080
# PyTorch (from pip) using instructions from https://pytorch.org/
81-
PT_CPU="torch==1.7.1+cpu torchvision==0.8.2+cpu torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html"
81+
# and https://pytorch.org/get-started/previous-versions/
82+
# 1.7.1 last version supported by 9.2
83+
PT_CPU="torch==1.8.0+cpu torchvision==0.9.0+cpu torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html"
8284
PT_CUDA9="torch==1.7.1+cu92 torchvision==0.8.2+cu92 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html"
83-
PT_CUDA10="torch torchvision"
84-
PT_CUDA11="torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html"
85+
PT_CUDA10="torch torchvision torchaudio"
86+
PT_CUDA11="torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html"
87+
88+
##########
8589

8690
##### CUDA _ Tensorflow _ OpenCV
87-
CTO_BUILDALL =cuda_tensorflow_opencv-${STABLE_CUDA9}_${STABLE_TF1}_${STABLE_OPENCV3}
88-
CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA9}_${STABLE_TF1}_${STABLE_OPENCV4}
89-
CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA9}_${STABLE_TF2}_${STABLE_OPENCV3}
90-
CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA9}_${STABLE_TF2}_${STABLE_OPENCV4}
91-
CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA10}_${STABLE_TF1}_${STABLE_OPENCV3}
92-
CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA10}_${STABLE_TF1}_${STABLE_OPENCV4}
93-
CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA10}_${STABLE_TF2}_${STABLE_OPENCV3}
94-
CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA10}_${STABLE_TF2}_${STABLE_OPENCV4}
95-
# Ubuntu 20.04 comes with Python 3.8, so unable to build TF1 support
96-
#CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA11}_${STABLE_TF1}_${STABLE_OPENCV3}
97-
#CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA11}_${STABLE_TF1}_${STABLE_OPENCV4}
98-
CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA11}_${STABLE_TF2}_${STABLE_OPENCV3}
99-
CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA11}_${STABLE_TF2}_${STABLE_OPENCV4}
91+
## 20210414: No real interest from users in the cuda_ version of the built containers, not generating those anymore
92+
#CTO_BUILDALL =cuda_tensorflow_opencv-${STABLE_CUDA9}_${STABLE_TF1}_${STABLE_OPENCV3}
93+
#CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA9}_${STABLE_TF1}_${STABLE_OPENCV4}
94+
#CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA9}_${STABLE_TF2}_${STABLE_OPENCV3}
95+
#CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA9}_${STABLE_TF2}_${STABLE_OPENCV4}
96+
#CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA10}_${STABLE_TF1}_${STABLE_OPENCV3}
97+
#CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA10}_${STABLE_TF1}_${STABLE_OPENCV4}
98+
#CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA10}_${STABLE_TF2}_${STABLE_OPENCV3}
99+
#CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA10}_${STABLE_TF2}_${STABLE_OPENCV4}
100+
## Ubuntu 20.04 comes with Python 3.8, so unable to build TF1 support
101+
##CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA11}_${STABLE_TF1}_${STABLE_OPENCV3}
102+
##CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA11}_${STABLE_TF1}_${STABLE_OPENCV4}
103+
#CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA11}_${STABLE_TF2}_${STABLE_OPENCV3}
104+
#CTO_BUILDALL+=cuda_tensorflow_opencv-${STABLE_CUDA11}_${STABLE_TF2}_${STABLE_OPENCV4}
100105

101106
##### CuDNN _ Tensorflow _ OpenCV
102107
DTO_BUILDALL =cudnn_tensorflow_opencv-${STABLE_CUDA9}_${STABLE_TF1}_${STABLE_OPENCV3}
@@ -126,7 +131,7 @@ all:
126131
@echo ""
127132
@echo "** Available Docker images to be built (make targets):"
128133
@echo " tensorflow_opencv: "; echo -n " "; echo ${TO_BUILDALL} | sed -e 's/ /\n /g'
129-
@echo " cuda_tensorflow_opencv: "; echo -n " "; echo ${CTO_BUILDALL} | sed -e 's/ /\n /g'
134+
# @echo " cuda_tensorflow_opencv: "; echo -n " "; echo ${CTO_BUILDALL} | sed -e 's/ /\n /g'
130135
@echo " cudnn_tensorflow_opencv: "; echo -n " "; echo ${DTO_BUILDALL} | sed -e 's/ /\n /g'
131136
@echo ""
132137
@echo "** To build all, use: make build_all"
@@ -136,23 +141,23 @@ all:
136141
## special command to build all targets
137142
build_all:
138143
@make ${TO_BUILDALL}
139-
@make ${CTO_BUILDALL}
144+
# @make ${CTO_BUILDALL}
140145
@make ${DTO_BUILDALL}
141146

142147
tensorflow_opencv:
143148
@make ${TO_BUILDALL}
144149

145-
cuda_tensorflow_opencv:
146-
@make ${CTO_BUILDALL}
150+
#cuda_tensorflow_opencv:
151+
# @make ${CTO_BUILDALL}
147152

148153
cudnn_tensorflow_opencv:
149154
@make ${DTO_BUILDALL}
150155

151156
${TO_BUILDALL}:
152157
@CUDX="" CUDX_COMP="" BTARG="$@" make build_prep
153158

154-
${CTO_BUILDALL}:
155-
@CUDX="cuda" CUDX_COMP="" BTARG="$@" make build_prep
159+
#${CTO_BUILDALL}:
160+
# @CUDX="cuda" CUDX_COMP="" BTARG="$@" make build_prep
156161

157162
${DTO_BUILDALL}:
158163
@CUDX="cudnn" CUDX_COMP="-DWITH_CUDNN=ON -DOPENCV_DNN_CUDA=ON" BTARG="$@" make build_prep

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# DockerFile with Nvidia GPU support for TensorFlow and OpenCV
2-
Revision: 20210211
2+
Revision: 20210414
33

44
<!-- vscode-markdown-toc -->
55
* 1. [About](#About)
@@ -41,17 +41,13 @@ Version history:
4141
- `20200803`: added PyTorch. Removal of `cudnn_` version for CUDA 9.2 with TensorFlow 2.3.0 (minimum needed was 10.1)
4242
- `20201204`: added support for Python 3.7 for TensorFlow 1 builds and Python 3.8 for Tensorflow 2 builds (makes use of the [`deadsnakes/ppa`](https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa) and changes the default `python3`). Warning: only `pip3` installed packages will work, not `apt-get` installed ones (Python 3.6 is still the default for Ubuntu 18.04)
4343
- `20210211`: added support for CUDA 11 (using Nvidia's Ubuntu 20.04 based container). CUDA 9.2 and 10.2 versions are still created from Nvidia's Ubuntu 18.04 based containers.
44+
- `20210414`: updated for OpenCV 3.4.14 and 4.5.2, removed `cuda_` from build target (and built containers)
4445

4546
`tensorflow_opencv`:
4647
- Builds containers with TensorFlow and OpenCV. Also install, Jupyter, Keras, numpy, pandas, PyTorch and X11 support.
4748
- Can be used on systems without a Nvidia GPU, and the `runDocker.sh` script will setup proper X11 passthrough
4849
- for MacOS X11 passthrough, install the latest XQuartz server and activate the `Security -> Allow connections from network clients` (must logout for it to take effect)
4950

50-
`cuda_tensorflow_opencv`:
51-
- Builds an Nvidia GPU optimized version of OpenCV. Also install, Jupyter, Keras, numpy, pandas, PyTorch and X11 support.
52-
- Note that TensorFlow need CUDNN for GPU support.
53-
- Requires a Linux system with nvidia-docker (v2) and the Nvidia drivers installed to run. See https://github.com/NVIDIA/nvidia-docker for setup details
54-
5551
`cudnn_tensorflow_opencv`:
5652
- Builds an Nvidia GPU optimized version of TensorFlow and OpenCV. Also install, Jupyter, Keras, numpy, pandas, PyTorch and X11 support.
5753
- As of the 20200615 version, both OpenCV and TensorFlow are compiled within the container.
@@ -61,7 +57,7 @@ Version history:
6157
`jetsonnano-cuda_tensorflow_opencv` (see the `JetsonNano` directory):
6258
- Builds a Nvidia Jetson Nano `cuda_tensorflow_opencv` container image based on Nvidia's provided `l4t-base` container and adapted from the `Makefile` and `Dockerfile` used for the other builds.
6359

64-
**Docker Images built from this repository are publicly available at https://hub.docker.com/r/datamachines/tensorflow_opencv / https://hub.docker.com/r/datamachines/cuda_tensorflow_opencv / https://hub.docker.com/r/datamachines/cudnn_tensorflow_opencv / https://hub.docker.com/r/datamachines/jetsonnano-cuda_tensorflow_opencv .**
60+
**Docker Images built from this repository are publicly available at https://hub.docker.com/r/datamachines/tensorflow_opencv / https://hub.docker.com/r/datamachines/cudnn_tensorflow_opencv / https://hub.docker.com/r/datamachines/jetsonnano-cuda_tensorflow_opencv .**
6561

6662
The [Builds-DockerHub.md](https://github.com/datamachines/cuda_tensorflow_opencv/blob/master/Builds-DockerHub.md) file is a quick way of seeing the list of pre-built container images. When available, a "BuiidInfo" will give the end user a deeper look of the capabilities of said container and installed version. In particular the compiled GPU architecture (see https://en.wikipedia.org/wiki/CUDA#GPUs_supported ).
6763
This is useful for you to decide if you would benefit from re-compiling some container(s) for your specific hardware.
@@ -84,7 +80,6 @@ The tag for any image built will contain the `datamachines/` organization additi
8480
Use the provided `Makefile` by running `make` to get a list of targets to build:
8581
- `make build_all` will build all container images
8682
- `make tensorflow_opencv` to build all the `tensorflow_opencv` container images
87-
- `make cuda_tensorflow_opencv` will build all the `cuda_tensorflow_opencv` container images
8883
- `make cudnn_tensorflow_opencv` will build all the `cudnn_tensorflow_opencv` container images
8984
- use a direct tag to build a specific version (from the list provided by the call to `make`); for example `make cudnn_tensorflow_opencv-10.2_2.2.0_4.3.0`, will build the `datamachines/cudnn_tensorflow_opencv:10.2_2.2.0_4.3.0-20200615` container image (if such a built is available, see the `Docker Image tag ending` and the list of `Available Docker images to be built` for accurate values).
9085

0 commit comments

Comments
 (0)