Skip to content

Commit

Permalink
Merge pull request #1 from ohsu-comp-bio/fix/base-restricted-gpu
Browse files Browse the repository at this point in the history
provide recent gpu images with readme
  • Loading branch information
quinnwai authored Apr 12, 2024
2 parents 0f71efe + aca7fce commit 9db043a
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions restricted-gpu-slim/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# use base image
FROM quay.io/ohsu-comp-bio/bridge2ai-jupyter:cpu-root

RUN sudo apt update

# setup CUDA
RUN sudo apt-get install -y kmod \
&& wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run \
&& sudo bash cuda_11.8.0_520.61.05_linux.run --silent --toolkit

# setup cuDNN
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
&& sudo dpkg -i cuda-keyring_1.1-1_all.deb \
&& sudo apt-get update \
&& sudo apt-get -y install cudnn \
&& echo 'export PATH=$PATH:/usr/local/cuda-11.8/bin' > ~/.bashrc \
&& echo 'export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib6:$LD_LIBRARY_PATH' >> ~/.bashrc \
&& source ~/.bashrc

# return to non-root user
USER $NB_UID
WORKDIR /home/$NB_USER
3 changes: 3 additions & 0 deletions restricted-gpu-slim/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Restricted GPU

Restricted GPU with CUDA and CuDNN. Tested on AWS GPU P4 instance (Tesla V100 GPUs). See Dockerfile for more details.
28 changes: 28 additions & 0 deletions restricted-gpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Use base image
FROM quay.io/ohsu-comp-bio/bridge2ai-jupyter:cpu-root

RUN sudo apt update

# Setup CUDA
RUN sudo apt-get install -y kmod \
&& wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run \
&& sudo bash cuda_11.8.0_520.61.05_linux.run --silent --toolkit

# Setup cuDNN
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
&& sudo dpkg -i cuda-keyring_1.1-1_all.deb \
&& sudo apt-get update \
&& sudo apt-get -y install cudnn \
&& echo 'export PATH=$PATH:/usr/local/cuda-11.8/bin' > ~/.bashrc \
&& echo 'export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib6:$LD_LIBRARY_PATH' >> ~/.bashrc \
&& source ~/.bashrc

# Install TensorFlow
RUN pip install tensorflow==2.14.0

# Install PyTorch
RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

# return to non-root user
USER $NB_UID
WORKDIR /home/$NB_USER
3 changes: 3 additions & 0 deletions restricted-gpu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Restricted GPU

Restricted GPU with CUDA and CuDNN along with Tensorflow and Pytorch installed. Tested on AWS P3 GPU instance (Tesla V100 GPUs). See Dockerfile for more details.

0 comments on commit 9db043a

Please sign in to comment.