From 919d0619f00fd0c70bd6ce1c14bae9d774e4d79f Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Fri, 23 Jul 2021 14:21:12 +0000 Subject: [PATCH] Docker: rebase CUDA image on newest Nvidia runtime, add a fixup that installs all CUDA RT versions --- Dockerfile | 3 +++ Makefile | 31 ++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d99cdef4d..9f3c61e27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ ARG BASE_IMAGE FROM $BASE_IMAGE +ARG FIXUP=echo MAINTAINER OCR-D ENV DEBIAN_FRONTEND noninteractive ENV PYTHONIOENCODING utf8 @@ -28,8 +29,10 @@ RUN apt-get update && apt-get -y install --no-install-recommends \ git \ && pip3 install --upgrade pip setuptools \ && make install \ + && $FIXUP \ && rm -rf /build-ocrd + WORKDIR /data CMD ["/usr/local/bin/ocrd", "--help"] diff --git a/Makefile b/Makefile index e32b3dc71..f126ee3a9 100644 --- a/Makefile +++ b/Makefile @@ -201,13 +201,42 @@ pyclean: # Docker # +.PHONY: docker docker-cuda + # Build docker image docker docker-cuda: docker build -t $(DOCKER_TAG) --build-arg BASE_IMAGE=$(DOCKER_BASE_IMAGE) $(DOCKER_ARGS) . # Build docker GPU / CUDA image -docker-cuda: DOCKER_BASE_IMAGE = nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04 +docker-cuda: DOCKER_BASE_IMAGE = nvidia/cuda:11.3.1-cudnn8-runtime-ubuntu18.04 docker-cuda: DOCKER_TAG = ocrd/core-cuda +docker-cuda: DOCKER_ARGS += --build-arg FIXUP="make cuda-ubuntu cuda-ldconfig" + +# +# CUDA +# + +.PHONY: cuda-ubuntu cuda-ldconfig + +# Install native CUDA toolkit in different versions +cuda-ubuntu: cuda-ldconfig + apt-get -y install --no-install-recommends cuda-runtime-10-0 cuda-runtime-10-1 cuda-runtime-10-2 cuda-runtime-11-0 cuda-runtime-11-1 cuda-runtime-11-3 libcudnn7 + +cuda-ldconfig: /etc/ld.so.conf.d/cuda.conf + ldconfig + +/etc/ld.so.conf.d/cuda.conf: + @echo > $@ + @echo /usr/local/cuda-10.0/lib64 >> $@ + @echo /usr/local/cuda-10.0/targets/x86_64-linux/lib >> $@ + @echo /usr/local/cuda-10.1/lib64 >> $@ + @echo /usr/local/cuda-10.1/targets/x86_64-linux/lib >> $@ + @echo /usr/local/cuda-10.2/lib64 >> $@ + @echo /usr/local/cuda-10.2/targets/x86_64-linux/lib >> $@ + @echo /usr/local/cuda-11.0/lib64 >> $@ + @echo /usr/local/cuda-11.0/targets/x86_64-linux/lib >> $@ + @echo /usr/local/cuda-11.1/lib64 >> $@ + @echo /usr/local/cuda-11.1/targets/x86_64-linux/lib >> $@ # # bash library