Skip to content

Commit 52d47e3

Browse files
author
Markus Perl
committed
Multiple packages updated
1 parent 050922d commit 52d47e3

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

cuda-ubuntu.dockerfile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ ENV DEBIAN_FRONTEND=noninteractive
77
ENV NVIDIA_VISIBLE_DEVICES=all
88
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
99

10-
RUN rm -rf /opt/hostedtoolcache && cd /opt && find . -maxdepth 1 -mindepth 1 '!' -path ./containerd '!' -path ./actionarchivecache '!' -path ./runner '!' -path ./runner-cache -exec rm -rf '{}' ';'
11-
RUN rm -rf /usr/share/dotnet && rm -rf /opt/ghc && rm -rf "/usr/local/share/boost" && rm -rf "$AGENT_TOOLSDIRECTORY"
12-
1310
# Update package lists
1411
RUN apt-get update
1512
# Install required packages
@@ -21,14 +18,21 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/do
2118
RUN update-ca-certificates
2219
# Create code directory
2320
RUN mkdir -p /code
24-
# Clone CUDA samples repository
25-
RUN git clone --depth 1 https://github.com/NVIDIA/cuda-samples.git /code/cuda-samples
26-
# Build deviceQuery
27-
RUN cd /code/cuda-samples/Samples/1_Utilities/deviceQuery && make
2821

29-
RUN cd /code/cuda-samples/Samples/1_Utilities/deviceQuery && make && \
30-
mv deviceQuery /usr/local/bin && \
31-
rm -rf /code/cuda-samples
22+
# Clone only specific subdirectory of CUDA samples needed for deviceQuery
23+
WORKDIR /code
24+
RUN mkdir -p /code/deviceQuery && \
25+
git clone --depth 1 --filter=blob:none --sparse https://github.com/NVIDIA/cuda-samples.git && \
26+
cd cuda-samples && \
27+
git sparse-checkout set Samples/1_Utilities/deviceQuery && \
28+
cp -r Samples/1_Utilities/deviceQuery/* /code/deviceQuery/ && \
29+
rm -rf cuda-samples
30+
31+
# Build deviceQuery (newer CUDA samples use a different directory structure)
32+
WORKDIR /code/deviceQuery
33+
RUN make && \
34+
cp deviceQuery /usr/local/bin/ && \
35+
rm -rf /code/deviceQuery
3236

3337
WORKDIR /app
3438
COPY ./build-ffmpeg /app/build-ffmpeg
@@ -42,10 +46,6 @@ ENV DEBIAN_FRONTEND=noninteractive
4246
ENV NVIDIA_VISIBLE_DEVICES=all
4347
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
4448

45-
# Cleanup Image
46-
RUN rm -rf /opt/hostedtoolcache && cd /opt && find . -maxdepth 1 -mindepth 1 '!' -path ./containerd '!' -path ./actionarchivecache '!' -path ./runner '!' -path ./runner-cache -exec rm -rf '{}' ';'
47-
RUN rm -rf /usr/share/dotnet && rm -rf /opt/ghc && rm -rf "/usr/local/share/boost" && rm -rf "$AGENT_TOOLSDIRECTORY"
48-
4949

5050
# Copy libnpp
5151
COPY --from=build /usr/local/cuda-12.9/targets/x86_64-linux/lib/libnppc.so /lib/x86_64-linux-gnu/libnppc.so.12

0 commit comments

Comments
 (0)