├── Dockerfile ├── LICENSE └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG UBUNTU_VERSION 2 | FROM ubuntu:${UBUNTU_VERSION} 3 | 4 | WORKDIR /root/ 5 | 6 | # Add libcuda dummy dependency 7 | RUN printf "\ 8 | Package: libcuda1-dummy\n\ 9 | Maintainer: Lambda Labs \n\ 10 | Version: 12.8\n\ 11 | Provides: libcuda1 (= 570)\n\ 12 | , libcuda-12.8-1\n\ 13 | , libnvidia-ml1 (= 570)\n\ 14 | " > control 15 | 16 | RUN apt-get update && \ 17 | DEBIAN_FRONTEND=noninteractive apt-get install --yes equivs && \ 18 | equivs-build control && \ 19 | dpkg -i libcuda1-dummy_12.8_all.deb && \ 20 | rm control libcuda1-dummy_12.8* && \ 21 | apt-get remove --yes --purge --autoremove equivs && \ 22 | rm -rf /var/lib/apt/lists/* 23 | 24 | # Install pre-requisites 25 | RUN apt-get update && \ 26 | DEBIAN_FRONTEND=noninteractive apt-get install --yes lsb-release gnupg && \ 27 | rm -rf /var/lib/apt/lists/* 28 | 29 | # Setup GPG key 30 | RUN printf -- "\ 31 | -----BEGIN PGP PUBLIC KEY BLOCK-----\n\ 32 | \n\ 33 | mQINBFrFv5kBEADLAYqKVCC0T+bOGMQ2duQ/XN/iT/F+I4B/qjPGBNC84oLtTfK7\n\ 34 | Ig0ctPKVVbOOKbXD1U/+dy/guJRF2G9nzxrod1n02wonzig3/qDzTS0iaDcBlWF9\n\ 35 | sdVWppQ/e7LrCKz+2ywPDnzE1UAf3R8YMiB+Ve6SDndLXpcjdtvx8yhJkNBP6EAA\n\ 36 | kfOugrmUBwuEH6mQG0NfrfcybM5KWc1K7NmNgFcH4LnmqyVLTHEIJc2afZl3Q4aa\n\ 37 | CKwr2lwwihXQRb47GWaZictFfp2fswWl2HuohTIfTboyzLEE7goqys+KYoy1Td9w\n\ 38 | /NhKnik4t9L5ur8/CbAFtEapCxHTWV8ONe8GkgEoyI478c88g3zW9Hyu8CdYpjqr\n\ 39 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4k\n\ 54 | JVldCp1+9JAY81UWLZfnid1wcWGOGazztZmbaCHY5d04yA45IqksPFB8I6T3hZuO\n\ 55 | D+vS4I2Zxv0kq6qkF+UBdu/jyTHJ887PwFBKKAsZIvxI6U4rWRqexplgaTM8CIx8\n\ 56 | 8EK3WlhRiW7KTJLd/Hs0iJxVWPEdoY8px8cNrAAovBPgoX8XR9DZEO1UxysIsU2h\n\ 57 | vcAqOJpavozl4MwEXd0WBT7cDfmR/xz/tZkuK3TiVp9H\n\ 58 | =9oLr\n\ 59 | -----END PGP PUBLIC KEY BLOCK-----\n\ 60 | " > lambda.gpg 61 | 62 | RUN gpg --dearmor -o /etc/apt/trusted.gpg.d/lambda.gpg < lambda.gpg && \ 63 | rm lambda.gpg 64 | 65 | # Setup repository 66 | RUN printf "\ 67 | deb http://archive.lambdalabs.com/ubuntu $(lsb_release -cs) main\n\ 68 | " > /etc/apt/sources.list.d/lambda.list 69 | 70 | RUN printf "\ 71 | Package: *\n\ 72 | Pin: origin archive.lambdalabs.com\n\ 73 | Pin-Priority: 1001\n\ 74 | " > /etc/apt/preferences.d/lambda 75 | 76 | # Install lambda-stack packages 77 | RUN apt-get update && \ 78 | echo "cudnn cudnn/license_preseed select ACCEPT" | debconf-set-selections && \ 79 | DEBIAN_FRONTEND=noninteractive \ 80 | apt-get install \ 81 | --yes \ 82 | --no-install-recommends \ 83 | --option "Acquire::http::No-Cache=true" \ 84 | --option "Acquire::http::Pipeline-Depth=0" \ 85 | lambda-stack-cuda && \ 86 | rm -rf /var/lib/apt/lists/* 87 | 88 | # Let pip break system packages 89 | RUN printf "\ 90 | [global]\n\ 91 | break-system-packages = true\n\ 92 | " > /etc/pip.conf 93 | 94 | # Setup for nvidia-docker 95 | ENV NVIDIA_VISIBLE_DEVICES all 96 | ENV NVIDIA_DRIVER_CAPABILITIES compute,utility 97 | ENV NVIDIA_REQUIRE_CUDA "cuda>=12.8" 98 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 Lambda Labs, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lambda Stack Dockerfiles 2 | 3 | Dockerfiles with rolling-release Lambda Stack, designed for use with nvidia-container-toolkit 4 | 5 | ### Installing nvidia-container-toolkit 6 | 7 | 1) Ensure that you have a docker version > 19.03. On Ubuntu, you can simply run `sudo apt-get install docker.io`. On a different OS, or if you prefer to use upstream docker, follow [Docker's installation instructions](https://docs.docker.com/engine/install/ubuntu/) 8 | 9 | 2) If using Lambda Stack on your host machine, install nvidia-container-toolkit with `sudo apt-get install nvidia-container-toolkit`. Otherwise, follow [NVIDIA's installation instructions](https://github.com/NVIDIA/nvidia-docker) 10 | 11 | ### Building images 12 | 13 | Build the image with the appropriate command for the distribution you wish to use. 14 | Note that only current LTS versions are supported: 20.04, 22.04, and 24.04. 15 | 16 | ``` 17 | sudo docker build -t lambda-stack:22.04 --build-arg UBUNTU_VERSION=22.04 . 18 | ``` 19 | 20 | Note that building these docker images requires acceptance of the [cuDNN license agreement](https://docs.nvidia.com/deeplearning/cudnn/latest/reference/eula.html) 21 | 22 | ### Testing images 23 | 24 | Here's a simple PyTorch test to make sure that your GPUs are usable in your docker images 25 | 26 | ``` 27 | $ sudo docker run --gpus 2 lambda-stack:22.04 python3 -c "import torch; print(torch.cuda.device_count())" 28 | 2 29 | ``` 30 | --------------------------------------------------------------------------------