Skip to content

Commit

Permalink
change dockerfile.base so its starts from official Nvidia/cuda:12.4.0…
Browse files Browse the repository at this point in the history
…-devel-ubuntu22.04 image and removing redundancies
  • Loading branch information
joschi1212 committed Oct 7, 2024
1 parent 6b6e2e8 commit ab88dab
Showing 1 changed file with 15 additions and 58 deletions.
73 changes: 15 additions & 58 deletions Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,72 +1,29 @@
FROM ubuntu:22.04
# Use the NVIDIA CUDA base image for CUDA 12.4 and Ubuntu 22.04
FROM nvidia/cuda:12.4.0-devel-ubuntu22.04

###########################################################################
# Install python
# Install Python 3.9 and pipenv
###########################################################################

RUN apt-get update && apt-get -y install \
wget \
software-properties-common \
libgl1-mesa-glx
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
python3.9 \
python3-pip
RUN pip install pipenv

###########################################################################
# DEPRECATED Install CUDA (sourced from https://gitlab.com/nvidia/container-images/cuda/-/tree/master/dist/11.4.0/ubuntu18.04-x86_64/devel)
###########################################################################

USER root
# base
#RUN rm /etc/apt/sources.list.d/cuda.list
RUN apt-get update && apt-get install -y --no-install-recommends \
gnupg2 curl ca-certificates && \
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub | apt-key add - && \
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 /" > /etc/apt/sources.list.d/cuda.list && \
apt-get purge --autoremove -y curl \
python3.9 \
python3-pip \
libgl1-mesa-glx \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*

ENV CUDA_VERSION 11.8.0

# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a
RUN apt-get update && apt-get install -y --no-install-recommends \
cuda-cudart-11-8 \
cuda-compat-11-8 \
&& ln -s cuda-11.8 /usr/local/cuda && \
rm -rf /var/lib/apt/lists/*

# Required for nvidia-docker v1
RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf \
&& echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf

ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64

# devel next
ENV NCCL_VERSION 2.10.3

RUN apt-get update && apt-get install -y --no-install-recommends \
cuda-cudart-dev-11-8 \
cuda-command-line-tools-11-8 \
cuda-minimal-build-11-8 \
cuda-libraries-dev-11-8 \
cuda-nvml-dev-11-8 \
libnpp-dev-11-8 \
libnccl2=2.15.5-1+cuda11.8 \
libnccl-dev=2.15.5-1+cuda11.8 \
libcublas-dev-11-8 \
libcusparse-dev-11-8 \
&& rm -rf /var/lib/apt/lists/*
RUN pip install pipenv

# apt from auto upgrading the cublas package. See https://gitlab.com/nvidia/container-images/cuda/-/issues/88
RUN apt-mark hold libcublas-dev-11-8 libnccl-dev
RUN apt-get update && apt-get -y install \
wget \
software-properties-common \
libgl1-mesa-glx

# Set up environment variables for CUDA and NVIDIA
ENV PATH /usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:${LD_LIBRARY_PATH}
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}compute,graphics,utility
ENV NVIDIA_REQUIRE_CUDA "cuda>=11.8 brand=tesla,driver>=418,driver<419 brand=tesla,driver>=440,driver<441 driver>=450"

###########################################################################
# Install COLMAP (see https://colmap.github.io/install.html#linux)
###########################################################################
Expand Down

0 comments on commit ab88dab

Please sign in to comment.