Skip to content

Commit

Permalink
add cuda 12
Browse files Browse the repository at this point in the history
  • Loading branch information
ameli committed Jan 9, 2023
1 parent bdfd170 commit 3999477
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/deploy-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Siavash Ameli
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)):

Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions docker/cuda-10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion docker/cuda-11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 48 additions & 0 deletions docker/cuda-12/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu>
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-FileType: SOURCE

# -----------------------------------------------------------------------------
# How to build
# $ docker build -t sameli/manylinux2014_x86_64_cuda_12 -f <This-Filename> .
#
# 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 <samei@berkeley.edu>
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"]

0 comments on commit 3999477

Please sign in to comment.