Skip to content

Commit 4521a2d

Browse files
authored
Update Dockerfile for nvidia runtime
Setting the runtime to default to nvidia as these are GPU nodes and will likely run GPU-accelerated workloads only. I'm happy to have this optional to avoid confusion but I think it's beneficial to include it for those wondering.
1 parent 298716e commit 4521a2d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/usage/advanced/cuda/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ RUN apt-get update && apt-get install -y curl \
1212
tee /etc/apt/sources.list.d/nvidia-container-toolkit.list \
1313
&& apt-get update && apt-get install -y nvidia-container-toolkit \
1414
&& nvidia-ctk runtime configure --runtime=containerd
15+
# Set alternative 'nvidia' runtime as default prior to container start.
16+
# GPU nodes will always use the nvidia runtime without the need to explicitly define it.
17+
&& mkdir -p /etc/rancher/k3s && echo "default-runtime: nvidia" > /etc/rancher/k3s/config.yaml
1518

1619
COPY --from=k3s / / --exclude=/bin
1720
COPY --from=k3s /bin /bin
@@ -27,4 +30,4 @@ VOLUME /var/log
2730
ENV PATH="$PATH:/bin/aux"
2831

2932
ENTRYPOINT ["/bin/k3s"]
30-
CMD ["agent"]
33+
CMD ["agent"]

0 commit comments

Comments
 (0)