|
| 1 | +ARG DEPS_IMAGE_NAME |
| 2 | +# clean builder without source code inside |
| 3 | +FROM ${DEPS_IMAGE_NAME} as builder |
| 4 | + |
| 5 | +WORKDIR /opt/dali |
| 6 | + |
| 7 | +# to be adjusted later, first it to run from the build dir, the second is for nose test |
| 8 | +# so the user can `python3 -m nose_wrapper --verbose` |
| 9 | +ENV PYTHONPATH=/opt/dali/test_comp/dali/python/:/opt/dali/qa |
| 10 | + |
| 11 | +# make sure that linker discovers cuda libs |
| 12 | +RUN echo "/usr/local/cuda/targets/x86_64-linux/lib" > /etc/ld.so.conf.d/999_cuda.conf && \ |
| 13 | + echo "/usr/local/cuda-11.8/targets/x86_64-linux/lib" >> /etc/ld.so.conf.d/999_cuda.conf && \ |
| 14 | + ldconfig && \ |
| 15 | + pip install --upgrade \ |
| 16 | + astunparse \ |
| 17 | + gast \ |
| 18 | + dm-tree && \ |
| 19 | + rm -rf /root/.cache/pip/ && \ |
| 20 | + # Install dependencies: opencv-python from 3.3.0.10 onwards uses QT which requires |
| 21 | + # X11 and other libraries that are not present in clean docker images or bundled there |
| 22 | + # 4.3.0.38 uses libGL.so as well so install libgl1-mesa-dev |
| 23 | + apt-get update && \ |
| 24 | + apt-get install -y --no-install-recommends libsm6 \ |
| 25 | + libice6 \ |
| 26 | + libxrender1 \ |
| 27 | + libxext6 \ |
| 28 | + libx11-6 \ |
| 29 | + glib-2.0 \ |
| 30 | + libgl1-mesa-dev && \ |
| 31 | + # for simple audio python wheel |
| 32 | + apt-get install -y --no-install-recommends libasound2-dev && \ |
| 33 | + apt-get update && \ |
| 34 | + apt-get install wget software-properties-common -y && \ |
| 35 | + CUDNN_VERSION=8.8.1.3-1 && \ |
| 36 | + CUBLASS_VERSION_11=11.11.3.6-1 && \ |
| 37 | + CUBLASS_VERSION_12=12.0.2.224-1 && \ |
| 38 | + NCCL_VERSION=2.16.5-1 && \ |
| 39 | + apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub && \ |
| 40 | + add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /" && \ |
| 41 | + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin && \ |
| 42 | + mv cuda-*.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \ |
| 43 | + apt-get update && \ |
| 44 | + apt-get install -y --no-install-recommends \ |
| 45 | + libcudnn8=${CUDNN_VERSION}+cuda12.0 \ |
| 46 | + libcudnn8-dev=${CUDNN_VERSION}+cuda12.0 \ |
| 47 | + libnccl2=${NCCL_VERSION}+cuda12.0 \ |
| 48 | + libcublas-11-8=${CUBLASS_VERSION_11} \ |
| 49 | + libcublas-12-0=${CUBLASS_VERSION_12} \ |
| 50 | + libcufft-11-8 \ |
| 51 | + libcusparse-11-8 \ |
| 52 | + cuda-nvrtc-11-8 && \ |
| 53 | + rm -rf /var/lib/apt/lists/* |
| 54 | + |
| 55 | +RUN --mount=type=bind,source=qa/,target=/opt/dali/qa/ \ |
| 56 | + export INSTALL=YES && \ |
| 57 | + export CUDA_VERSION=$(echo $(nvcc --version) | sed 's/.*\(release \)\([0-9]\+\)\.\([0-9]\+\).*/\2\3/') && \ |
| 58 | + cd /opt/dali/qa/ && ./download_pip_packages.sh |
| 59 | + |
| 60 | +RUN --mount=type=bind,source=./DALI_EXTRA_VERSION,target=/opt/dali/DALI_EXTRA_VERSION,type=bind,source=qa/,target=/opt/dali/qa/ \ |
| 61 | + /bin/bash -c 'pushd /opt/dali/qa/ && \ |
| 62 | + source ./setup_dali_extra.sh && \ |
| 63 | + popd' |
| 64 | + |
| 65 | +ENV DALI_EXTRA_PATH=/opt/dali_extra |
| 66 | + |
| 67 | +ARG CC |
| 68 | +ARG CXX |
| 69 | +ENV CC=${CC} \ |
| 70 | + CXX=${CXX} |
| 71 | +# Optional build arguments |
| 72 | + |
| 73 | +ARG ARCH |
| 74 | +ENV ARCH=${ARCH} |
| 75 | +ARG CUDA_TARGET_ARCHS |
| 76 | +ENV CUDA_TARGET_ARCHS=${CUDA_TARGET_ARCHS} |
| 77 | +ARG CMAKE_BUILD_TYPE |
| 78 | +ENV CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} |
| 79 | +ARG BUILD_TEST |
| 80 | +ENV BUILD_TEST=${BUILD_TEST} |
| 81 | +ARG BUILD_BENCHMARK |
| 82 | +ENV BUILD_BENCHMARK=${BUILD_BENCHMARK} |
| 83 | +ARG BUILD_NVTX |
| 84 | +ENV BUILD_NVTX=${BUILD_NVTX} |
| 85 | +ARG BUILD_PYTHON |
| 86 | +ENV BUILD_PYTHON=${BUILD_PYTHON} |
| 87 | +ARG BUILD_LMDB |
| 88 | +ENV BUILD_LMDB=${BUILD_LMDB} |
| 89 | +ARG BUILD_JPEG_TURBO |
| 90 | +ENV BUILD_JPEG_TURBO=${BUILD_JPEG_TURBO} |
| 91 | +ARG BUILD_NVJPEG |
| 92 | +ENV BUILD_NVJPEG=${BUILD_NVJPEG} |
| 93 | +ARG BUILD_NVJPEG2K |
| 94 | +ENV BUILD_NVJPEG2K=${BUILD_NVJPEG2K} |
| 95 | +ARG BUILD_LIBTIFF |
| 96 | +ENV BUILD_LIBTIFF=${BUILD_LIBTIFF} |
| 97 | +ARG BUILD_LIBSND |
| 98 | +ENV BUILD_LIBSND=${BUILD_LIBSND} |
| 99 | +ARG BUILD_LIBTAR |
| 100 | +ENV BUILD_LIBTAR=${BUILD_LIBTAR} |
| 101 | +ARG BUILD_FFTS |
| 102 | +ENV BUILD_FFTS=${BUILD_FFTS} |
| 103 | +ARG BUILD_CFITSIO |
| 104 | +ENV BUILD_CFITSIO=${BUILD_CFITSIO} |
| 105 | +ARG BUILD_NVOF |
| 106 | +ENV BUILD_NVOF=${BUILD_NVOF} |
| 107 | +ARG BUILD_NVDEC |
| 108 | +ENV BUILD_NVDEC=${BUILD_NVDEC} |
| 109 | +ARG BUILD_NVML |
| 110 | +ENV BUILD_NVML=${BUILD_NVML} |
| 111 | +ARG BUILD_CUFILE |
| 112 | +ENV BUILD_CUFILE=${BUILD_CUFILE:-ON} |
| 113 | +ARG BUILD_NVCOMP |
| 114 | +ENV BUILD_NVCOMP=${BUILD_NVCOMP} |
| 115 | +ARG BUILD_CVCUDA |
| 116 | +ENV BUILD_CVCUDA=${BUILD_CVCUDA} |
| 117 | +ARG LINK_DRIVER |
| 118 | +ENV LINK_DRIVER=${LINK_DRIVER} |
| 119 | +ARG WITH_DYNAMIC_CUDA_TOOLKIT |
| 120 | +ENV WITH_DYNAMIC_CUDA_TOOLKIT=${WITH_DYNAMIC_CUDA_TOOLKIT:-ON} |
| 121 | +ARG WITH_DYNAMIC_NVJPEG |
| 122 | +ENV WITH_DYNAMIC_NVJPEG=${WITH_DYNAMIC_NVJPEG:-ON} |
| 123 | +ARG WITH_DYNAMIC_CUFFT |
| 124 | +ENV WITH_DYNAMIC_CUFFT=${WITH_DYNAMIC_CUFFT:-ON} |
| 125 | +ARG WITH_DYNAMIC_NPP |
| 126 | +ENV WITH_DYNAMIC_NPP=${WITH_DYNAMIC_NPP:-ON} |
| 127 | +ARG BUILD_WITH_ASAN |
| 128 | +ENV BUILD_WITH_ASAN=${BUILD_WITH_ASAN} |
| 129 | +ARG BUILD_WITH_LSAN |
| 130 | +ENV BUILD_WITH_LSAN=${BUILD_WITH_LSAN} |
| 131 | +ARG BUILD_WITH_UBSAN |
| 132 | +ENV BUILD_WITH_UBSAN=${BUILD_WITH_UBSAN} |
| 133 | +ARG PYTHON_VERSIONS |
| 134 | +ENV PYTHON_VERSIONS=${PYTHON_VERSIONS} |
| 135 | +ARG STRIP_BINARY |
| 136 | +ENV STRIP_BINARY=${STRIP_BINARY} |
| 137 | +ARG VERBOSE_LOGS |
| 138 | +ENV VERBOSE_LOGS=${VERBOSE_LOGS} |
| 139 | +ARG NVIDIA_DALI_BUILD_FLAVOR |
| 140 | +ENV NVIDIA_DALI_BUILD_FLAVOR=${NVIDIA_DALI_BUILD_FLAVOR} |
| 141 | +ARG GIT_SHA |
| 142 | +ENV GIT_SHA=${GIT_SHA} |
| 143 | +ARG DALI_TIMESTAMP |
| 144 | +ENV DALI_TIMESTAMP=${DALI_TIMESTAMP} |
| 145 | +ARG WHL_PLATFORM_NAME |
| 146 | +ENV WHL_PLATFORM_NAME=${WHL_PLATFORM_NAME} |
| 147 | +ARG WHL_COMPRESSION |
| 148 | +ENV WHL_COMPRESSION=${WHL_COMPRESSION} |
| 149 | +ARG EXTRA_CMAKE_OPTIONS |
| 150 | +ENV EXTRA_CMAKE_OPTIONS=${EXTRA_CMAKE_OPTIONS} |
| 151 | + |
| 152 | +ARG NVIDIA_BUILD_ID |
| 153 | +ENV NVIDIA_BUILD_ID ${NVIDIA_BUILD_ID:-0} |
0 commit comments