Skip to content

Commit

Permalink
Merge pull request #667 from mselensky/master
Browse files Browse the repository at this point in the history
dockerfile examples
  • Loading branch information
yandthj authored Aug 23, 2024
2 parents 165ef14 + 1b41f9d commit b82ae5c
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docker-examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Main documentation page](https://nrel.github.io/HPC/Documentation/Development/Containers/)

This folder contains example Dockerfiles for HPC users to consult.

On your laptop, you can build these images with the following approach.
```
cd FOLDER
docker build . -f Dockerfile --platform=linux/amd64
```

Please contact [email protected] with any questions or feedback.
50 changes: 50 additions & 0 deletions docker-examples/cuda-12.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM ubuntu:22.04

## This is the base image for CUDA 12.4 that subsequent NVIDIA images run at NREL rely upon.
## Contact: [email protected]

#### Specifications
#### OS: Ubuntu v. 22.04
#### CUDA: 12.4
#### CUDNN: 9

# syntax for NVIDIA package repos
ARG distro=ubuntu2204
ARG arch=x86_64

ENV DEBIAN_FRONTEND=noninteractive

### Install Packages and Libraries ###

## Compilers and Fetchers
RUN apt-get update -y && apt-get install -y wget git ca-certificates libssl-dev
RUN apt-get update -y && apt-get install -y build-essential cmake

## Cuda/Cudatoolkit
RUN wget --no-check-certificate https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.pin && \
mkdir -p /etc/apt/preferences.d/ && \
mv cuda-$distro.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \
wget --no-check-certificate https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda-repo-$distro-12-4-local_12.4.0-550.54.14-1_amd64.deb
RUN dpkg -i cuda-repo-$distro-12-4-local_12.4.0-550.54.14-1_amd64.deb && \
cp /var/cuda-repo-$distro-12-4-local/cuda-*-keyring.gpg /usr/share/keyrings/ && \
apt-get update -y && apt-get -y install cuda-toolkit-12-4
# cudnn
RUN wget --no-check-certificate https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-keyring_1.1-1_all.deb && \
dpkg -i cuda-keyring_1.1-1_all.deb && \
apt-get update -y && apt-get install -y cudnn9-cuda-12

# cleanup
RUN rm -rf /cuda-repo-$distro-12-4-local_12.4.0-550.54.14-1_amd64.deb /cuda-keyring_1.1-1_all.deb

# Python, pip, and venv (add specific packages for individual tests)
RUN apt-get install python3 python3-venv -y
RUN ln -s `which python3` /usr/bin/python

# install pip this way due to https://github.com/pypa/setuptools/issues/3269
RUN wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py && python get-pip.py

# final things
ENV CUDA_HOME=/usr/local/cuda
ENV CUDNN_INCLUDE_DIR=/usr/include
ENV PATH=$PATH:/usr/local/cuda/bin
ENV LD_LIBRARY_PATH=/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/cuda/lib64
3 changes: 3 additions & 0 deletions docker-examples/simple-python3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM ubuntu:22.04

RUN apt-get update -y && apt-get install python3 -y

0 comments on commit b82ae5c

Please sign in to comment.