Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only install CUDA packages on CUDA 11. #77

Merged
merged 7 commits into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 44 additions & 17 deletions ci-conda.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,49 +26,76 @@ ENV SCCACHE_S3_NO_CREDENTIALS=false

# Install system packages depending on the LINUX_VER
RUN \
PKG_CUDA_VER="$(echo ${CUDA_VER} | cut -d '.' -f1,2 | tr '.' '-')"; \
case "${LINUX_VER}" in \
"ubuntu"*) \
echo 'APT::Update::Error-Mode "any";' > /etc/apt/apt.conf.d/warnings-as-errors \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
cuda-gdb-${PKG_CUDA_VER} \
cuda-cudart-dev-${PKG_CUDA_VER} \
cuda-cupti-dev-${PKG_CUDA_VER} \
file \
unzip \
wget \
# ignore the build-essential package since it installs dependencies like gcc/g++
# we don't need them since we use conda compilers, so this keeps our images smaller
&& apt-get download cuda-nvcc-${PKG_CUDA_VER} \
&& dpkg -i --ignore-depends="build-essential" ./cuda-nvcc-*.deb \
&& rm ./cuda-nvcc-*.deb \
# apt will not work correctly if it thinks it needs the build-essential dependency
# so we patch it out with a sed command
&& sed -i 's/, build-essential//g' /var/lib/dpkg/status \
&& rm -rf "/var/lib/apt/lists/*"; \
;; \
"centos"* | "rockylinux"*) \
yum -y update \
&& yum -y install --setopt=install_weak_deps=False \
cuda-cudart-devel-${PKG_CUDA_VER} \
cuda-driver-devel-${PKG_CUDA_VER} \
cuda-gdb-${PKG_CUDA_VER} \
cuda-cupti-${PKG_CUDA_VER} \
file \
unzip \
wget \
which \
yum-utils \
&& rpm -Uvh --nodeps $(repoquery --location cuda-nvcc-${PKG_CUDA_VER}) \
&& yum clean all; \
;; \
*) \
echo "Unsupported LINUX_VER: ${LINUX_VER}" && exit 1; \
;; \
esac

# Install CUDA packages, only for CUDA 11 (CUDA 12+ should fetch from conda)
RUN \
case "${CUDA_VER}" in \
"11"*) \
PKG_CUDA_VER="$(echo ${CUDA_VER} | cut -d '.' -f1,2 | tr '.' '-')"; \
echo "Attempting to install CUDA Toolkit ${PKG_CUDA_VER}"; \
case "${LINUX_VER}" in \
"ubuntu"*) \
apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
cuda-gdb-${PKG_CUDA_VER} \
cuda-cudart-dev-${PKG_CUDA_VER} \
cuda-cupti-dev-${PKG_CUDA_VER} \
# ignore the build-essential package since it installs dependencies like gcc/g++
# we don't need them since we use conda compilers, so this keeps our images smaller
&& apt-get download cuda-nvcc-${PKG_CUDA_VER} \
&& dpkg -i --ignore-depends="build-essential" ./cuda-nvcc-*.deb \
&& rm ./cuda-nvcc-*.deb \
# apt will not work correctly if it thinks it needs the build-essential dependency
# so we patch it out with a sed command
&& sed -i 's/, build-essential//g' /var/lib/dpkg/status \
&& rm -rf "/var/lib/apt/lists/*"; \
;; \
"centos"* | "rockylinux"*) \
yum -y update \
&& yum -y install --setopt=install_weak_deps=False \
cuda-cudart-devel-${PKG_CUDA_VER} \
cuda-driver-devel-${PKG_CUDA_VER} \
cuda-gdb-${PKG_CUDA_VER} \
cuda-cupti-${PKG_CUDA_VER} \
&& rpm -Uvh --nodeps $(repoquery --location cuda-nvcc-${PKG_CUDA_VER}) \
&& yum clean all; \
;; \
*) \
echo "Unsupported LINUX_VER: ${LINUX_VER}" && exit 1; \
;; \
esac \
;; \
*) \
echo "Skipping CUDA Toolkit installation for CUDA ${CUDA_VER}"; \
;; \
esac

# Install gha-tools
RUN wget https://github.com/rapidsai/gha-tools/releases/latest/download/tools.tar.gz -O - \
| tar -xz -C /usr/local/bin
Expand Down