@@ -7,9 +7,6 @@ ENV DEBIAN_FRONTEND=noninteractive
77ENV NVIDIA_VISIBLE_DEVICES=all
88ENV 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
1411RUN 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
2118RUN update-ca-certificates
2219# Create code directory
2320RUN 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
3337WORKDIR /app
3438COPY ./build-ffmpeg /app/build-ffmpeg
@@ -42,10 +46,6 @@ ENV DEBIAN_FRONTEND=noninteractive
4246ENV NVIDIA_VISIBLE_DEVICES=all
4347ENV 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
5151COPY --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