Skip to content

Commit

Permalink
Make Arch CUDA image smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
FloopCZ committed Mar 16, 2020
1 parent 42dc92d commit e751f69
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfiles/archlinux
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ COPY . tensorflow_cc
# RUN git clone https://github.com/FloopCZ/tensorflow_cc.git

# build and install
RUN ./tensorflow_cc/Dockerfiles/install-archlinux.sh --shared
RUN ./tensorflow_cc/Dockerfiles/install-archlinux.sh
2 changes: 1 addition & 1 deletion Dockerfiles/archlinux-cuda
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY . tensorflow_cc
# RUN git clone https://github.com/FloopCZ/tensorflow_cc.git

# build and install
RUN ./tensorflow_cc/Dockerfiles/install-archlinux.sh --cuda --shared
RUN ./tensorflow_cc/Dockerfiles/install-archlinux.sh --cuda

ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
Expand Down
14 changes: 13 additions & 1 deletion Dockerfiles/install-archlinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pacman -Syu --noconfirm --needed \
wget

pacman -S --noconfirm --needed \
java-environment=8 \
jdk11-openjdk \
libarchive \
protobuf \
unzip \
Expand All @@ -41,6 +41,7 @@ if $cuda; then
cuda \
cudnn \
nccl
source /etc/profile.d/cuda.sh
fi

# when building TF with Intel MKL support, `locate` database needs to exist
Expand All @@ -54,4 +55,15 @@ if $cuda; then
rm -vf /usr/bin/nvidia*
rm -vf /usr/lib/libnvidia*
rm -vf /usr/lib/libcuda*
rm -rvf /opt/cuda/doc/
rm -rvf /opt/cuda/extras/
rm -rvf /opt/cuda/*nsight*
rm -rvf /opt/cuda/*nvvp*
rm -rvf /opt/cuda/samples/
fi

# cleanup packages
rm -rvf /usr/local/lib/bazel/
rm -vf /usr/local/bin/bazel
pacman --noconfirm -R jdk11-openjdk python python-numpy
pacman --noconfirm -Rns $(pacman -Qtdq)
2 changes: 1 addition & 1 deletion Dockerfiles/ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ COPY . tensorflow_cc
# RUN git clone https://github.com/FloopCZ/tensorflow_cc.git

# build and install
RUN ./tensorflow_cc/Dockerfiles/install-ubuntu.sh --shared
RUN ./tensorflow_cc/Dockerfiles/install-ubuntu.sh
2 changes: 1 addition & 1 deletion Dockerfiles/ubuntu-cuda
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ COPY . tensorflow_cc
# temporarily use the CUDA stubs, the real libraries will be provided by nvidia-docker
RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 \
&& LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs/:$LD_LIBRARY_PATH \
./tensorflow_cc/Dockerfiles/install-ubuntu.sh --shared --cuda \
./tensorflow_cc/Dockerfiles/install-ubuntu.sh --cuda \
&& rm /usr/local/cuda/lib64/stubs/libcuda.so.1

0 comments on commit e751f69

Please sign in to comment.