Skip to content

Commit

Permalink
Skip CUDA install if no NVIDIA GPU
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-penev authored and vgvassilev committed Sep 28, 2023
1 parent 918284d commit 7607f3a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ ENV LC_ALL=en_US.UTF-8 \

# Install all OS dependencies for notebook server that starts but lacks all
# features (e.g., download as all possible file formats)
RUN apt-get update --yes && \
RUN \
apt-get update --yes && \
apt-get install --yes --no-install-recommends pciutils && \
_CUDA_=$(lspci -nn | grep '\[03' | grep NVIDIA) && \
apt-get install --yes --no-install-recommends \
#fonts-liberation, pandoc, run-one are inherited from base-notebook container image
# Other "our" apt installs
Expand All @@ -45,7 +48,7 @@ RUN apt-get update --yes && \
emacs \
# CUDA
#cuda \
nvidia-cuda-toolkit \
$([ -n "$_CUDA_" ] && echo nvidia-cuda-toolkit) \
&& \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
Expand Down

0 comments on commit 7607f3a

Please sign in to comment.