diff --git a/.github/workflows/docker-publish-nvidia-cuda-11.3.0-ubuntu-20.04.yml b/.github/workflows/docker-publish-nvidia-cuda-11.3.0-ubuntu-20.04.yml new file mode 100644 index 0000000..35002a9 --- /dev/null +++ b/.github/workflows/docker-publish-nvidia-cuda-11.3.0-ubuntu-20.04.yml @@ -0,0 +1,64 @@ +# Adapted from +# https://github.com/actions/starter-workflows/ci/docker-publish.yml +# If using base images, don't forget to add READ access, eg. from a package settings page like: +# https://github.com/orgs/storytold/packages/container/docker-base-images-rust-ssl/settings/actions_access +name: Build Nvidia CUDA 11.3.0 (Ubuntu 20.04) +on: + push: + branches: + # NB: Default-branch doesn't work, despite Github's documentation. + #- $default-branch + - master +env: + IMAGE_NAME: nvidia-cuda-11.3.0-ubuntu-20.04 + +jobs: + # Push image to GitHub Packages. + # See also https://docs.docker.com/docker-hub/builds/ + push: + runs-on: ubuntu-latest + if: github.event_name == 'push' + permissions: + packages: write + contents: read + + steps: + - uses: actions/checkout@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + #username: ${{ github.repository_owner }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build image + run: cd docker/nvidia-cuda-11.3.0-ubuntu-20.04/ && docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" + + - name: Push image to GitHub Container Registry + run: | + IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME + + # Change all uppercase to lowercase + IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') + + # Strip git ref prefix from version + VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + + # Strip "v" prefix from tag name + [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') + + # Use Docker `latest` tag convention + [ "$VERSION" == "$default-branch" ] && VERSION=latest + + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + + docker tag $IMAGE_NAME $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION + + SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-12) + + docker tag $IMAGE_NAME $IMAGE_ID:$SHORT_SHA + docker push $IMAGE_ID:$SHORT_SHA diff --git a/docker/nvidia-cuda-11.3.0-ubuntu-20.04/Dockerfile b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/Dockerfile new file mode 100644 index 0000000..ad4f882 --- /dev/null +++ b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/Dockerfile @@ -0,0 +1,104 @@ +# Storyteller recreation of "nvidia/cuda:11.3.0-devel-ubuntu20.04" - +# +# Nvidia pulled the "nvidia/cuda:11.3.0-devel-ubuntu20.04" family of images from Docker Hub. +# This is a recreation of that image using our own last working images based on Nvidia's base +# containers (`docker --history`) and what appears to be the Nvidia container source repo: +# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/end-of-life/11.3.0/ubuntu2004/devel/Dockerfile +# +# The following lines were all taken from `docker --history`, with the exception of `FROM`, which came from +# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/end-of-life/11.3.0/ubuntu2004/base/Dockerfile +# The "ADD" and "CMD" below are probably just noise from `docker --history` +# +# The Docker history command: +# +# docker history --no-trunc ghcr.io/storytold/tts-core:b5355de94e73 > output.txt +# +# The table needs to be trimmed to just the commands, and it's in reverse cronological order. The commands after +# Nvidia's are our own, and they need to be removed. The leading "/bin/sh -c" shell commands need to be removed +# as well. +# + +#/bin/sh -c #(nop) ADD file:9d282119af0c42bc823c95b4192a3350cf2cad670622017356dd2e637762e425 in / +#/bin/sh -c #(nop) CMD ["bash"] +FROM ubuntu:20.04 as base + +ENV NVARCH=x86_64 +ENV NVIDIA_REQUIRE_CUDA=cuda>=11.3 brand=tesla,driver>=418,driver<419 driver>=450 +ENV NV_CUDA_CUDART_VERSION=11.3.58-1 +ENV NV_CUDA_COMPAT_PACKAGE=cuda-compat-11-3 + +ARG TARGETARCH + +LABEL maintainer="NVIDIA CORPORATION " + +RUN TARGETARCH=amd64 apt-get update && \ + apt-get install -y --no-install-recommends gnupg2 curl ca-certificates && \ + curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/${NVARCH}/3bf863cc.pub | apt-key add - && \ + echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/${NVARCH} /" > /etc/apt/sources.list.d/cuda.list && \ + apt-get purge --autoremove -y curl && \ + rm -rf /var/lib/apt/lists/* + +ENV CUDA_VERSION=11.3.0 + +RUN TARGETARCH=amd64 apt-get update && apt-get install -y --no-install-recommends cuda-cudart-11-3=${NV_CUDA_CUDART_VERSION} ${NV_CUDA_COMPAT_PACKAGE} && rm -rf /var/lib/apt/lists/* +RUN TARGETARCH=amd64 echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf + +ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64 + +COPY NGC-DL-CONTAINER-LICENSE / + +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility +ENV NV_CUDA_LIB_VERSION=11.3.0-1 +ENV NV_NVTX_VERSION=11.3.58-1 +ENV NV_LIBNPP_VERSION=11.3.3.44-1 +ENV NV_LIBNPP_PACKAGE=libnpp-11-3=11.3.3.44-1 +ENV NV_LIBCUSPARSE_VERSION=11.5.0.58-1 +ENV NV_LIBCUBLAS_PACKAGE_NAME=libcublas-11-3 +ENV NV_LIBCUBLAS_VERSION=11.4.2.10064-1 +ENV NV_LIBCUBLAS_PACKAGE=libcublas-11-3=11.4.2.10064-1 +ENV NV_LIBNCCL_PACKAGE_NAME=libnccl2 +ENV NV_LIBNCCL_PACKAGE_VERSION=2.9.6-1 +ENV NCCL_VERSION=2.9.6-1 +ENV NV_LIBNCCL_PACKAGE=libnccl2=2.9.6-1+cuda11.3 + +ARG TARGETARCH + +LABEL maintainer="NVIDIA CORPORATION " + +RUN TARGETARCH=amd64 apt-get update && apt-get install -y --no-install-recommends cuda-libraries-11-3=${NV_CUDA_LIB_VERSION} ${NV_LIBNPP_PACKAGE} cuda-nvtx-11-3=${NV_NVTX_VERSION} libcusparse-11-3=${NV_LIBCUSPARSE_VERSION} ${NV_LIBCUBLAS_PACKAGE} ${NV_LIBNCCL_PACKAGE} && rm -rf /var/lib/apt/lists/* +RUN TARGETARCH=amd64 apt-mark hold ${NV_LIBCUBLAS_PACKAGE_NAME} ${NV_LIBNCCL_PACKAGE_NAME} + +COPY entrypoint.d/ /opt/nvidia/entrypoint.d/ +COPY nvidia_entrypoint.sh /opt/nvidia/ + +ENV NVIDIA_PRODUCT_NAME=CUDA +ENV NVIDIA_CUDA_END_OF_LIFE=1 + +ENTRYPOINT ["/opt/nvidia/nvidia_entrypoint.sh"] + +ENV NV_CUDA_LIB_VERSION=11.3.0-1 +ENV NV_CUDA_CUDART_DEV_VERSION=11.3.58-1 +ENV NV_NVML_DEV_VERSION=11.3.58-1 +ENV NV_LIBCUSPARSE_DEV_VERSION=11.5.0.58-1 +ENV NV_LIBNPP_DEV_VERSION=11.3.3.44-1 +ENV NV_LIBNPP_DEV_PACKAGE=libnpp-dev-11-3=11.3.3.44-1 +ENV NV_LIBCUBLAS_DEV_VERSION=11.4.2.10064-1 +ENV NV_LIBCUBLAS_DEV_PACKAGE_NAME=libcublas-dev-11-3 +ENV NV_LIBCUBLAS_DEV_PACKAGE=libcublas-dev-11-3=11.4.2.10064-1 +ENV NV_NVPROF_VERSION=11.3.58-1 +ENV NV_NVPROF_DEV_PACKAGE=cuda-nvprof-11-3=11.3.58-1 +ENV NV_LIBNCCL_DEV_PACKAGE_NAME=libnccl-dev +ENV NV_LIBNCCL_DEV_PACKAGE_VERSION=2.9.6-1 +ENV NCCL_VERSION=2.9.6-1 +ENV NV_LIBNCCL_DEV_PACKAGE=libnccl-dev=2.9.6-1+cuda11.3 + +ARG TARGETARCH + +LABEL maintainer="NVIDIA CORPORATION " + +RUN TARGETARCH=amd64 apt-get update && apt-get install -y --no-install-recommends libtinfo5 libncursesw5 cuda-cudart-dev-11-3=${NV_CUDA_CUDART_DEV_VERSION} cuda-command-line-tools-11-3=${NV_CUDA_LIB_VERSION} cuda-minimal-build-11-3=${NV_CUDA_LIB_VERSION} cuda-libraries-dev-11-3=${NV_CUDA_LIB_VERSION} cuda-nvml-dev-11-3=${NV_NVML_DEV_VERSION} ${NV_NVPROF_DEV_PACKAGE} ${NV_LIBNPP_DEV_PACKAGE} libcusparse-dev-11-3=${NV_LIBCUSPARSE_DEV_VERSION} ${NV_LIBCUBLAS_DEV_PACKAGE} ${NV_LIBNCCL_DEV_PACKAGE} && rm -rf /var/lib/apt/lists/* +RUN TARGETARCH=amd64 apt-mark hold ${NV_LIBCUBLAS_DEV_PACKAGE_NAME} ${NV_LIBNCCL_DEV_PACKAGE_NAME} + +ENV LIBRARY_PATH=/usr/local/cuda/lib64/stubs diff --git a/docker/nvidia-cuda-11.3.0-ubuntu-20.04/NGC-DL-CONTAINER-LICENSE b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/NGC-DL-CONTAINER-LICENSE new file mode 100644 index 0000000..332da0e --- /dev/null +++ b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/NGC-DL-CONTAINER-LICENSE @@ -0,0 +1,285 @@ +NVIDIA DEEP LEARNING CONTAINER LICENSE + +This license is a legal agreement between you and NVIDIA Corporation ("NVIDIA") +and governs the use of the NVIDIA container and all its contents (“CONTAINER”). + +This license can be accepted only by an adult of legal age of majority in the +country in which the CONTAINER is used. If you are under the legal age of +majority, you must ask your parent or legal guardian to consent to this license. +If you are entering this license on behalf of a company or other legal entity, +you represent that you have legal authority and “you” will mean the entity you +represent. + +By using the CONTAINER, you affirm that you have reached the legal age of +majority, you accept the terms of this license, and you take legal and financial +responsibility for the actions of your permitted users. + +You agree to use the CONTAINER only for purposes that are permitted by (a) this +license, and (b) any applicable law, regulation or generally accepted practices +or guidelines in the relevant jurisdictions. + +1. LICENSE. Subject to the terms of this license, NVIDIA hereby grants you a +non-exclusive, non-transferable license, without the right to sublicense (except +as expressly provided in this license) to: + +a. Install and use copies of the CONTAINER, and modify and create derivative +works of samples or example source code delivered in the CONTAINER (if +applicable), to develop and test services and applications, + +b. Deploy the CONTAINER on infrastructure you own or lease to offer a service to +third parties, without distributing the CONTAINER or exposing the NVIDIA APIs in +the CONTAINER directly to such service users, and + +c. Develop and extend the CONTAINER to create a Compatible (as defined below) +derived CONTAINER that includes the entire CONTAINER plus other software with +primary functionality, to develop and compile applications, and distribute such +derived CONTAINER to run applications, subject to the distribution requirements +indicated in this license. As used in this section, “Compatible” means that +extensions to the CONTAINER must not adversely affect the functionality of the +other components in the CONTAINER. + +2. DISTRIBUTION REQUIREMENTS. For purposes of this Section 2, the term +“distribution” also means the deployment of CONTAINERS in a service or an +application for third parties to access over the internet. These are the +distribution requirements for you to exercise the grants above: + +a. A service or an application must have material additional functionality, +beyond the included portions of the CONTAINER. + +b. The following notice shall be included in modifications and derivative works +of source code distributed: “This software contains source code provided by +NVIDIA Corporation.” + +c. You agree to distribute the CONTAINER subject to the terms at least as +protective as the terms of this license, including (without limitation) terms +relating to the license grant, license restrictions and protection of NVIDIA’s +intellectual property rights. Additionally, you agree that you will protect the +privacy, security and legal rights of your application users. + +d. You agree to notify NVIDIA in writing of any known or suspected distribution +or use of the CONTAINER not in compliance with the requirements of this license, +and to enforce the terms of your agreements with respect to the distributed +CONTAINER. + +3. AUTHORIZED USERS. You may allow employees and contractors of your entity or +of your subsidiary(ies) to access and use the CONTAINER from your secure network +to perform work on your behalf. If you are an academic institution you may allow +users enrolled or employed by the academic institution to access and use the +CONTAINER from your secure network. You are responsible for the compliance with +the terms of this license by your authorized users. + +4. LIMITATIONS. Your license to use the CONTAINER is restricted as follows: + +a. The CONTAINER may run on any computing system with or without NVIDIA GPUs, +except for the NVIDIA proprietary software (such as CUDA and TensorRT software) +in the CONTAINER which is licensed only to run on systems with NVIDIA GPUs. The +NVIDIA proprietary software in the CONTAINER may be present on systems without +NVIDIA GPUs, as long as it is not running on such systems. For components +governed by open source software licenses, see the information in the +“Components Under Other Licenses” section below. + +b. You may not reverse engineer, decompile or disassemble, or remove copyright +or other proprietary notices from any portion of the CONTAINER or copies of the +CONTAINER. + +c. Except as expressly provided in this license, you may not copy, sell, rent, +sublicense, transfer, distribute, modify, or create derivative works of any +portion of the CONTAINER. For clarity, you may not distribute or sublicense the +CONTAINER as a stand-alone product. + +d. Unless you have an agreement with NVIDIA for this purpose, you may not +indicate that a service or an application created with the CONTAINER is +sponsored or endorsed by NVIDIA. + +e. You may not bypass, disable, or circumvent any technical limitation, +encryption, security, digital rights management or authentication mechanism in +the CONTAINER. + +f. You may not replace any NVIDIA software components in the CONTAINER that are +governed by this license with other software that implements NVIDIA APIs. + +g. You may not use the CONTAINER in any manner that would cause it to become +subject to an open source software license. As examples, licenses that require +as a condition of use, modification, and/or distribution that the CONTAINER be: +(i) disclosed or distributed in source code form; (ii) licensed for the purpose +of making derivative works; or (iii) redistributable at no charge. + +h. You acknowledge that the CONTAINER as delivered is not tested or certified by +NVIDIA for use in connection with the design, construction, maintenance, and/or +operation of any system where the use or failure of such system could result in +a situation that threatens the safety of human life or results in catastrophic +damages (each, a “Critical Application”). Examples of Critical Applications +include use in avionics, navigation, autonomous vehicle applications, ai +solutions for automotive products, military, medical, life support or other life +critical applications. NVIDIA shall not be liable to you or any third party, in +whole or in part, for any claims or damages arising from such uses. You are +solely responsible for ensuring that any product or service developed with the +CONTAINER as a whole includes sufficient features to comply with all applicable +legal and regulatory standards and requirements. + +i. You agree to defend, indemnify and hold harmless NVIDIA and its affiliates, +and their respective employees, contractors, agents, officers and directors, +from and against any and all claims, damages, obligations, losses, liabilities, +costs or debt, fines, restitutions and expenses (including but not limited to +attorney’s fees and costs incident to establishing the right of indemnification) +arising out of or related to products or services that use the CONTAINER in or +for Critical Applications, and for use of the CONTAINER outside of the scope of +this license or not in compliance with its terms. + +j. You may not reverse engineer, decompile or disassemble any portion of the +output generated using the NVIDIA proprietary software (such as CUDA and +TensorRT software) in the CONTAINER for the purpose of translating such output +artifacts to target a non-NVIDIA platform. + +5. UPDATES. NVIDIA may, at its option, make available patches, workarounds or +other updates to this CONTAINER. Unless the updates are provided with their +separate governing terms, they are deemed part of the CONTAINER licensed to you +as provided in this license. You agree that the form and content of the +CONTAINER that NVIDIA provides may change without prior notice to you. While +NVIDIA generally maintains compatibility between versions, NVIDIA may in some +cases make changes that introduce incompatibilities in future versions of the +CONTAINER. + +6. PRE-RELEASE VERSIONS. CONTAINER versions identified as alpha, beta, preview, +early access or otherwise as pre-release may not be fully functional, may +contain errors or design flaws, and may have reduced or different security, +privacy, availability, and reliability standards relative to commercial versions +of NVIDIA software and materials. You may use a pre- release CONTAINER version +at your own risk, understanding that these versions are not intended for use in +production or business-critical systems. NVIDIA may choose not to make available +a commercial version of any pre-release CONTAINER. NVIDIA may also choose to +abandon development and terminate the availability of a pre-release CONTAINER at +any time without liability. + +7. COMPONENTS UNDER OTHER LICENSES. The CONTAINER may include NVIDIA or +third-party components with separate legal notices or terms as may be described +in proprietary notices accompanying the CONTAINER. If and to the extent there is +a conflict between the terms in this license and the license terms associated +with the component, the license terms associated with the components control +only to the extent necessary to resolve the conflict. For example, some Triton +components (such as the Triton Inference Server) are governed by open source +software licenses. + +You acknowledge and agree that it is your sole responsibility to obtain any +additional third-party licenses required to make, have made, use, have used, +sell, import, and offer for sale your products or services that include or +incorporate any third- party software and content relating to audio and/or video +encoders and decoders from, including but not limited to, Microsoft, Thomson, +Fraunhofer IIS, Sisvel S.p.A., MPEG-LA, and Coding Technologies. NVIDIA does not +grant to you under this license any necessary patent or other rights with +respect to any audio and/or video encoders and decoders. Subject to the other +terms of this license, you may use the CONTAINER to develop and test +applications released under Open Source Initiative (OSI) approved open source +software licenses. + +8. OWNERSHIP. + +8.1 NVIDIA reserves all rights, title and interest in and to the CONTAINER not +expressly granted to you under this license. NVIDIA and its suppliers hold all +rights, title and interest in and to the CONTAINER, including their respective +intellectual property rights. The CONTAINER is copyrighted and protected by the +laws of the United States and other countries, and international treaty +provisions. + +8.2 Subject to the rights of NVIDIA and its suppliers in the CONTAINER, you hold +all rights, title and interest in and to your services, applications and your +derivative works of the sample source code delivered in the CONTAINER including +their respective intellectual property rights. + +9. FEEDBACK. You may, but are not obligated to, provide to NVIDIA suggestions, +fixes, modifications, feature requests or other feedback regarding the CONTAINER +(“Feedback”). Feedback, even if designated as confidential by you, shall not +create any confidentiality obligation for NVIDIA. NVIDIA and its designees have +a perpetual, non-exclusive, worldwide, irrevocable license to use, reproduce, +publicly display, modify, create derivative works of, license, sublicense, and +otherwise distribute and exploit Feedback as NVIDIA sees fit without payment and +without obligation or restriction of any kind on account of intellectual +property rights or otherwise. + +10. NO WARRANTIES. THE CONTAINER IS PROVIDED AS-IS. TO THE MAXIMUM EXTENT +PERMITTED BY APPLICABLE LAW NVIDIA AND ITS AFFILIATES EXPRESSLY DISCLAIM ALL +WARRANTIES OF ANY KIND OR NATURE, WHETHER EXPRESS, IMPLIED OR STATUTORY, +INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, +OR FITNESS FOR A PARTICULAR PURPOSE. NVIDIA DOES NOT WARRANT THAT THE CONTAINER +WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION THEREOF WILL BE UNINTERRUPTED +OR ERROR-FREE, OR THAT ALL ERRORS WILL BE CORRECTED. + +11. LIMITATIONS OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW +NVIDIA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, +PUNITIVE OR CONSEQUENTIAL DAMAGES, OR FOR ANY LOST PROFITS, PROJECT DELAYS, LOSS +OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE +PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THIS LICENSE OR THE USE OR +PERFORMANCE OF THE CONTAINER, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED +UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), +PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY, EVEN IF +NVIDIA HAS PREVIOUSLY BEEN ADVISED OF, OR COULD REASONABLY HAVE FORESEEN, THE +POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL NVIDIA’S AND ITS AFFILIATES TOTAL +CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS LICENSE EXCEED US$10.00. THE +NATURE OF THE LIABILITY OR THE NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR +EXTEND THIS LIMIT. + +12. TERMINATION. Your rights under this license will terminate automatically +without notice from NVIDIA if you fail to comply with any term and condition of +this license or if you commence or participate in any legal proceeding against +NVIDIA with respect to the CONTAINER. NVIDIA may terminate this license with +advance written notice to you, if NVIDIA decides to no longer provide the +CONTAINER in a country or, in NVIDIA’s sole discretion, the continued use of it +is no longer commercially viable. Upon any termination of this license, you +agree to promptly discontinue use of the CONTAINER and destroy all copies in +your possession or control. Your prior distributions in accordance with this +license are not affected by the termination of this license. All provisions of +this license will survive termination, except for the license granted to you. + +13. APPLICABLE LAW. This license will be governed in all respects by the laws of +the United States and of the State of Delaware, without regard to the conflicts +of laws principles. The United Nations Convention on Contracts for the +International Sale of Goods is specifically disclaimed. You agree to all terms +of this license in the English language. The state or federal courts residing in +Santa Clara County, California shall have exclusive jurisdiction over any +dispute or claim arising out of this license. Notwithstanding this, you agree +that NVIDIA shall still be allowed to apply for injunctive remedies or urgent +legal relief in any jurisdiction. + +14. NO ASSIGNMENT. This license and your rights and obligations thereunder may +not be assigned by you by any means or operation of law without NVIDIA’s +permission. Any attempted assignment not approved by NVIDIA in writing shall be +void and of no effect. NVIDIA may assign, delegate or transfer this license and +its rights and obligations, and if to a non-affiliate you will be notified. + +15. EXPORT. The CONTAINER is subject to United States export laws and +regulations. You agree to comply with all applicable U.S. and international +export laws, including the Export Administration Regulations (EAR) administered +by the U.S. Department of Commerce and economic sanctions administered by the +U.S. Department of Treasury’s Office of Foreign Assets Control (OFAC). These +laws include restrictions on destinations, end-users and end-use. By accepting +this license, you confirm that you are not currently residing in a country or +region currently embargoed by the U.S. and that you are not otherwise prohibited +from receiving the CONTAINER. + +16. GOVERNMENT USE. The CONTAINER is, and shall be treated as being, “Commercial +Items” as that term is defined at 48 CFR § 2.101, consisting of “commercial +computer software” and “commercial computer software documentation”, +respectively, as such terms are used in, respectively, 48 CFR § 12.212 and 48 +CFR §§ 227.7202 & 252.227-7014(a)(1). Use, duplication or disclosure by the U.S. +Government or a U.S. Government subcontractor is subject to the restrictions in +this license pursuant to 48 CFR § 12.212 or 48 CFR § 227.7202. In no event shall +the US Government user acquire rights in the CONTAINER beyond those specified in +48 C.F.R. 52.227-19(b)(1)-(2). + +17. NOTICES. Please direct your legal notices or other correspondence to NVIDIA +Corporation, 2788 San Tomas Expressway, Santa Clara, California 95051, United +States of America, Attention: Legal Department. 18. ENTIRE AGREEMENT. This +license is the final, complete and exclusive agreement between the parties +relating to the subject matter of this license and supersedes all prior or +contemporaneous understandings and agreements relating to this subject matter, +whether oral or written. If any court of competent jurisdiction determines that +any provision of this license is illegal, invalid or unenforceable, the +remaining provisions will remain in full force and effect. Any amendment or +waiver under this license shall be in writing and signed by representatives of +both parties. + +19. LICENSING. If the distribution terms in this license are not suitable for +your organization, or for any questions regarding this license, please contact +NVIDIA at nvidia-compute-license-questions@nvidia.com. + +(v. September 14, 2021) diff --git a/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/10-banner.sh b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/10-banner.sh new file mode 100644 index 0000000..704c477 --- /dev/null +++ b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/10-banner.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +_banner_file="${BASH_SOURCE[0]/%.sh/.txt}" + +# 10-banner.sh allows itself to be skipped if there exists a +# 10-banner.txt, which will be cat'd next alphabetically +if [[ ! -f "${_banner_file}" && -n "${NVIDIA_PRODUCT_NAME}" ]]; then + echo + print_banner_text "=" "${NVIDIA_PRODUCT_NAME}" +fi diff --git a/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/12-banner.sh b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/12-banner.sh new file mode 100644 index 0000000..878be43 --- /dev/null +++ b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/12-banner.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +_prodname_uc=$(echo "${NVIDIA_PRODUCT_NAME}" | tr [:lower:] [:upper:] | sed 's/ /_/g' | sed 's/^NVIDIA_//') # Product name +_compver="${_prodname_uc}_VERSION" # Upstream component version variable name + +echo +[ -n "${!_compver}" ] && echo "${NVIDIA_PRODUCT_NAME} Version ${!_compver}" diff --git a/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/15-container-copyright.txt b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/15-container-copyright.txt new file mode 100644 index 0000000..33a5751 --- /dev/null +++ b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/15-container-copyright.txt @@ -0,0 +1,2 @@ + +Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. diff --git a/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/30-container-license.txt b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/30-container-license.txt new file mode 100644 index 0000000..0c61b70 --- /dev/null +++ b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/30-container-license.txt @@ -0,0 +1,6 @@ + +This container image and its contents are governed by the NVIDIA Deep Learning Container License. +By pulling and using the container, you accept the terms and conditions of this license: +https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license + +A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience. diff --git a/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/50-gpu-driver-check.sh b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/50-gpu-driver-check.sh new file mode 100644 index 0000000..86ba39e --- /dev/null +++ b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/50-gpu-driver-check.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Copyright (c) 2017-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +# Check if libcuda.so.1 -- the CUDA driver -- is present in the ld.so cache or in LD_LIBRARY_PATH +_LIBCUDA_FROM_LD_CACHE=$(ldconfig -p | grep libcuda.so.1) +_LIBCUDA_FROM_LD_LIBRARY_PATH=$( ( IFS=: ; for i in ${LD_LIBRARY_PATH}; do ls $i/libcuda.so.1 2>/dev/null | grep -v compat; done) ) +_LIBCUDA_FOUND="${_LIBCUDA_FROM_LD_CACHE}${_LIBCUDA_FROM_LD_LIBRARY_PATH}" + +# Check if /dev/nvidiactl (like on Linux) or /dev/dxg (like on WSL2) or /dev/nvgpu (like on Tegra) is present +_DRIVER_FOUND=$(ls /dev/nvidiactl /dev/dxg /dev/nvgpu 2>/dev/null) + +# If either is not true, then GPU functionality won't be usable. +if [[ -z "${_LIBCUDA_FOUND}" || -z "${_DRIVER_FOUND}" ]]; then + echo + echo "WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available." + echo " Use the NVIDIA Container Toolkit to start this container with GPU support; see" + echo " https://docs.nvidia.com/datacenter/cloud-native/ ." + export NVIDIA_CPU_ONLY=1 +fi diff --git a/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/80-internal-image.sh b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/80-internal-image.sh new file mode 100644 index 0000000..d6c6906 --- /dev/null +++ b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/80-internal-image.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +internal_only_deprecation_notice() { + echo + print_banner_text "*" "PRIVATE IMAGE" + echo "This image is PRIVATE." + echo "FOR INTERNAL USE ONLY" + echo "DO NOT ship to external customers!" +} + +[ -n "${NVIDIA_CUDA_INTERNAL}" ] && internal_only_deprecation_notice diff --git a/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/90-deprecated-image.sh b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/90-deprecated-image.sh new file mode 100644 index 0000000..3bd1c52 --- /dev/null +++ b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/entrypoint.d/90-deprecated-image.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +show_deprecation_notice() { + echo + print_banner_text "*" "DEPRECATION NOTICE!" + echo "THIS IMAGE IS DEPRECATED and is scheduled for DELETION." + echo " https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/support-policy.md" +} + +[ -n "${NVIDIA_CUDA_END_OF_LIFE}" ] && show_deprecation_notice diff --git a/docker/nvidia-cuda-11.3.0-ubuntu-20.04/nvidia_entrypoint.sh b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/nvidia_entrypoint.sh new file mode 100755 index 0000000..a177841 --- /dev/null +++ b/docker/nvidia-cuda-11.3.0-ubuntu-20.04/nvidia_entrypoint.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# Copyright (c) 2016-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of NVIDIA CORPORATION nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Gather parts in alpha order +shopt -s nullglob extglob +_SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +declare -a _PARTS=( "${_SCRIPT_DIR}/entrypoint.d"/*@(.txt|.sh) ) +shopt -u nullglob extglob + +print_repeats() { + local -r char="$1" count="$2" + local i + for ((i=1; i<=$count; i++)); do echo -n "$char"; done + echo +} + +print_banner_text() { + # $1: Banner char + # $2: Text + local banner_char=$1 + local -r text="$2" + local pad="${banner_char}${banner_char}" + print_repeats "${banner_char}" $((${#text} + 6)) + echo "${pad} ${text} ${pad}" + print_repeats "${banner_char}" $((${#text} + 6)) +} + +# Execute the entrypoint parts +for _file in "${_PARTS[@]}"; do + case "${_file}" in + *.txt) cat "${_file}";; + *.sh) source "${_file}";; + esac +done + +echo + +# This script can either be a wrapper around arbitrary command lines, +# or it will simply exec bash if no arguments were given +if [[ $# -eq 0 ]]; then + exec "/bin/bash" +else + exec "$@" +fi