Skip to content

Commit

Permalink
add: fix for cudnn version mismatch and set pip tensorrt cuda version…
Browse files Browse the repository at this point in the history
…, add loguru fastapi uvicorn ffmpeg-python
  • Loading branch information
minostauros committed May 27, 2024
1 parent f8de00e commit 2ef0504
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Associated pytorch version will not be set automatically. Scroll down and set appropriate versions.

FROM ghcr.io/minostauros/cuda-ffmpeg-opencv-docker:4.7.0-cu118-py310
FROM ghcr.io/minostauros/cuda-ffmpeg-opencv-docker:4.9.0-cu118-py310

ARG PYTHON_VERSION=3.10
ARG PYTORCH_VERSION=2.1.2
Expand All @@ -20,6 +20,7 @@ ARG TARGET_CUDA_VERSION=cu118
ARG CUDA_VERSION=11.8
# TensorRT for cuda11.8 supports cuda11.x
ARG TENSORRT_VERSION="8.6.1.6-1+cuda11.8"
ARG PIP_TENSORRT=tensorrt-cu11
ARG ONNXRUNTIME_VERSION=1.18.0

# environmental variable for apex
Expand Down Expand Up @@ -67,13 +68,15 @@ RUN echo "Asia/Seoul" > /etc/timezone && \
# PyTorch (Mind cuda version and associated torch and torchvision versions)
python${PYTHON_VERSION} -m pip install --upgrade pip && \
pip${PYTHON_VERSION} install torch==${PYTORCH_VERSION}+${TARGET_CUDA_VERSION} torchvision==${TORCHVISION_VERSION}+${TARGET_CUDA_VERSION} torchaudio==${TORCHAUDIO_VERSION}+${TARGET_CUDA_VERSION} --index-url https://download.pytorch.org/whl/${TARGET_CUDA_VERSION} && \
# CuDNN version mismatch betwen opencv and torch: https://discuss.pytorch.org/t/compiling-opencv-with-cuda-11-8-breaks-pytorch-convolution/203470
pip uninstall -y nvidia-cudnn-cu11 && \
# CMake higher version than apt-get
pip${PYTHON_VERSION} install cmake packaging && \
# python packages for running FlowNet2.0 and install tensorboard
pip${PYTHON_VERSION} install cffi tensorboardX tensorboard torch_tb_profiler tqdm scikit-image colorama==0.3.7 setproctitle pytz && \
# python packages for minostauros
pip${PYTHON_VERSION} install h5py munkres scikit-learn visdom youtube_dl matplotlib nibabel pypng moviepy Pillow einops torchinfo && \
pip${PYTHON_VERSION} install timm decord simplejson av psutil fire fairscale ftfy && \
pip${PYTHON_VERSION} install timm decord ffmpeg-python simplejson av psutil fire fairscale ftfy loguru uvicorn fastapi && \
# nvidia apex
# setuptools==69.5.1 for https://github.com/aws-neuron/aws-neuron-sdk/issues/893
pip${PYTHON_VERSION} install setuptools==69.5.1 && \
Expand Down Expand Up @@ -126,7 +129,7 @@ RUN echo "Asia/Seoul" > /etc/timezone && \
libnvinfer-lean8=${TENSORRT_VERSION} libnvinfer-samples=${TENSORRT_VERSION} \
libnvinfer-vc-plugin-dev=${TENSORRT_VERSION} libnvinfer-vc-plugin8=${TENSORRT_VERSION} \
tensorrt=${TENSORRT_VERSION} && \
pip${PYTHON_VERSION} install tensorrt && \
pip${PYTHON_VERSION} install ${PIP_TENSORRT} && \
pip${PYTHON_VERSION} install onnxruntime-gpu==${ONNXRUNTIME_VERSION} && \
# DIR=/tmp/onnxruntime && \
# mkdir -p ${DIR} && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Associated pytorch version will not be set automatically. Scroll down and set appropriate versions.

FROM ghcr.io/minostauros/cuda-ffmpeg-opencv-docker:4.7.0-cu118-py310
FROM ghcr.io/minostauros/cuda-ffmpeg-opencv-docker:4.9.0-cu118-py310

ARG PYTHON_VERSION=3.10
ARG PYTORCH_VERSION=2.2.1
Expand All @@ -20,6 +20,7 @@ ARG TARGET_CUDA_VERSION=cu118
ARG CUDA_VERSION=11.8
# TensorRT for cuda11.8 supports cuda11.x
ARG TENSORRT_VERSION="8.6.1.6-1+cuda11.8"
ARG PIP_TENSORRT=tensorrt-cu11
ARG ONNXRUNTIME_VERSION=1.18.0

# environmental variable for apex
Expand Down Expand Up @@ -67,13 +68,15 @@ RUN echo "Asia/Seoul" > /etc/timezone && \
# PyTorch (Mind cuda version and associated torch and torchvision versions)
python${PYTHON_VERSION} -m pip install --upgrade pip && \
pip${PYTHON_VERSION} install torch==${PYTORCH_VERSION}+${TARGET_CUDA_VERSION} torchvision==${TORCHVISION_VERSION}+${TARGET_CUDA_VERSION} torchaudio==${TORCHAUDIO_VERSION}+${TARGET_CUDA_VERSION} --index-url https://download.pytorch.org/whl/${TARGET_CUDA_VERSION} && \
# CuDNN version mismatch betwen opencv and torch: https://discuss.pytorch.org/t/compiling-opencv-with-cuda-11-8-breaks-pytorch-convolution/203470
pip uninstall -y nvidia-cudnn-cu11 && \
# CMake higher version than apt-get
pip${PYTHON_VERSION} install cmake packaging && \
# python packages for running FlowNet2.0 and install tensorboard
pip${PYTHON_VERSION} install cffi tensorboardX tensorboard torch_tb_profiler tqdm scikit-image colorama==0.3.7 setproctitle pytz && \
# python packages for minostauros
pip${PYTHON_VERSION} install h5py munkres scikit-learn visdom youtube_dl matplotlib nibabel pypng moviepy Pillow einops torchinfo && \
pip${PYTHON_VERSION} install timm decord simplejson av psutil fire fairscale ftfy && \
pip${PYTHON_VERSION} install timm decord ffmpeg-python simplejson av psutil fire fairscale ftfy loguru uvicorn fastapi && \
# nvidia apex
# setuptools==69.5.1 for https://github.com/aws-neuron/aws-neuron-sdk/issues/893
pip${PYTHON_VERSION} install setuptools==69.5.1 && \
Expand Down Expand Up @@ -126,7 +129,7 @@ RUN echo "Asia/Seoul" > /etc/timezone && \
libnvinfer-lean8=${TENSORRT_VERSION} libnvinfer-samples=${TENSORRT_VERSION} \
libnvinfer-vc-plugin-dev=${TENSORRT_VERSION} libnvinfer-vc-plugin8=${TENSORRT_VERSION} \
tensorrt=${TENSORRT_VERSION} && \
pip${PYTHON_VERSION} install tensorrt && \
pip${PYTHON_VERSION} install ${PIP_TENSORRT} && \
pip${PYTHON_VERSION} install onnxruntime-gpu==${ONNXRUNTIME_VERSION} && \
# DIR=/tmp/onnxruntime && \
# mkdir -p ${DIR} && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ARG TARGET_CUDA_VERSION=cu118
ARG CUDA_VERSION=11.8
# TensorRT for cuda11.8 supports cuda11.x
ARG TENSORRT_VERSION="8.6.1.6-1+cuda11.8"
ARG PIP_TENSORRT=tensorrt-cu11
ARG ONNXRUNTIME_VERSION=1.18.0

# environmental variable for apex
Expand Down Expand Up @@ -67,13 +68,15 @@ RUN echo "Asia/Seoul" > /etc/timezone && \
# PyTorch (Mind cuda version and associated torch and torchvision versions)
python${PYTHON_VERSION} -m pip install --upgrade pip && \
pip${PYTHON_VERSION} install torch==${PYTORCH_VERSION}+${TARGET_CUDA_VERSION} torchvision==${TORCHVISION_VERSION}+${TARGET_CUDA_VERSION} torchaudio==${TORCHAUDIO_VERSION}+${TARGET_CUDA_VERSION} --index-url https://download.pytorch.org/whl/${TARGET_CUDA_VERSION} && \
# CuDNN version mismatch betwen opencv and torch: https://discuss.pytorch.org/t/compiling-opencv-with-cuda-11-8-breaks-pytorch-convolution/203470
pip uninstall -y nvidia-cudnn-cu11 && \
# CMake higher version than apt-get
pip${PYTHON_VERSION} install cmake packaging && \
# python packages for running FlowNet2.0 and install tensorboard
pip${PYTHON_VERSION} install cffi tensorboardX tensorboard torch_tb_profiler tqdm scikit-image colorama==0.3.7 setproctitle pytz && \
# python packages for minostauros
pip${PYTHON_VERSION} install h5py munkres scikit-learn visdom youtube_dl matplotlib nibabel pypng moviepy Pillow einops torchinfo && \
pip${PYTHON_VERSION} install timm decord simplejson av psutil fire fairscale ftfy && \
pip${PYTHON_VERSION} install timm decord ffmpeg-python simplejson av psutil fire fairscale ftfy loguru uvicorn fastapi && \
# nvidia apex
# setuptools==69.5.1 for https://github.com/aws-neuron/aws-neuron-sdk/issues/893
pip${PYTHON_VERSION} install setuptools==69.5.1 && \
Expand Down Expand Up @@ -126,7 +129,7 @@ RUN echo "Asia/Seoul" > /etc/timezone && \
libnvinfer-lean8=${TENSORRT_VERSION} libnvinfer-samples=${TENSORRT_VERSION} \
libnvinfer-vc-plugin-dev=${TENSORRT_VERSION} libnvinfer-vc-plugin8=${TENSORRT_VERSION} \
tensorrt=${TENSORRT_VERSION} && \
pip${PYTHON_VERSION} install tensorrt && \
pip${PYTHON_VERSION} install ${PIP_TENSORRT} && \
pip${PYTHON_VERSION} install onnxruntime-gpu==${ONNXRUNTIME_VERSION} && \
# DIR=/tmp/onnxruntime && \
# mkdir -p ${DIR} && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ARG TARGET_CUDA_VERSION=cu121
ARG CUDA_VERSION=12.1
# TensorRT for cuda12.0 supports cuda12.x
ARG TENSORRT_VERSION="8.6.1.6-1+cuda12.0"
ARG PIP_TENSORRT=tensorrt-cu12
ARG ONNXRUNTIME_VERSION=1.18.0

# environmental variable for apex
Expand Down Expand Up @@ -73,7 +74,7 @@ RUN echo "Asia/Seoul" > /etc/timezone && \
pip${PYTHON_VERSION} install cffi tensorboardX tensorboard torch_tb_profiler tqdm scikit-image colorama==0.3.7 setproctitle pytz && \
# python packages for minostauros
pip${PYTHON_VERSION} install h5py munkres scikit-learn visdom youtube_dl matplotlib nibabel pypng moviepy Pillow einops torchinfo && \
pip${PYTHON_VERSION} install timm decord simplejson av psutil fire fairscale ftfy && \
pip${PYTHON_VERSION} install timm decord ffmpeg-python simplejson av psutil fire fairscale ftfy loguru uvicorn fastapi && \
# nvidia apex
DIR=/tmp/apex && \
mkdir -p ${DIR} && \
Expand Down Expand Up @@ -124,7 +125,7 @@ RUN echo "Asia/Seoul" > /etc/timezone && \
libnvinfer-lean8=${TENSORRT_VERSION} libnvinfer-samples=${TENSORRT_VERSION} \
libnvinfer-vc-plugin-dev=${TENSORRT_VERSION} libnvinfer-vc-plugin8=${TENSORRT_VERSION} \
tensorrt=${TENSORRT_VERSION} && \
pip${PYTHON_VERSION} install tensorrt && \
pip${PYTHON_VERSION} install ${PIP_TENSORRT} && \
pip${PYTHON_VERSION} install onnxruntime-gpu==${ONNXRUNTIME_VERSION} --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ && \
# DIR=/tmp/onnxruntime && \
# mkdir -p ${DIR} && \
Expand Down

0 comments on commit 2ef0504

Please sign in to comment.