mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-18 21:21:17 +00:00
### Description Upgrade cmake version to 3.24 because I need to use a new feature that is only provided in that version and later. Starting from cmake 3.24, the [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html#module:FetchContent) module and the [find_package()](https://cmake.org/cmake/help/latest/command/find_package.html#command:find_package) command now support integration capabilities, which means calls to "FetchContent" can be implicitly redirected to "find_package", and vice versa. Users can use a cmake variable to control the behavior. So, we don't need to provide such a build option. We can delete our "onnxruntime_PREFER_SYSTEM_LIB" build option and let cmake handle it. And it would be easier for who wants to use vcpkg. ### Motivation and Context Provide a unified package management method, and get aligned with the community. This change is split from #13523 for easier review.
23 lines
1.7 KiB
Text
23 lines
1.7 KiB
Text
# --------------------------------------------------------------
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
# Licensed under the MIT License.
|
|
# --------------------------------------------------------------
|
|
# Dockerfile to run ONNXRuntime with CUDA, CUDNN integration
|
|
|
|
# nVidia cuda 11.4 Base Image
|
|
FROM nvcr.io/nvidia/cuda:11.4.2-cudnn8-devel-ubuntu20.04
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
MAINTAINER Changming Sun "chasun@microsoft.com"
|
|
ADD . /code
|
|
|
|
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
|
|
RUN apt-get update && apt-get install -y --no-install-recommends python3-dev ca-certificates g++ python3-numpy gcc make git python3-setuptools python3-wheel python3-pip aria2 && aria2c -q -d /tmp -o cmake-3.24.3-linux-x86_64.tar.gz https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3-linux-x86_64.tar.gz && tar -zxf /tmp/cmake-3.24.3-linux-x86_64.tar.gz --strip=1 -C /usr
|
|
|
|
RUN cd /code && /bin/bash ./build.sh --skip_submodule_sync --cuda_home /usr/local/cuda --cudnn_home /usr/lib/x86_64-linux-gnu/ --use_cuda --config Release --build_wheel --update --build --parallel --cmake_extra_defines ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER) 'CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;86'
|
|
|
|
FROM nvcr.io/nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
COPY --from=0 /code/build/Linux/Release/dist /root
|
|
COPY --from=0 /code/dockerfiles/LICENSE-IMAGE.txt /code/LICENSE-IMAGE.txt
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
RUN apt-get update && apt-get install -y --no-install-recommends libstdc++6 ca-certificates python3-setuptools python3-wheel python3-pip unattended-upgrades && unattended-upgrade && python3 -m pip install /root/*.whl && rm -rf /root/*.whl
|