Skip to content

Commit

Permalink
Updating cudnn from 8 to 9 on exsiting cuda 12 docker image (#20925)
Browse files Browse the repository at this point in the history
Adding support of cudnn 9

Keep exsiting  cuda 12.2 with nvidia dirver 535
  • Loading branch information
jchen351 authored and baijumeswani committed Jun 20, 2024
1 parent 61171af commit e2fa8c9
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 21 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def run(self):
"libcudart.so.11.0",
"libcudart.so.12",
"libcudnn.so.8",
"libcudnn.so.9",
"libcufft.so.10",
"libcufft.so.11",
"libcurand.so.10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,7 @@ variables:
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: nvidia/cuda:11.8.0-cudnn8-devel-ubi8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: nvidia/cuda:12.2.2-cudnn8-devel-ubi8

- name: linux_trt_version
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: 10.0.1.6-1.cuda11.8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: 10.0.1.6-1.cuda12.4
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20240610.1

- name: Repository
${{ if eq(parameters.CudaVersion, '11.8') }}:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ variables:
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: nvidia/cuda:11.8.0-cudnn8-devel-ubi8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: nvidia/cuda:12.2.2-cudnn8-devel-ubi8
${{ if eq(parameters.CudaVersion, '12.4') }}:
value: nvidia/cuda:12.4.1-cudnn-devel-ubi8
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20240610.1
- name: linux_trt_version
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: 10.0.1.6-1.cuda11.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ stages:
Context: tools/ci_build/github/linux/docker/
${{ if eq(parameters.CudaVersion, '12.2') }}:
DockerBuildArgs: "
--build-arg BASEIMAGE=nvidia/cuda:12.2.2-cudnn8-devel-ubuntu20.04
--build-arg BASEIMAGE=nvidia/cuda:12.2.2-devel-ubuntu20.04
--build-arg TRT_VERSION=10.0.1.6-1+cuda12.4
--build-arg BUILD_UID=$( id -u )
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ stages:
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: nvidia/cuda:11.8.0-cudnn8-devel-ubi8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: nvidia/cuda:12.2.2-cudnn8-devel-ubi8
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20240610.1
timeoutInMinutes: 60

steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: nvidia/cuda:11.8.0-cudnn8-devel-ubi8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: nvidia/cuda:12.2.2-cudnn8-devel-ubi8
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20240610.1
- name: linux_trt_version
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: 10.0.1.6-1.cuda11.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ stages:
docker_base_image: nvidia/cuda:11.8.0-cudnn8-devel-ubi8
trt_version: 10.0.1.6-1.cuda11.8
${{ if eq(parameters.cuda_version, '12.2') }}:
docker_base_image: nvidia/cuda:12.2.2-cudnn8-devel-ubi8
docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20240610.1
trt_version: 10.0.1.6-1.cuda12.4
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
ARG BASEIMAGE=nvidia/cuda:12.2.2-cudnn8-devel-ubi8
ARG POLICY=manylinux2014
ARG PLATFORM=x86_64
ARG DEVTOOLSET_ROOTPATH=
ARG LD_LIBRARY_PATH_ARG=
ARG PREPEND_PATH=
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20240610.1

#We need both CUDA and manylinux. But the CUDA Toolkit End User License Agreement says NVIDIA CUDA Driver Libraries(libcuda.so, libnvidia-ptxjitcompiler.so) are only distributable in applications that meet this criteria:
#1. The application was developed starting from a NVIDIA CUDA container obtained from Docker Hub or the NVIDIA GPU Cloud, and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/
libnvonnxparsers-dev=${TRT_VERSION} \
libnvonnxparsers10=${TRT_VERSION} \
tensorrt-dev=${TRT_VERSION} \
libnvinfer-bin=${TRT_VERSION}
libnvinfer-bin=${TRT_VERSION} &&\
if [ $(echo $CUDA_VERSION | cut -d"." -f1) -ge 12 ]; then apt-get install -y cudnn9-cuda-12 ; fi
# ^^^^^^^^^^^If cuda version is 12 or higher, install cudnn 9 for cuda 12

ADD scripts /tmp/scripts
RUN cd /tmp/scripts && /tmp/scripts/install_dotnet.sh && rm -rf /tmp/scripts
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

# This file is used by Zip-Nuget Packaging NoContribOps Pipeline,Zip-Nuget-Java Packaging Pipeline
FROM onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12_dotnet:20240610.1
ARG TRT_VERSION

#Install TensorRT only if TRT_VERSION is not empty
RUN if [ -n "$TRT_VERSION" ]; then \
echo "TRT_VERSION is $TRT_VERSION" && \
dnf -y install \
libnvinfer10-${TRT_VERSION} \
libnvinfer-headers-devel-${TRT_VERSION} \
libnvinfer-devel-${TRT_VERSION} \
libnvinfer-lean10-${TRT_VERSION} \
libnvonnxparsers10-${TRT_VERSION} \
libnvonnxparsers-devel-${TRT_VERSION} \
libnvinfer-dispatch10-${TRT_VERSION} \
libnvinfer-plugin10-${TRT_VERSION} \
libnvinfer-vc-plugin10-${TRT_VERSION} \
libnvinfer-bin-${TRT_VERSION} \
libnvinfer-plugin10-${TRT_VERSION} \
libnvinfer-plugin-devel-${TRT_VERSION} \
libnvinfer-vc-plugin-devel-${TRT_VERSION} \
libnvinfer-lean-devel-${TRT_VERSION} \
libnvinfer-dispatch-devel-${TRT_VERSION} \
libnvinfer-headers-plugin-devel-${TRT_VERSION} && \
dnf clean dbcache ; \
else \
echo "TRT_VERSION is none skipping Tensor RT Installation" ; \
fi



ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8

ENV CUDAHOSTCXX /opt/rh/gcc-toolset-12/root/usr/bin/g++
ADD scripts /tmp/scripts
RUN sed -i 's/enabled\s*=\s*1/enabled = 1\nexclude=dotnet* aspnet* netstandard*/g' /etc/yum.repos.d/ubi.repo && \
rpm -Uvh https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm && dnf install -y msopenjdk-11 && cd /tmp/scripts && /tmp/scripts/install_deps.sh && rm -rf /tmp/scripts
ENV PATH /usr/lib/jvm/msopenjdk-11/bin:$PATH
ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-11
ARG BUILD_UID=1001
ARG BUILD_USER=onnxruntimedev
RUN adduser --uid $BUILD_UID $BUILD_USER
WORKDIR /home/$BUILD_USER
USER $BUILD_USER

0 comments on commit e2fa8c9

Please sign in to comment.