@@ -7,9 +7,6 @@ ENV DEBIAN_FRONTEND=noninteractive
7
7
ENV NVIDIA_VISIBLE_DEVICES=all
8
8
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
9
9
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
-
13
10
# Update package lists
14
11
RUN apt-get update
15
12
# Install required packages
@@ -21,14 +18,21 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/do
21
18
RUN update-ca-certificates
22
19
# Create code directory
23
20
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
28
21
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
32
36
33
37
WORKDIR /app
34
38
COPY ./build-ffmpeg /app/build-ffmpeg
@@ -42,10 +46,6 @@ ENV DEBIAN_FRONTEND=noninteractive
42
46
ENV NVIDIA_VISIBLE_DEVICES=all
43
47
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
44
48
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
-
49
49
50
50
# Copy libnpp
51
51
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