diff --git a/.github/workflows/deploy-docker.yml b/.github/workflows/deploy-docker.yml index dd7dc47..359baeb 100644 --- a/.github/workflows/deploy-docker.yml +++ b/.github/workflows/deploy-docker.yml @@ -54,3 +54,26 @@ jobs: - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} + + build-cuda-12: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push Cuda-12 + id: docker_build + uses: docker/build-push-action@v3 + with: + push: true + file: ./docker/cuda-12/Dockerfile + tags: sameli/manylinux2014_x86_64_cuda_12:latest + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/AUTHORS.txt b/AUTHORS.txt new file mode 100644 index 0000000..58075ee --- /dev/null +++ b/AUTHORS.txt @@ -0,0 +1 @@ +Siavash Ameli diff --git a/README.md b/README.md index 31f62f5..78f0993 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Dockerfiles to install **NVIDIA CUDA toolkit**, on the top of [`quay.io/pypa/man ### Download images -Obtain docker images from Dockerhub for two CUDA versions **10.2** and **11.7**, respectively as follows. +Obtain docker images from Dockerhub for two CUDA versions **10.2**, **11.7**, and **12.0* respectively as follows. * For CUDA 10 ([see on Dockerhub](https://hub.docker.com/repository/docker/sameli/manylinux2014_x86_64_cuda_10)): @@ -14,6 +14,10 @@ Obtain docker images from Dockerhub for two CUDA versions **10.2** and **11.7**, docker pull sameli/manylinux2014_x86_64_cuda_11 +* For CUDA 12 ([see on Dockerhub](https://hub.docker.com/repository/docker/sameli/manylinux2014_x86_64_cuda_12)): + + docker pull sameli/manylinux2014_x86_64_cuda_12 + ### Run containers To run the container interactively: @@ -26,6 +30,10 @@ To run the container interactively: docker run -it sameli/manylinux2014_x86_64_cuda_11 +* For CUDA 12 + + docker run -it sameli/manylinux2014_x86_64_cuda_12 + ### Environment variables The following environment variables are defined: @@ -63,6 +71,17 @@ The `nvcc` executable is available on the `PATH`. To check the CUDA version, run Cuda compilation tools, release 11.7, V11.7.99 Build cuda_11.7.r11.7/compiler.31442593_0 +* For CUDA 12: + + docker run -t sameli/manylinux2014_x86_64_cuda_12 nvcc --version + + The output of the above commands for is: + + Copyright (c) 2005-2023 NVIDIA Corporation + Built on Wed_Jun__8_16:49:14_PDT_2022 + Cuda compilation tools, release 12.0, V12.0.00 + Build cuda_12.0.r12.0/compiler.31442593_0 + ### How to build images Get this repository: diff --git a/docker-compose.yml b/docker-compose.yml index 9fcd525..3dfda81 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,3 +7,7 @@ services: cuda_11: build: ./docker/cuda-11 image: sameli/manylinux2014_x86_64_cuda_11 + + cuda_12: + build: ./docker/cuda-12 + image: sameli/manylinux2014_x86_64_cuda_12 diff --git a/docker/cuda-10/Dockerfile b/docker/cuda-10/Dockerfile index 8e75740..8cfab82 100644 --- a/docker/cuda-10/Dockerfile +++ b/docker/cuda-10/Dockerfile @@ -32,6 +32,7 @@ RUN rpm -i cuda-repo-rhel7-10-2-local-10.2.89-440.33.01-1.0-1.x86_64.rpm RUN yum clean all RUN yum -y install nvidia-driver-latest-dkms cuda RUN yum -y install cuda-drivers +RUN rm cuda-repo-rhel7-10-2-local-10.2.89-440.33.01-1.0-1.x86_64.rpm # ------------------------- # Set environment variables diff --git a/docker/cuda-11/Dockerfile b/docker/cuda-11/Dockerfile index 370248a..d1affae 100644 --- a/docker/cuda-11/Dockerfile +++ b/docker/cuda-11/Dockerfile @@ -25,10 +25,14 @@ LABEL Description="manylinux2014_x86_64 with cuda 11.7" # ------------ RUN yum install -y yum-utils -RUN yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo +RUN yum install -y wget + +RUN wget https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda-repo-rhel7-11-7-local-11.7.0_515.43.04-1.x86_64.rpm +RUN rpm -i cuda-repo-rhel7-11-7-local-11.7.0_515.43.04-1.x86_64.rpm RUN yum clean all RUN yum -y install nvidia-driver-latest-dkms cuda RUN yum -y install cuda-drivers +RUN rm cuda-repo-rhel7-11-7-local-11.7.0_515.43.04-1.x86_64.rpm # ------------------------- # Set environment variables diff --git a/docker/cuda-12/Dockerfile b/docker/cuda-12/Dockerfile new file mode 100644 index 0000000..5ae8ed3 --- /dev/null +++ b/docker/cuda-12/Dockerfile @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli +# SPDX-License-Identifier: BSD-3-Clause +# SPDX-FileType: SOURCE + +# ----------------------------------------------------------------------------- +# How to build +# $ docker build -t sameli/manylinux2014_x86_64_cuda_12 -f . +# +# How to run: +# $ docker run -it -v/host_dir:/image_dir --entrypoint /bin/bash \ +# manylinux2014_x86_64_cuda_12 +# ----------------------------------------------------------------------------- + +# ----------------- +# Choose base image +# ----------------- + +FROM quay.io/pypa/manylinux2014_x86_64 + +MAINTAINER Siavash Ameli +LABEL Description="manylinux2014_x86_64 with cuda 12.0" + +# ------------ +# Install cuda +# ------------ + +RUN yum install -y yum-utils +RUN yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo +RUN yum clean all +RUN yum -y install nvidia-driver-latest-dkms cuda +RUN yum -y install cuda-drivers + +# ------------------------- +# Set environment variables +# ------------------------- + +ENV PATH="/usr/local/cuda/bin:${PATH}" +ENV CUDA_HOME=/usr/local/cuda +ENV CUDA_ROOT=/usr/local/cuda +ENV CUDA_PATH=/usr/local/cuda +ENV CUDADIR=/usr/local/cuda +ENV LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}" + +# -------- +# Commands +# -------- + +CMD ["/bin/bash"]